Skip to content

Commit

Permalink
Update generated TextMate grammar for Rascal's own grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
sungshik committed Jul 16, 2024
1 parent 0261194 commit 0546433
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions vscode-extension/syntaxes/rascal.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@
}
}
},
"prod(label(\"rational\",sort(\"Literal\")),[label(\"rationalLiteral\",lex(\"RationalLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})": {
"match": "((?:[1-9][0-9]*?r[0-9](?:[0-9]*?(?!(?:[0-9]|[A-Z]|\\_|[a-z]))))|(?:[0-9][0-9]*?r))",
"name": "prod(label(\"rational\",sort(\"Literal\")),[label(\"rationalLiteral\",lex(\"RationalLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})",
"captures": {
"1": {
"name": "constant.numeric"
}
}
},
"prod(label(\"integer\",sort(\"Literal\")),[label(\"integerLiteral\",sort(\"IntegerLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})": {
"match": "((?:0(?:[0-7]+?(?!(?:[0-9]|[A-Z]|\\_|[a-z]))))|(?:(?:[1-9](?:[0-9]*?(?!(?:[0-9]|[A-Z]|\\_|[a-z]))))|(?:(?:\\b0\\b)(?!(?:[0-9]|[A-Z]|\\_|[a-z]))))|(?:0(?:X|x)(?:(?:[0-9]|[A-F]|[a-f])+?(?!(?:[0-9]|[A-Z]|\\_|[a-z])))))",
"name": "prod(label(\"integer\",sort(\"Literal\")),[label(\"integerLiteral\",sort(\"IntegerLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})",
"captures": {
"1": {
"name": "constant.numeric"
}
}
},
"prod(lex(\"keywords\"),[alt({lit(\"lexical\"),lit(\"loc\"),lit(\"if\"),lit(\"assoc\"),lit(\"test\"),lit(\"lrel\"),lit(\"throws\"),lit(\"clear\"),lit(\"module\"),lit(\"any\"),lit(\"int\"),lit(\"quit\"),lit(\"o\"),lit(\"anno\"),lit(\"true\"),lit(\"public\"),lit(\"keyword\"),lit(\"for\"),lit(\"tuple\"),lit(\"bracket\"),lit(\"bag\"),lit(\"it\"),lit(\"visit\"),lit(\"do\"),lit(\"data\"),lit(\"layout\"),lit(\"bool\"),lit(\"edit\"),lit(\"join\"),lit(\"is\"),lit(\"import\"),lit(\"view\"),lit(\"in\"),lit(\"rat\"),lit(\"modules\"),lit(\"continue\"),lit(\"left\"),lit(\"num\"),lit(\"assert\"),lit(\"throw\"),lit(\"one\"),lit(\"help\"),lit(\"default\"),lit(\"all\"),lit(\"global\"),lit(\"syntax\"),lit(\"false\"),lit(\"finally\"),lit(\"private\"),lit(\"mod\"),lit(\"java\"),lit(\"node\"),lit(\"start\"),lit(\"set\"),lit(\"right\"),lit(\"variable\"),lit(\"map\"),lit(\"10\"),lit(\"on\"),lit(\"break\"),lit(\"dynamic\"),lit(\"solve\"),lit(\"fail\"),lit(\"unimport\"),lit(\"outermost\"),lit(\"real\"),lit(\"list\"),lit(\"insert\"),lit(\"innermost\"),lit(\"declarations\"),lit(\"else\"),lit(\"rel\"),lit(\"function\"),lit(\"notin\"),lit(\"filter\"),lit(\"datetime\"),lit(\"catch\"),lit(\"try\"),lit(\"renaming\"),lit(\"tag\"),lit(\"has\"),lit(\"Z\"),lit(\"when\"),lit(\"type\"),lit(\"append\"),lit(\"extend\"),lit(\"switch\"),lit(\"void\"),lit(\"history\"),lit(\"T\"),lit(\"while\"),lit(\"str\"),lit(\"value\"),lit(\"undeclare\"),lit(\"case\"),lit(\"alias\"),lit(\"return\"),lit(\"0\")})],{tag(\"category\"(\"keyword.control\"))})": {
"match": "((?:\\blexical\\b)|(?:\\bloc\\b)|(?:\\bif\\b)|(?:\\bassoc\\b)|(?:\\btest\\b)|(?:\\blrel\\b)|(?:\\bthrows\\b)|(?:\\bclear\\b)|(?:\\bmodule\\b)|(?:\\bany\\b)|(?:\\bint\\b)|(?:\\bquit\\b)|(?:\\bo\\b)|(?:\\banno\\b)|(?:\\btrue\\b)|(?:\\bpublic\\b)|(?:\\bkeyword\\b)|(?:\\bfor\\b)|(?:\\btuple\\b)|(?:\\bbracket\\b)|(?:\\bbag\\b)|(?:\\bit\\b)|(?:\\bvisit\\b)|(?:\\bdo\\b)|(?:\\bdata\\b)|(?:\\blayout\\b)|(?:\\bbool\\b)|(?:\\bedit\\b)|(?:\\bjoin\\b)|(?:\\bis\\b)|(?:\\bimport\\b)|(?:\\bview\\b)|(?:\\bin\\b)|(?:\\brat\\b)|(?:\\bmodules\\b)|(?:\\bcontinue\\b)|(?:\\bleft\\b)|(?:\\bnum\\b)|(?:\\bassert\\b)|(?:\\bthrow\\b)|(?:\\bone\\b)|(?:\\bhelp\\b)|(?:\\bdefault\\b)|(?:\\ball\\b)|(?:\\bglobal\\b)|(?:\\bsyntax\\b)|(?:\\bfalse\\b)|(?:\\bfinally\\b)|(?:\\bprivate\\b)|(?:\\bmod\\b)|(?:\\bjava\\b)|(?:\\bnode\\b)|(?:\\bstart\\b)|(?:\\bset\\b)|(?:\\bright\\b)|(?:\\bvariable\\b)|(?:\\bmap\\b)|(?:\\b10\\b)|(?:\\bon\\b)|(?:\\bbreak\\b)|(?:\\bdynamic\\b)|(?:\\bsolve\\b)|(?:\\bfail\\b)|(?:\\bunimport\\b)|(?:\\boutermost\\b)|(?:\\breal\\b)|(?:\\blist\\b)|(?:\\binsert\\b)|(?:\\binnermost\\b)|(?:\\bdeclarations\\b)|(?:\\belse\\b)|(?:\\brel\\b)|(?:\\bfunction\\b)|(?:\\bnotin\\b)|(?:\\bfilter\\b)|(?:\\bdatetime\\b)|(?:\\bcatch\\b)|(?:\\btry\\b)|(?:\\brenaming\\b)|(?:\\btag\\b)|(?:\\bhas\\b)|(?:\\bZ\\b)|(?:\\bwhen\\b)|(?:\\btype\\b)|(?:\\bappend\\b)|(?:\\bextend\\b)|(?:\\bswitch\\b)|(?:\\bvoid\\b)|(?:\\bhistory\\b)|(?:\\bT\\b)|(?:\\bwhile\\b)|(?:\\bstr\\b)|(?:\\bvalue\\b)|(?:\\bundeclare\\b)|(?:\\bcase\\b)|(?:\\balias\\b)|(?:\\breturn\\b)|(?:\\b0\\b))",
"name": "prod(lex(\"keywords\"),[alt({lit(\"lexical\"),lit(\"loc\"),lit(\"if\"),lit(\"assoc\"),lit(\"test\"),lit(\"lrel\"),lit(\"throws\"),lit(\"clear\"),lit(\"module\"),lit(\"any\"),lit(\"int\"),lit(\"quit\"),lit(\"o\"),lit(\"anno\"),lit(\"true\"),lit(\"public\"),lit(\"keyword\"),lit(\"for\"),lit(\"tuple\"),lit(\"bracket\"),lit(\"bag\"),lit(\"it\"),lit(\"visit\"),lit(\"do\"),lit(\"data\"),lit(\"layout\"),lit(\"bool\"),lit(\"edit\"),lit(\"join\"),lit(\"is\"),lit(\"import\"),lit(\"view\"),lit(\"in\"),lit(\"rat\"),lit(\"modules\"),lit(\"continue\"),lit(\"left\"),lit(\"num\"),lit(\"assert\"),lit(\"throw\"),lit(\"one\"),lit(\"help\"),lit(\"default\"),lit(\"all\"),lit(\"global\"),lit(\"syntax\"),lit(\"false\"),lit(\"finally\"),lit(\"private\"),lit(\"mod\"),lit(\"java\"),lit(\"node\"),lit(\"start\"),lit(\"set\"),lit(\"right\"),lit(\"variable\"),lit(\"map\"),lit(\"10\"),lit(\"on\"),lit(\"break\"),lit(\"dynamic\"),lit(\"solve\"),lit(\"fail\"),lit(\"unimport\"),lit(\"outermost\"),lit(\"real\"),lit(\"list\"),lit(\"insert\"),lit(\"innermost\"),lit(\"declarations\"),lit(\"else\"),lit(\"rel\"),lit(\"function\"),lit(\"notin\"),lit(\"filter\"),lit(\"datetime\"),lit(\"catch\"),lit(\"try\"),lit(\"renaming\"),lit(\"tag\"),lit(\"has\"),lit(\"Z\"),lit(\"when\"),lit(\"type\"),lit(\"append\"),lit(\"extend\"),lit(\"switch\"),lit(\"void\"),lit(\"history\"),lit(\"T\"),lit(\"while\"),lit(\"str\"),lit(\"value\"),lit(\"undeclare\"),lit(\"case\"),lit(\"alias\"),lit(\"return\"),lit(\"0\")})],{tag(\"category\"(\"keyword.control\"))})",
Expand All @@ -18,6 +36,15 @@
}
}
},
"prod(label(\"real\",sort(\"Literal\")),[label(\"realLiteral\",lex(\"RealLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})": {
"match": "((?:(?:(?<!\\.)(?:\\.))[0-9]+?(?:E|e)(?:\\+|\\-)??[0-9]+?(?:D|F|d|f)??)|(?:[0-9]+?(?:(?:\\.)(?!(?:\\.)))[0-9]*?(?:D|F|d|f)??)|(?:(?:(?<!\\.)(?:\\.))[0-9]+?(?:D|F|d|f)??)|(?:[0-9]+?(?:E|e)(?:\\+|\\-)??[0-9]+?(?:D|F|d|f)??)|(?:[0-9]+?(?:D|F|d|f))|(?:[0-9]+?(?:\\.)[0-9]*?(?:E|e)(?:\\+|\\-)??[0-9]+?(?:D|F|d|f)??))",
"name": "prod(label(\"real\",sort(\"Literal\")),[label(\"realLiteral\",lex(\"RealLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})",
"captures": {
"1": {
"name": "constant.numeric"
}
}
},
"prod(lex(\"delimiters\"),[alt({lit(\"bottom-up-break\"),lit(\")\"),lit(\"\"),lit(\"\\n\"),lit(\"!:=\"),lit(\"\\'\"),lit(\"!=\"),lit(\"\\>=\"),lit(\"://\"),lit(\"non-assoc\"),lit(\"&=\"),lit(\"\\<-\"),lit(\"*=\"),lit(\"+=\"),lit(\"top-down-break\"),lit(\",\"),lit(\"...\"),lit(\"/=\"),lit(\"\"),lit(\"(\"),lit(\"*/\"),lit(\"%\"),lit(\"!\\<\\<\"),lit(\"=\\>\"),lit(\"!\\>\\>\"),lit(\"||\"),lit(\"\\>\\>\"),lit(\"::\"),lit(\"\"),lit(\"&&\"),lit(\"@\"),lit(\":=\"),lit(\"#\"),lit(\"\\<==\\>\"),lit(\"\\\"\"),lit(\"\\<\\<=\"),lit(\"}\"),lit(\"?=\"),lit(\"\\<:\"),lit(\"==\\>\"),lit(\"^\"),lit(\"/*\"),lit(\";\"),lit(\"{\"),lit(\"-=\"),lit(\"$T\")})],{})": {
"match": "(?:(?:bottom\\-up\\-break)|(?:\\))|(?:\\x{226B})|(?:\\n)|(?:\\!\\:\\=)|(?:\\')|(?:\\!\\=)|(?:\\>\\=)|(?:\\:\\/\\/)|(?:non\\-assoc)|(?:\\&\\=)|(?:\\<\\-)|(?:\\*\\=)|(?:\\+\\=)|(?:top\\-down\\-break)|(?:\\,)|(?:\\.\\.\\.)|(?:\\/\\=)|(?:\\x{21E8})|(?:\\()|(?:\\*\\/)|(?:\\%)|(?:\\!\\<\\<)|(?:\\=\\>)|(?:\\!\\>\\>)|(?:\\|\\|)|(?:\\>\\>)|(?:\\:\\:)|(?:\\x{26A0})|(?:\\&\\&)|(?:\\@)|(?:\\:\\=)|(?:\\#)|(?:\\<\\=\\=\\>)|(?:\\\")|(?:\\<\\<\\=)|(?:\\})|(?:\\?\\=)|(?:\\<\\:)|(?:\\=\\=\\>)|(?:\\^)|(?:\\/\\*)|(?:\\;)|(?:\\{)|(?:\\-\\=)|(?:\\$T))",
"name": "prod(lex(\"delimiters\"),[alt({lit(\"bottom-up-break\"),lit(\")\"),lit(\"\"),lit(\"\\n\"),lit(\"!:=\"),lit(\"\\'\"),lit(\"!=\"),lit(\"\\>=\"),lit(\"://\"),lit(\"non-assoc\"),lit(\"&=\"),lit(\"\\<-\"),lit(\"*=\"),lit(\"+=\"),lit(\"top-down-break\"),lit(\",\"),lit(\"...\"),lit(\"/=\"),lit(\"\"),lit(\"(\"),lit(\"*/\"),lit(\"%\"),lit(\"!\\<\\<\"),lit(\"=\\>\"),lit(\"!\\>\\>\"),lit(\"||\"),lit(\"\\>\\>\"),lit(\"::\"),lit(\"\"),lit(\"&&\"),lit(\"@\"),lit(\":=\"),lit(\"#\"),lit(\"\\<==\\>\"),lit(\"\\\"\"),lit(\"\\<\\<=\"),lit(\"}\"),lit(\"?=\"),lit(\"\\<:\"),lit(\"==\\>\"),lit(\"^\"),lit(\"/*\"),lit(\";\"),lit(\"{\"),lit(\"-=\"),lit(\"$T\")})],{})",
Expand Down Expand Up @@ -81,19 +108,19 @@
"patterns": [
{
"match": "((?:\\\\)(?:\\x{20}|\\\"|\\'|\\-|\\<|\\>|[\\[-\\]]|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\"))})",
"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\"(\"string\"))})",
"captures": {
"1": {
"name": "constant"
"name": "string"
}
}
},
{
"match": "((?:(?:\\\\)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]))|(?:(?:\\\\)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]))|(?:(?:\\\\)a[0-7](?:[0-9]|[A-F]|[a-f])))",
"name": "prod(lex(\"Char\"),[lex(\"UnicodeEscape\")],{tag(\"category\"(\"constant\"))})",
"name": "prod(lex(\"Char\"),[lex(\"UnicodeEscape\")],{tag(\"category\"(\"string\"))})",
"captures": {
"1": {
"name": "constant"
"name": "string"
}
}
}
Expand All @@ -106,6 +133,15 @@
{
"include": "#prod(lex(\"delimiters\"),[alt({lit(\"bottom-up-break\"),lit(\")\"),lit(\"\"),lit(\"\\n\"),lit(\"!:=\"),lit(\"\\'\"),lit(\"!=\"),lit(\"\\>=\"),lit(\"://\"),lit(\"non-assoc\"),lit(\"&=\"),lit(\"\\<-\"),lit(\"*=\"),lit(\"+=\"),lit(\"top-down-break\"),lit(\",\"),lit(\"...\"),lit(\"/=\"),lit(\"\"),lit(\"(\"),lit(\"*/\"),lit(\"%\"),lit(\"!\\<\\<\"),lit(\"=\\>\"),lit(\"!\\>\\>\"),lit(\"||\"),lit(\"\\>\\>\"),lit(\"::\"),lit(\"\"),lit(\"&&\"),lit(\"@\"),lit(\":=\"),lit(\"#\"),lit(\"\\<==\\>\"),lit(\"\\\"\"),lit(\"\\<\\<=\"),lit(\"}\"),lit(\"?=\"),lit(\"\\<:\"),lit(\"==\\>\"),lit(\"^\"),lit(\"/*\"),lit(\";\"),lit(\"{\"),lit(\"-=\"),lit(\"$T\")})],{})"
},
{
"include": "#prod(label(\"integer\",sort(\"Literal\")),[label(\"integerLiteral\",sort(\"IntegerLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})"
},
{
"include": "#prod(label(\"real\",sort(\"Literal\")),[label(\"realLiteral\",lex(\"RealLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})"
},
{
"include": "#prod(label(\"rational\",sort(\"Literal\")),[label(\"rationalLiteral\",lex(\"RationalLiteral\"))],{tag(\"category\"(\"constant.numeric\"))})"
},
{
"include": "#lit(\"`\"):lit(\"`\")"
},
Expand Down

0 comments on commit 0546433

Please sign in to comment.