Skip to content

Commit

Permalink
Autohotkey: Improved tag pattern (#2920)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Jun 8, 2021
1 parent a62ef79 commit fc2a333
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 5 deletions.
6 changes: 5 additions & 1 deletion components/prism-autohotkey.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-autohotkey.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions tests/languages/autohotkey/issue2911.test
@@ -0,0 +1,43 @@
A.invert({1:"a", 2:"A"})
; => {"a":2}

NormalLabel:
; do something
return
TabbedLabel:
; do something
return
Sus{}//[]Label:
; do something
return

----------------------------------------------------

[
"A",
["operator", "."],
["function", "invert"],
["punctuation", "("],
["punctuation", "{"],
["number", "1"],
["punctuation", ":"],
["string", "\"a\""],
["punctuation", ","],
["number", "2"],
["punctuation", ":"],
["string", "\"A\""],
["punctuation", "}"],
["punctuation", ")"],

["comment", "; => {\"a\":2}"],

["tag", "NormalLabel"], ["punctuation", ":"],
["comment", "; do something"],
["selector", "return"],
["tag", "TabbedLabel"], ["punctuation", ":"],
["comment", "; do something"],
["selector", "return"],
["tag", "Sus{}//[]Label"], ["punctuation", ":"],
["comment", "; do something"],
["selector", "return"]
]
16 changes: 13 additions & 3 deletions tests/languages/autohotkey/tag_feature.test
@@ -1,15 +1,25 @@
foo:
foo_bar:

validLabel: ; a comment
/* multiline comment
*/ validLabel:

----------------------------------------------------

[
["tag", "foo"],
["tag", "foo"], ["punctuation", ":"],
["tag", "foo_bar"], ["punctuation", ":"],

["tag", "validLabel"],
["punctuation", ":"],
["tag", "foo_bar"],
["comment", "; a comment"],

["comment", "/* multiline comment\r\n*/"],
["tag", "validLabel"],
["punctuation", ":"]
]

----------------------------------------------------

Checks for tags (labels).
Checks for tags (labels).

0 comments on commit fc2a333

Please sign in to comment.