summaryrefslogtreecommitdiff
path: root/tests/lexers/bash/example.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lexers/bash/example.txt')
-rw-r--r--tests/lexers/bash/example.txt153
1 files changed, 153 insertions, 0 deletions
diff --git a/tests/lexers/bash/example.txt b/tests/lexers/bash/example.txt
new file mode 100644
index 00000000..ccaaf1ab
--- /dev/null
+++ b/tests/lexers/bash/example.txt
@@ -0,0 +1,153 @@
+---input---
+#!/bin/bash
+
+printf "%d %s\n" 10 "foo"
+printf "%d %s\n" $((10#1)) "bar"
+
+let "m = 10#${1:1:2}"
+echo $m
+
+m=$((10#${1:4:3} + 10#${1:1:3}))
+echo $m
+
+m=$((10#${1:4:3}))
+echo $m
+
+m=$((10#$1))
+echo $m
+
+m=$((10#1))
+echo $m
+
+m=$((10))
+echo $m
+
+---tokens---
+'#!/bin/bash\n' Comment.Hashbang
+
+'\n' Text
+
+'printf' Name.Builtin
+' ' Text
+'"%d %s\\n"' Literal.String.Double
+' ' Text
+'10' Literal.Number
+' ' Text
+'"foo"' Literal.String.Double
+'\n' Text
+
+'printf' Name.Builtin
+' ' Text
+'"%d %s\\n"' Literal.String.Double
+' ' Text
+'$((' Keyword
+'10#1' Literal.Number
+'))' Keyword
+' ' Text
+'"bar"' Literal.String.Double
+'\n\n' Text
+
+'let' Name.Builtin
+' ' Text
+'"' Literal.String.Double
+'m = 10#' Literal.String.Double
+'${' Literal.String.Interpol
+'1' Name.Variable
+':' Punctuation
+'1' Name.Variable
+':' Punctuation
+'2' Name.Variable
+'}' Literal.String.Interpol
+'"' Literal.String.Double
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10#' Literal.Number
+'${' Literal.String.Interpol
+'1' Name.Variable
+':' Punctuation
+'4' Name.Variable
+':' Punctuation
+'3' Name.Variable
+'}' Literal.String.Interpol
+' ' Text
+'+' Operator
+' ' Text
+'10#' Literal.Number
+'${' Literal.String.Interpol
+'1' Name.Variable
+':' Punctuation
+'1' Name.Variable
+':' Punctuation
+'3' Name.Variable
+'}' Literal.String.Interpol
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10#' Literal.Number
+'${' Literal.String.Interpol
+'1' Name.Variable
+':' Punctuation
+'4' Name.Variable
+':' Punctuation
+'3' Name.Variable
+'}' Literal.String.Interpol
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10#' Literal.Number
+'$1' Name.Variable
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10#1' Literal.Number
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10' Literal.Number
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n' Text