summaryrefslogtreecommitdiff
path: root/tests/lexers/applescript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lexers/applescript')
-rw-r--r--tests/lexers/applescript/example.txt38
-rw-r--r--tests/lexers/applescript/example2.txt84
2 files changed, 122 insertions, 0 deletions
diff --git a/tests/lexers/applescript/example.txt b/tests/lexers/applescript/example.txt
new file mode 100644
index 00000000..f076b5b0
--- /dev/null
+++ b/tests/lexers/applescript/example.txt
@@ -0,0 +1,38 @@
+---input---
+set jp to "日本語"
+
+set ru to "Русский"
+
+jp & " and " & ru -- returns "日本語 and Русский"
+
+---tokens---
+'set' Keyword
+' ' Text
+'jp' Name.Variable
+' ' Text
+'to' Keyword
+' ' Text
+'"日本語"' Literal.String.Double
+'\n\n' Text
+
+'set' Keyword
+' ' Text
+'ru' Name.Variable
+' ' Text
+'to' Keyword
+' ' Text
+'"Русский"' Literal.String.Double
+'\n\n' Text
+
+'jp' Name.Variable
+' ' Text
+'&' Operator
+' ' Text
+'" and "' Literal.String.Double
+' ' Text
+'&' Operator
+' ' Text
+'ru' Name.Variable
+' ' Text
+'-- returns "日本語 and Русский"' Comment
+'\n' Text
diff --git a/tests/lexers/applescript/example2.txt b/tests/lexers/applescript/example2.txt
new file mode 100644
index 00000000..5e94ba61
--- /dev/null
+++ b/tests/lexers/applescript/example2.txt
@@ -0,0 +1,84 @@
+---input---
+tell application "System Events"
+ tell network preferences
+ tell current location
+ set aPPPoEService to a reference to (first service whose kind is 10)
+ if exists aPPPoEService then
+ connect aPPPoEService
+ end if
+ end tell
+ end tell
+end tell
+
+---tokens---
+'tell' Keyword
+' ' Text
+'application' Name.Builtin
+' ' Text
+'"System Events"' Literal.String.Double
+'\n ' Text
+'tell' Keyword
+' ' Text
+'network' Name.Variable
+' ' Text
+'preferences' Name.Variable
+'\n ' Text
+'tell' Keyword
+' ' Text
+'current' Name.Variable
+' ' Text
+'location' Name.Attribute
+'\n ' Text
+'set' Keyword
+' ' Text
+'aPPPoEService' Name.Variable
+' ' Text
+'to' Keyword
+' ' Text
+'a' Name.Variable
+' ' Text
+'reference to' Operator.Word
+' ' Text
+'(' Punctuation
+'first' Name.Builtin
+' ' Text
+'service' Name.Variable
+' ' Text
+'whose' Name.Builtin
+' ' Text
+'kind' Name.Variable
+' ' Text
+'is' Operator.Word
+' ' Text
+'10' Literal.Number.Integer
+')' Punctuation
+'\n ' Text
+'if' Keyword
+' ' Text
+'exists' Name.Builtin
+' ' Text
+'aPPPoEService' Name.Variable
+' ' Text
+'then' Keyword
+'\n ' Text
+'connect' Name.Variable
+' ' Text
+'aPPPoEService' Name.Variable
+'\n ' Text
+'end' Keyword
+' ' Text
+'if' Keyword
+'\n ' Text
+'end' Keyword
+' ' Text
+'tell' Keyword
+'\n ' Text
+'end' Keyword
+' ' Text
+'tell' Keyword
+'\n' Text
+
+'end' Keyword
+' ' Text
+'tell' Keyword
+'\n' Text