Skip to content

Commit

Permalink
Fix transitive imports in generator
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew authored and spoenemann committed Jul 7, 2023
1 parent 69c339c commit 079eccf
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 128 deletions.
234 changes: 117 additions & 117 deletions examples/requirements/src/language-server/generated/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@2"
"$ref": "#/rules@5"
},
"arguments": []
},
Expand Down Expand Up @@ -377,7 +377,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@4"
"$ref": "#/rules@7"
},
"arguments": []
}
Expand All @@ -400,7 +400,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@6"
"$ref": "#/rules@9"
},
"arguments": []
}
Expand All @@ -419,12 +419,12 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "CrossReference",
"type": {
"$ref": "#/rules@11"
"$ref": "#/rules@4"
},
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@4"
"$ref": "#/rules@7"
},
"arguments": []
},
Expand All @@ -445,12 +445,12 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "CrossReference",
"type": {
"$ref": "#/rules@11"
"$ref": "#/rules@4"
},
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@4"
"$ref": "#/rules@7"
},
"arguments": []
},
Expand Down Expand Up @@ -478,7 +478,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "CrossReference",
"type": {
"$ref": "#/rules@10"
"$ref": "#/rules@3"
},
"deprecatedSyntax": false
}
Expand All @@ -497,7 +497,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "CrossReference",
"type": {
"$ref": "#/rules@10"
"$ref": "#/rules@3"
},
"deprecatedSyntax": false
}
Expand All @@ -517,105 +517,6 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"parameters": [],
"wildcard": false
},
{
"$type": "ParserRule",
"name": "Contact",
"definition": {
"$type": "Group",
"elements": [
{
"$type": "Keyword",
"value": "contact"
},
{
"$type": "Keyword",
"value": ":"
},
{
"$type": "Assignment",
"feature": "user_name",
"operator": "=",
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@6"
},
"arguments": []
}
}
]
},
"definesHiddenTokens": false,
"entry": false,
"fragment": false,
"hiddenTokens": [],
"parameters": [],
"wildcard": false
},
{
"$type": "TerminalRule",
"hidden": true,
"name": "WS",
"definition": {
"$type": "RegexToken",
"regex": "/\\\\s+/"
},
"fragment": false
},
{
"$type": "TerminalRule",
"name": "ID",
"definition": {
"$type": "RegexToken",
"regex": "/[_a-zA-Z][\\\\w_]*/"
},
"fragment": false,
"hidden": false
},
{
"$type": "TerminalRule",
"name": "INT",
"type": {
"$type": "ReturnType",
"name": "number"
},
"definition": {
"$type": "RegexToken",
"regex": "/[0-9]+/"
},
"fragment": false,
"hidden": false
},
{
"$type": "TerminalRule",
"name": "STRING",
"definition": {
"$type": "RegexToken",
"regex": "/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"|'(\\\\\\\\.|[^'\\\\\\\\])*'/"
},
"fragment": false,
"hidden": false
},
{
"$type": "TerminalRule",
"hidden": true,
"name": "ML_COMMENT",
"definition": {
"$type": "RegexToken",
"regex": "/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"
},
"fragment": false
},
{
"$type": "TerminalRule",
"hidden": true,
"name": "SL_COMMENT",
"definition": {
"$type": "RegexToken",
"regex": "/\\\\/\\\\/[^\\\\n\\\\r]*/"
},
"fragment": false
},
{
"$type": "ParserRule",
"name": "RequirementModel",
Expand All @@ -630,7 +531,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@2"
"$ref": "#/rules@5"
},
"arguments": []
},
Expand All @@ -643,7 +544,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@10"
"$ref": "#/rules@3"
},
"arguments": []
},
Expand All @@ -656,7 +557,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@11"
"$ref": "#/rules@4"
},
"arguments": []
},
Expand Down Expand Up @@ -687,7 +588,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@4"
"$ref": "#/rules@7"
},
"arguments": []
}
Expand All @@ -703,7 +604,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@6"
"$ref": "#/rules@9"
},
"arguments": []
}
Expand Down Expand Up @@ -734,7 +635,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@4"
"$ref": "#/rules@7"
},
"arguments": []
}
Expand All @@ -746,7 +647,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@6"
"$ref": "#/rules@9"
},
"arguments": []
}
Expand All @@ -769,7 +670,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "CrossReference",
"type": {
"$ref": "#/rules@10"
"$ref": "#/rules@3"
},
"deprecatedSyntax": false
}
Expand All @@ -788,7 +689,7 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"terminal": {
"$type": "CrossReference",
"type": {
"$ref": "#/rules@10"
"$ref": "#/rules@3"
},
"deprecatedSyntax": false
}
Expand All @@ -807,6 +708,105 @@ export const TestsGrammar = (): Grammar => loadedTestsGrammar ?? (loadedTestsGra
"hiddenTokens": [],
"parameters": [],
"wildcard": false
},
{
"$type": "ParserRule",
"name": "Contact",
"definition": {
"$type": "Group",
"elements": [
{
"$type": "Keyword",
"value": "contact"
},
{
"$type": "Keyword",
"value": ":"
},
{
"$type": "Assignment",
"feature": "user_name",
"operator": "=",
"terminal": {
"$type": "RuleCall",
"rule": {
"$ref": "#/rules@9"
},
"arguments": []
}
}
]
},
"definesHiddenTokens": false,
"entry": false,
"fragment": false,
"hiddenTokens": [],
"parameters": [],
"wildcard": false
},
{
"$type": "TerminalRule",
"hidden": true,
"name": "WS",
"definition": {
"$type": "RegexToken",
"regex": "/\\\\s+/"
},
"fragment": false
},
{
"$type": "TerminalRule",
"name": "ID",
"definition": {
"$type": "RegexToken",
"regex": "/[_a-zA-Z][\\\\w_]*/"
},
"fragment": false,
"hidden": false
},
{
"$type": "TerminalRule",
"name": "INT",
"type": {
"$type": "ReturnType",
"name": "number"
},
"definition": {
"$type": "RegexToken",
"regex": "/[0-9]+/"
},
"fragment": false,
"hidden": false
},
{
"$type": "TerminalRule",
"name": "STRING",
"definition": {
"$type": "RegexToken",
"regex": "/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"|'(\\\\\\\\.|[^'\\\\\\\\])*'/"
},
"fragment": false,
"hidden": false
},
{
"$type": "TerminalRule",
"hidden": true,
"name": "ML_COMMENT",
"definition": {
"$type": "RegexToken",
"regex": "/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"
},
"fragment": false
},
{
"$type": "TerminalRule",
"hidden": true,
"name": "SL_COMMENT",
"definition": {
"$type": "RegexToken",
"regex": "/\\\\/\\\\/[^\\\\n\\\\r]*/"
},
"fragment": false
}
],
"definesHiddenTokens": false,
Expand Down
1 change: 0 additions & 1 deletion examples/requirements/src/language-server/tests.langium
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
grammar Tests
import "./common"
import "./requirements"

entry TestModel:
Expand Down
Loading

0 comments on commit 079eccf

Please sign in to comment.