-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tokenization testing #4
Changes from 12 commits
d312770
e858f22
7acdd46
f8b3fdd
5bf8f02
f57725f
5bbe142
ae56b8e
6268ab0
8559e1b
45a56bc
61de333
ca448c5
26bc9e4
b32f286
7743e40
9651b41
63f6e78
61984d6
e660dde
c8b408d
e92b79a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
target | ||
target | ||
|
||
# Only used to run tests: | ||
node_modules | ||
package-lock.json | ||
package.json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normally package.json is not in the .gitignore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SYNTAX TEST "Emoji" | ||
|
||
🌊 | ||
# <-- constant.language | ||
|
||
foo 🌊 bar | ||
# ^ -constant.language | ||
# ^^ constant.language | ||
# ^ -constant.language | ||
|
||
🙂🙁 | ||
# <---- constant.language | ||
|
||
foo 🙂 bar 🙁 | ||
# ^^ constant.language | ||
# ^^^^^ -constant.language | ||
# ^^ constant.language |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# SYNTAX TEST "Pico" | ||
|
||
%% foo bar | ||
# <-- Comment | ||
# ^^^^^^^ Comment | ||
|
||
%% do | ||
# ^^ Comment | ||
|
||
do | ||
# <-- keyword.control |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SYNTAX TEST "PicoWithCategories" | ||
|
||
%% foo bar | ||
# <-- comment.line | ||
# ^^^^^^^ comment.line | ||
|
||
%% do | ||
# ^^ comment.line | ||
|
||
do | ||
# <-- variable.other | ||
# Note: Keywords can be identifiers in Pico | ||
|
||
123 | ||
# <--- constant.numeric | ||
|
||
foo123 | ||
# <------- variable.other | ||
|
||
foo_123 | ||
# <--- variable.other | ||
# ^ -variable.other | ||
# ^ -constant.numeric | ||
# ^^^ constant.numeric | ||
# Note: Underscores cannot occur in identifiers in Pico | ||
|
||
#begin | ||
## <----- keyword.control | ||
## TODO: `begin` outside `begin`-`end` can never be an identifier in Pico | ||
|
||
#"foo" "bar" | ||
## <----- string.quoted.double | ||
## ^ -string.quoted.double | ||
## ^^^^^ string.quoted.double | ||
## TODO: Support multiline productions | ||
|
||
#"foo\"bar" | ||
## <---- string.quoted.double | ||
## ^^ string.quoted.double | ||
## ^^^^ string.quoted.double | ||
## TODO: Support multiline productions with escaping |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
npx vscode-tmgrammar-test ^ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like the bat is the exact same. how about we move it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed:
|
||
--grammar target/generated-test-grammars/%1.tmLanguage.json ^ | ||
"./src/main/rascal/lang/textmate/conversiontests/%1.test" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
npx vscode-tmgrammar-test \ | ||
--grammar target/generated-test-grammars/$1.tmLanguage.json \ | ||
"./src/main/rascal/lang/textmate/conversiontests/$1.test" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes in this file are due to the "extra" change in this PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, it's going to be a blast of a merge conflict with my other small PR. which might be a reason to pull those changes out of this PR and apply them on main after merging that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merged |
||
"repository": { | ||
"prod(lex(\"Comment\"),[lit(\"//\"),conditional(\\iter-star(\\char-class([range(1,9),range(11,1114111)])),{\\not-follow(\\char-class([range(9,9),range(13,13),range(32,32),range(160,160),range(5760,5760),range(8192,8202),range(8239,8239),range(8287,8287),range(12288,12288)])),\\end-of-line()})],{tag(\"category\"(\"comment\"))})": { | ||
"match": "((?:\\x{2F}\\x{2F})(?:(?:[\\x{1}-\\x{9}]|[\\x{B}-\\x{10FFFF}])*?(?!(?:[\\x{9}-\\x{9}]|[\\x{D}-\\x{D}]|[\\x{20}-\\x{20}]|[\\x{A0}-\\x{A0}]|[\\x{1680}-\\x{1680}]|[\\x{2000}-\\x{200A}]|[\\x{202F}-\\x{202F}]|[\\x{205F}-\\x{205F}]|[\\x{3000}-\\x{3000}]))(?:$)))", | ||
"match": "((?:\\x{2F}\\x{2F})(?:(?:[\\x{1}-\\x{9}]|[\\x{B}-\\x{10FFFF}])*?(?!(?:\\x{9}|\\x{D}|\\x{20}|\\x{A0}|\\x{1680}|[\\x{2000}-\\x{200A}]|\\x{202F}|\\x{205F}|\\x{3000}))(?:$)))", | ||
"name": "prod(lex(\"Comment\"),[lit(\"//\"),conditional(\\iter-star(\\char-class([range(1,9),range(11,1114111)])),{\\not-follow(\\char-class([range(9,9),range(13,13),range(32,32),range(160,160),range(5760,5760),range(8192,8202),range(8239,8239),range(8287,8287),range(12288,12288)])),\\end-of-line()})],{tag(\"category\"(\"comment\"))})", | ||
"captures": { | ||
"1": { | ||
|
@@ -46,7 +46,7 @@ | |
} | ||
}, | ||
{ | ||
"match": "((?:[\\x{1}-\\x{9}]|[\\x{B}-\\x{3B}]|[\\x{3D}-\\x{3D}]|[\\x{3F}-\\x{5B}]|[\\x{5D}-\\x{5F}]|[a-\\x{10FFFF}])+?(?!(?:[\\x{1}-\\x{9}]|[\\x{B}-\\x{3B}]|[\\x{3D}-\\x{3D}]|[\\x{3F}-\\x{5B}]|[\\x{5D}-\\x{5F}]|[a-\\x{10FFFF}])))", | ||
"match": "((?:[\\x{1}-\\x{9}]|[\\x{B}-\\x{3B}]|\\x{3D}|[\\x{3F}-\\x{5B}]|[\\x{5D}-\\x{5F}]|[a-\\x{10FFFF}])+?(?!(?:[\\x{1}-\\x{9}]|[\\x{B}-\\x{3B}]|\\x{3D}|[\\x{3F}-\\x{5B}]|[\\x{5D}-\\x{5F}]|[a-\\x{10FFFF}])))", | ||
"name": "prod(label(\"text\",lex(\"ConcretePart\")),[conditional(iter(\\char-class([range(1,9),range(11,59),range(61,61),range(63,91),range(93,95),range(97,1114111)])),{\\not-follow(\\char-class([range(1,9),range(11,59),range(61,61),range(63,91),range(93,95),range(97,1114111)]))})],{tag(\"category\"(\"string\"))})", | ||
"captures": { | ||
"1": { | ||
|
@@ -80,7 +80,7 @@ | |
"end": "(?:\\x{5D})", | ||
"patterns": [ | ||
{ | ||
"match": "((?:\\x{5C})(?:[\\x{20}-\\x{20}]|[\\x{22}-\\x{22}]|[\\x{27}-\\x{27}]|[\\x{2D}-\\x{2D}]|[\\x{3C}-\\x{3C}]|[\\x{3E}-\\x{3E}]|[\\x{5B}-\\x{5D}]|[b-b]|[f-f]|[n-n]|[r-r]|[t-t]))", | ||
"match": "((?:\\x{5C})(?:\\x{20}|\\x{22}|\\x{27}|\\x{2D}|\\x{3C}|\\x{3E}|[\\x{5B}-\\x{5D}]|b|f|n|r|t))", | ||
"name": "prod(lex(\"Char\"),[lit(\"\\\\\"),\\char-class([range(32,32),range(34,34),range(39,39),range(45,45),range(60,60),range(62,62),range(91,93),range(98,98),range(102,102),range(110,110),range(114,114),range(116,116)])],{tag(\"category\"(\"constant\"))})", | ||
"captures": { | ||
"1": { | ||
|
@@ -89,7 +89,7 @@ | |
} | ||
}, | ||
{ | ||
"match": "((?:(?:\\x{5C})[U-U](?:(?:\\b10\\b)|(?:(?:\\b0\\b)(?:[0-9]|[A-F]|[a-f])))(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f]))|(?:(?:\\x{5C})[u-u](?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f]))|(?:(?:\\x{5C})[a-a][0-7](?:[0-9]|[A-F]|[a-f])))", | ||
"match": "((?:(?:\\x{5C})U(?:(?:\\b10\\b)|(?:(?:\\b0\\b)(?:[0-9]|[A-F]|[a-f])))(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f]))|(?:(?:\\x{5C})u(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f])(?:[0-9]|[A-F]|[a-f]))|(?:(?:\\x{5C})a[0-7](?:[0-9]|[A-F]|[a-f])))", | ||
"name": "prod(lex(\"Char\"),[lex(\"UnicodeEscape\")],{tag(\"category\"(\"constant\"))})", | ||
"captures": { | ||
"1": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add which version of node we need. and enable caching to improve CI times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed