summaryrefslogtreecommitdiffstats
path: root/tests/snippets/tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/snippets/tcl')
-rw-r--r--tests/snippets/tcl/test_comma_and_at.txt131
-rw-r--r--tests/snippets/tcl/test_vars.txt17
2 files changed, 148 insertions, 0 deletions
diff --git a/tests/snippets/tcl/test_comma_and_at.txt b/tests/snippets/tcl/test_comma_and_at.txt
new file mode 100644
index 0000000..51e1733
--- /dev/null
+++ b/tests/snippets/tcl/test_comma_and_at.txt
@@ -0,0 +1,131 @@
+---input---
+# Alt and arrow keys to scroll
+set scroll_amount 2
+bind Text <Alt-Up> {
+ %W yview scroll -$scroll_amount units
+ %W mark set insert @0,[expr [winfo height %W] / 2]
+}
+bind Text <Alt-Down> {
+ %W yview scroll $scroll_amount units
+ %W mark set insert @0,[expr [winfo height %W] / 2]
+}
+
+---tokens---
+'#' Comment
+' Alt and arrow keys to scroll\n' Comment
+
+'set' Keyword
+' ' Text.Whitespace
+'scroll_amount' Text
+' ' Text.Whitespace
+'2' Literal.Number.Integer
+'\n' Text
+
+'bind' Name.Variable
+' ' Text.Whitespace
+'Text' Text
+' ' Text.Whitespace
+'<' Operator
+'Alt-Up' Text
+'>' Operator
+' ' Text.Whitespace
+'{' Keyword
+'\n ' Text.Whitespace
+'%' Operator
+'W' Name.Variable
+' ' Text.Whitespace
+'yview' Text
+' ' Text.Whitespace
+'scroll' Text
+' ' Text.Whitespace
+'-' Operator
+'$scroll_amount' Name.Variable
+' ' Text.Whitespace
+'units' Text
+'\n' Text
+
+' ' Text.Whitespace
+'%' Operator
+'W' Name.Variable
+' ' Text.Whitespace
+'mark' Text
+' ' Text.Whitespace
+'set' Text
+' ' Text.Whitespace
+'insert' Text
+' ' Text.Whitespace
+'@0,' Text
+'[' Keyword
+'expr' Keyword
+' ' Text.Whitespace
+'[' Keyword
+'winfo' Name.Variable
+' ' Text.Whitespace
+'height' Text
+' ' Text.Whitespace
+'%' Operator
+'W' Text
+']' Keyword
+' ' Text.Whitespace
+'/' Operator
+' ' Text.Whitespace
+'2' Literal.Number.Integer
+']' Keyword
+'\n' Text
+
+'}' Keyword
+'\n' Text
+
+'bind' Name.Variable
+' ' Text.Whitespace
+'Text' Text
+' ' Text.Whitespace
+'<' Operator
+'Alt-Down' Text
+'>' Operator
+' ' Text.Whitespace
+'{' Keyword
+'\n ' Text.Whitespace
+'%' Operator
+'W' Name.Variable
+' ' Text.Whitespace
+'yview' Text
+' ' Text.Whitespace
+'scroll' Text
+' ' Text.Whitespace
+'$scroll_amount' Name.Variable
+' ' Text.Whitespace
+'units' Text
+'\n' Text
+
+' ' Text.Whitespace
+'%' Operator
+'W' Name.Variable
+' ' Text.Whitespace
+'mark' Text
+' ' Text.Whitespace
+'set' Text
+' ' Text.Whitespace
+'insert' Text
+' ' Text.Whitespace
+'@0,' Text
+'[' Keyword
+'expr' Keyword
+' ' Text.Whitespace
+'[' Keyword
+'winfo' Name.Variable
+' ' Text.Whitespace
+'height' Text
+' ' Text.Whitespace
+'%' Operator
+'W' Text
+']' Keyword
+' ' Text.Whitespace
+'/' Operator
+' ' Text.Whitespace
+'2' Literal.Number.Integer
+']' Keyword
+'\n' Text
+
+'}' Keyword
+'\n' Text
diff --git a/tests/snippets/tcl/test_vars.txt b/tests/snippets/tcl/test_vars.txt
new file mode 100644
index 0000000..5c62390
--- /dev/null
+++ b/tests/snippets/tcl/test_vars.txt
@@ -0,0 +1,17 @@
+---input---
+set size 10; puts ${size}x${size}
+
+---tokens---
+'set' Keyword
+' ' Text.Whitespace
+'size' Text
+' ' Text.Whitespace
+'10' Literal.Number.Integer
+';' Keyword
+' ' Text.Whitespace
+'puts' Name.Builtin
+' ' Text.Whitespace
+'${size}' Name.Variable
+'x' Text
+'${size}' Name.Variable
+'\n' Text