@reqlan/language 1.8.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +17 -0
  2. package/out/generated/ast.d.ts +7 -7
  3. package/out/generated/ast.js +4 -4
  4. package/out/generated/grammar.js +2 -2
  5. package/out/generated/grammar.js.map +1 -1
  6. package/out/generated/module.d.ts +1 -1
  7. package/out/generated/module.js +3 -3
  8. package/out/reqlan-async-parser.js +1 -3
  9. package/out/reqlan-async-parser.js.map +1 -1
  10. package/out/reqlan-comment-resolver.d.ts +3 -0
  11. package/out/reqlan-comment-resolver.js.map +1 -1
  12. package/out/reqlan-file-link-resolver.js +27 -10
  13. package/out/reqlan-file-link-resolver.js.map +1 -1
  14. package/out/reqlan-imports.d.ts +1 -0
  15. package/out/reqlan-imports.js.map +1 -1
  16. package/out/reqlan-module.js +2 -2
  17. package/out/reqlan-path-resolve.d.ts +11 -0
  18. package/out/reqlan-path-resolve.js +29 -6
  19. package/out/reqlan-path-resolve.js.map +1 -1
  20. package/out/reqlan-reference-search-site.d.ts +5 -0
  21. package/out/reqlan-reference-search-site.js +8 -0
  22. package/out/reqlan-reference-search-site.js.map +1 -1
  23. package/out/reqlan-token-builder.js +5 -1
  24. package/out/reqlan-token-builder.js.map +1 -1
  25. package/package.json +1 -1
  26. package/src/generated/ast.ts +9 -9
  27. package/src/generated/grammar.ts +2 -2
  28. package/src/generated/module.ts +3 -3
  29. package/src/reqlan-async-parser.ts +4 -5
  30. package/src/reqlan-comment-resolver.ts +3 -0
  31. package/src/reqlan-comment.langium +2 -0
  32. package/src/reqlan-file-link-resolver.ts +29 -10
  33. package/src/reqlan-imports.ts +1 -0
  34. package/src/reqlan-module.ts +2 -2
  35. package/src/reqlan-path-resolve.ts +34 -7
  36. package/src/reqlan-reference-search-site.ts +13 -0
  37. package/src/reqlan-token-builder.ts +5 -1
  38. package/src/reqlan-validator.ts +2 -2
  39. package/src/reqlan.langium +6 -0
@@ -7,7 +7,7 @@ import type { Grammar } from 'langium';
7
7
  import { loadGrammarFromJson } from 'langium';
8
8
 
9
9
  let loadedReqlanGrammar: Grammar | undefined;
10
- export const ReqlanGrammar = (): Grammar => loadedReqlanGrammar ?? (loadedReqlanGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Reqlan","rules":[{"$type":"ParserRule","entry":true,"name":"Model","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"TopLevelElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerIdea","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerBody","definition":{"$type":"Assignment","feature":"content","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaDeclaration","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Idea","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaSet","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaMemberName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceName","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BodyElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BodyLine","definition":{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RichTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"lparen","operator":"=","terminal":{"$type":"Keyword","value":"("}},{"$type":"Assignment","feature":"rparen","operator":"=","terminal":{"$type":"Keyword","value":")"}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InlineTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CodeSnippet","definition":{"$type":"Assignment","feature":"raw","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PlainText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PlainPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":","},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"!"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Attribute","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"negated","operator":"?=","terminal":{"$type":"Keyword","value":"!"}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AttributeValue","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ScalarValue","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangInlineTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangPlainText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":","},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockValue","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockLine","definition":{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListValue","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamedList","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NestedList","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItem","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerListItem","definition":{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemBody","definition":{"$type":"Assignment","feature":"content","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]}]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"!"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamedBlockListItem","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AnonymousBlock","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"MarkdownLink","definition":{"$type":"Assignment","feature":"raw","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"WikiLink","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alias","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"]]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AliasPart","definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BracketReference","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceTarget","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileReference","definition":{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileSymbolReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"WildcardReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"pathPattern","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaPattern","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedReference","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@47"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Assignment","feature":"qualifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@47"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},{"$type":"Keyword","value":"."},{"$type":"Group","elements":[{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"."}],"cardinality":"?"},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"LocalReference","definition":{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Import","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FromImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}]}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FromImportSpecifier","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamespaceImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidFromImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"head","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}},{"$type":"Assignment","feature":"tokens","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportHeadToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"`"},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"`"},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"MARKDOWN_LINK","definition":{"$type":"RegexToken","regex":"/\\\\[(?!\\\\[)[^\\\\]]+\\\\]\\\\([^)]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"WILDCARD_NAME","definition":{"$type":"RegexToken","regex":"/\\\\*[\\\\w*?-]*|\\\\?[\\\\w*?-]*|[_a-zA-Z][\\\\w-]*[*?][\\\\w*?-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\\\\\r\\\\n])*\\"|\'(\\\\\\\\.|[^\'\\\\\\\\\\\\r\\\\n])*\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","definition":{"$type":"RegexToken","regex":"/\\\\d+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"WORD","definition":{"$type":"RegexToken","regex":"/[A-Za-z_][\\\\w\']*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"OTHER","definition":{"$type":"RegexToken","regex":"/[^\\\\s\\\\w\\\\[\\\\]()`]/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INLINE_CODE","definition":{"$type":"RegexToken","regex":"/`[^`\\\\n]+`/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CODE_FENCE","definition":{"$type":"RegexToken","regex":"/```[^\\\\n]*(?:\\\\r?\\\\n[\\\\s\\\\S]*?)?```/","parenthesized":false},"fragment":false,"hidden":false}],"imports":[],"interfaces":[],"types":[],"$comment":"/**\\n * Implementation of the rules described in reqlan rq/language/syntax.rq.\\n *\\n * Design:\\n * - Imports and top-level declarations are line-oriented; import/from/as are keywords only there.\\n * - One-liner ideas are name + body on a single line; block ideas use braces for rich content.\\n * - ReferenceTarget covers local members, import-qualified, alias-qualified, and file targets.\\n */"}'));
10
+ export const ReqlanGrammar = (): Grammar => loadedReqlanGrammar ?? (loadedReqlanGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Reqlan","rules":[{"$type":"ParserRule","entry":true,"name":"Model","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"TopLevelElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerIdea","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerBody","definition":{"$type":"Assignment","feature":"content","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaDeclaration","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Idea","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaSet","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaMemberName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceName","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BodyElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BodyLine","definition":{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RichTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"lparen","operator":"=","terminal":{"$type":"Keyword","value":"("}},{"$type":"Assignment","feature":"rparen","operator":"=","terminal":{"$type":"Keyword","value":")"}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InlineTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CodeSnippet","definition":{"$type":"Assignment","feature":"raw","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PlainText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PlainPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":","},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"!"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Attribute","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"negated","operator":"?=","terminal":{"$type":"Keyword","value":"!"}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AttributeValue","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ScalarValue","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangInlineTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangPlainText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":","},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockValue","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockLine","definition":{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListValue","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamedList","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NestedList","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItem","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerListItem","definition":{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemBody","definition":{"$type":"Assignment","feature":"content","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]}]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"!"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamedBlockListItem","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AnonymousBlock","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"MarkdownLink","definition":{"$type":"Assignment","feature":"raw","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"WikiLink","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alias","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"]]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AliasPart","definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BracketReference","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceTarget","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileReference","definition":{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileSymbolReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"WildcardReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"pathPattern","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaPattern","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedReference","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@47"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Assignment","feature":"qualifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@47"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},{"$type":"Keyword","value":"."},{"$type":"Group","elements":[{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"."}],"cardinality":"?"},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"LocalReference","definition":{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Import","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FromImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}]}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FromImportSpecifier","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamespaceImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidFromImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"head","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}},{"$type":"Assignment","feature":"tokens","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportHeadToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"`"},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"`"},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"MARKDOWN_LINK","definition":{"$type":"RegexToken","regex":"/\\\\[(?!\\\\[)[^\\\\]]+\\\\]\\\\([^)]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"WILDCARD_NAME","definition":{"$type":"RegexToken","regex":"/\\\\*[\\\\w*?-]*|\\\\?[\\\\w*?-]*|[_a-zA-Z][\\\\w-]*[*?][\\\\w*?-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\\\\\r\\\\n])*\\"|\'(\\\\\\\\.|[^\'\\\\\\\\\\\\r\\\\n])*\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","definition":{"$type":"RegexToken","regex":"/\\\\d+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"WORD","definition":{"$type":"RegexToken","regex":"/[A-Za-z_][\\\\w\']*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"OTHER","definition":{"$type":"RegexToken","regex":"/[^\\\\s\\\\w\\\\[\\\\]()`]/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INLINE_CODE","definition":{"$type":"RegexToken","regex":"/`[^`\\\\n]+`/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CODE_FENCE","definition":{"$type":"RegexToken","regex":"/```[^\\\\n]*(?:\\\\r?\\\\n[\\\\s\\\\S]*?)?```/","parenthesized":false},"fragment":false,"hidden":false}],"imports":[],"interfaces":[],"types":[],"$comment":"/**\\n * Implementation of the rules described in reqlan rq/language/syntax.rq.\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".grammar_rule]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".idea]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".ideaset]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".keyword]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".import_statement]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".reference]\\n *\\n * Design:\\n * - Imports and top-level declarations are line-oriented; import/from/as are keywords only there.\\n * - One-liner ideas are name + body on a single line; block ideas use braces for rich content.\\n * - ReferenceTarget covers local members, import-qualified, alias-qualified, and file targets.\\n */"}'));
11
11
 
12
12
  let loadedReqlanCommentGrammar: Grammar | undefined;
13
- export const ReqlanCommentGrammar = (): Grammar => loadedReqlanCommentGrammar ?? (loadedReqlanCommentGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"ReqlanComment","rules":[{"$type":"ParserRule","entry":true,"name":"CommentModel","definition":{"$type":"Assignment","feature":"references","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CommentReference","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"rq"},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CommentReferenceTarget","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedCommentReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"LocalCommentReference","definition":{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"/","parenthesized":false},"fragment":false,"hidden":false}],"imports":[],"interfaces":[],"types":[],"$comment":"/**\\n * Embedded reqlan references in comments of arbitrary source files.\\n * Syntax: rq:[idea] or rq:[\\"./reqfile.rq\\".idea_name]\\n */"}'));
13
+ export const ReqlanCommentGrammar = (): Grammar => loadedReqlanCommentGrammar ?? (loadedReqlanCommentGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"ReqlanComment","rules":[{"$type":"ParserRule","entry":true,"name":"CommentModel","definition":{"$type":"Assignment","feature":"references","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CommentReference","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"rq"},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CommentReferenceTarget","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedCommentReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"LocalCommentReference","definition":{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"/","parenthesized":false},"fragment":false,"hidden":false}],"imports":[],"interfaces":[],"types":[],"$comment":"/**\\n * Embedded reqlan references in comments of arbitrary source files.\\n * Syntax: rq:[idea] or rq:[\\"./reqfile.rq\\".idea_name]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".referenced_files]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".reference_types]\\n */"}'));
@@ -4,7 +4,7 @@
4
4
  ******************************************************************************/
5
5
 
6
6
  import type { LangiumSharedCoreServices, LangiumCoreServices, LangiumGeneratedCoreServices, LangiumGeneratedSharedCoreServices, LanguageMetaData, Module } from 'langium';
7
- import { ReqlanAstReflection } from './ast.js';
7
+ import { reqlanAstReflection } from './ast.js';
8
8
  import { ReqlanGrammar, ReqlanCommentGrammar } from './grammar.js';
9
9
 
10
10
  export const ReqlanLanguageMetaData = {
@@ -21,8 +21,8 @@ export const ReqlanCommentLanguageMetaData = {
21
21
  mode: 'production'
22
22
  } as const satisfies LanguageMetaData;
23
23
 
24
- export const ReqlanGeneratedSharedModule: Module<LangiumSharedCoreServices, LangiumGeneratedSharedCoreServices> = {
25
- AstReflection: () => new ReqlanAstReflection()
24
+ export const reqlanGeneratedSharedModule: Module<LangiumSharedCoreServices, LangiumGeneratedSharedCoreServices> = {
25
+ AstReflection: () => new reqlanAstReflection()
26
26
  };
27
27
 
28
28
  export const ReqlanGeneratedModule: Module<LangiumCoreServices, LangiumGeneratedCoreServices> = {
@@ -48,8 +48,9 @@ export interface ReqlanParseCallOptions {
48
48
 
49
49
  /**
50
50
  * Directory of this module (or of the CJS bundle that inlined it).
51
- * Avoid static `import.meta.url`: esbuild format cjs + target es2017 empties it
52
- * (see reqlan rq/extension/startup-performance.rq invalid_url_activation_failure).
51
+ * Prefer `__dirname` in the extension host CJS bundle. Under Node ESM, use
52
+ * `import.meta.url` do not eval that expression; Node 24 treats a script eval
53
+ * as `Cannot use 'import.meta' outside a module`.
53
54
  */
54
55
  declare const __dirname: string | undefined;
55
56
 
@@ -57,9 +58,7 @@ function moduleDirectory(): string {
57
58
  if (typeof __dirname === 'string') {
58
59
  return __dirname;
59
60
  }
60
- // Native ESM only — hide from esbuild's empty-import-meta rewrite.
61
- const metaUrl = (0, eval)('import.meta.url') as string;
62
- return dirname(fileURLToPath(metaUrl));
61
+ return dirname(fileURLToPath(import.meta.url));
63
62
  }
64
63
 
65
64
  export function resolveParseWorkerPath(explicit?: string): string {
@@ -1,5 +1,8 @@
1
1
  /**
2
2
  * Locates and parses rq:[target] references embedded in source-file comments.
3
+ * rq:["../../../reqlan rq/ontology.rq".referenced_files]
4
+ * rq:["../../../reqlan rq/ontology.rq".reference_types]
5
+ * rq:["../../../reqlan rq/extension/features-non-rq-code-comment/functional-code-comment-references.rq".references_in_functional_code_comments]
3
6
  */
4
7
  import type { LangiumDocument, LangiumDocuments } from 'langium';
5
8
  import { AstUtils, URI } from 'langium';
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * Embedded reqlan references in comments of arbitrary source files.
3
3
  * Syntax: rq:[idea] or rq:["./reqfile.rq".idea_name]
4
+ * rq:["../../../reqlan rq/ontology.rq".referenced_files]
5
+ * rq:["../../../reqlan rq/ontology.rq".reference_types]
4
6
  */
5
7
  grammar ReqlanComment
6
8
 
@@ -120,7 +120,8 @@ export function resolveImportPathLink(
120
120
  }
121
121
  const document = AstUtils.getDocument(importDecl);
122
122
  const pathNode = GrammarUtils.findNodeForProperty(importDecl.$cstNode, 'path');
123
- if (!pathNode) {
123
+ const sourceRange = cstRange(pathNode);
124
+ if (!sourceRange) {
124
125
  return undefined;
125
126
  }
126
127
  const imported = findImportedDocument(path, document, documents, context);
@@ -129,7 +130,7 @@ export function resolveImportPathLink(
129
130
  return undefined;
130
131
  }
131
132
  return {
132
- sourceRange: pathNode.range,
133
+ sourceRange,
133
134
  targetUri: imported.textDocument.uri,
134
135
  targetRange: target.range
135
136
  };
@@ -140,8 +141,10 @@ export function resolveQualifiedReferencePathLink(
140
141
  documents: LangiumDocuments,
141
142
  context?: PathResolveContext
142
143
  ): ResolvedFileLink | undefined {
143
- const pathNode = reference.path?.$refNode;
144
- if (!pathNode) {
144
+ const pathNode = reference.path?.$refNode
145
+ ?? GrammarUtils.findNodeForProperty(reference.$cstNode, 'path');
146
+ const sourceRange = cstRange(pathNode);
147
+ if (!sourceRange) {
145
148
  return undefined;
146
149
  }
147
150
  const document = AstUtils.getDocument(reference);
@@ -155,7 +158,7 @@ export function resolveQualifiedReferencePathLink(
155
158
  return undefined;
156
159
  }
157
160
  return {
158
- sourceRange: pathNode.range,
161
+ sourceRange,
159
162
  targetUri: imported.textDocument.uri,
160
163
  targetRange: target.range
161
164
  };
@@ -388,7 +391,8 @@ function fileStartRange(): Range {
388
391
  export function resolveLinkedAstReferenceLink(reference: Reference<AstNode> | undefined): ResolvedFileLink | undefined {
389
392
  const target = reference?.ref;
390
393
  const sourceNode = reference?.$refNode;
391
- if (!target || !sourceNode) {
394
+ const sourceRange = cstRange(sourceNode);
395
+ if (!target || !sourceRange) {
392
396
  return undefined;
393
397
  }
394
398
  const targetDocument = AstUtils.getDocument(target);
@@ -397,7 +401,7 @@ export function resolveLinkedAstReferenceLink(reference: Reference<AstNode> | un
397
401
  return undefined;
398
402
  }
399
403
  return {
400
- sourceRange: sourceNode.range,
404
+ sourceRange,
401
405
  targetUri: targetDocument.textDocument.uri,
402
406
  targetRange: nameNode.range,
403
407
  resolution: 'file'
@@ -434,13 +438,13 @@ export function resolveWildcardReferenceLink(
434
438
  ): ResolvedFileLink | undefined {
435
439
  const pathNode = GrammarUtils.findNodeForProperty(reference.$cstNode, 'pathPattern');
436
440
  const ideaNode = GrammarUtils.findNodeForProperty(reference.$cstNode, 'ideaPattern');
437
- const sourceRange = reference.$cstNode?.range
438
- ?? (pathNode && ideaNode
441
+ const sourceRange = cstRange(reference.$cstNode)
442
+ ?? (pathNode && ideaNode && isValidRange(pathNode.range) && isValidRange(ideaNode.range)
439
443
  ? {
440
444
  start: pathNode.range.start,
441
445
  end: ideaNode.range.end
442
446
  }
443
- : pathNode?.range);
447
+ : cstRange(pathNode));
444
448
  if (!sourceRange) {
445
449
  return undefined;
446
450
  }
@@ -465,6 +469,9 @@ export function collectFileLinks(
465
469
  const links: ResolvedFileLink[] = [];
466
470
  const linkedRanges: string[] = [];
467
471
  const pushLink = (link: ResolvedFileLink): void => {
472
+ if (!isValidRange(link.sourceRange)) {
473
+ return;
474
+ }
468
475
  links.push(link);
469
476
  linkedRanges.push(rangeKey(link.sourceRange));
470
477
  };
@@ -511,6 +518,9 @@ export function collectFileLinks(
511
518
  }
512
519
  }
513
520
  for (const reference of findEmbeddedFileReferencesInText(document.textDocument.getText())) {
521
+ if (!isValidRange(reference.range)) {
522
+ continue;
523
+ }
514
524
  const key = rangeKey(reference.range);
515
525
  if (linkedRanges.includes(key) || links.some(link => rangesOverlap(link.sourceRange, reference.range))) {
516
526
  continue;
@@ -523,6 +533,15 @@ export function collectFileLinks(
523
533
  return links;
524
534
  }
525
535
 
536
+ function isValidRange(range: Range | undefined): range is Range {
537
+ return range?.start !== undefined && range.end !== undefined;
538
+ }
539
+
540
+ /** CST nodes from worker hydration / partial parses can lack a usable `range`. */
541
+ function cstRange(node: CstNode | undefined): Range | undefined {
542
+ return isValidRange(node?.range) ? node.range : undefined;
543
+ }
544
+
526
545
  function rangeKey(range: Range): string {
527
546
  return `${range.start.line}:${range.start.character}-${range.end.line}:${range.end.character}`;
528
547
  }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Resolves imported requirement documents from relative and import-root-aliased paths.
3
3
  * Interacts with scope linking and go-to-definition for import paths.
4
+ * rq:["../../../reqlan rq/ontology.rq".import_statement]
4
5
  * rq:["../../../reqlan rq/extension/language-support/features-imports.rq".implicit_file_extension]
5
6
  */
6
7
  import type { FileSystemProvider, LangiumDocument, LangiumDocuments, URI } from 'langium';
@@ -1,6 +1,6 @@
1
1
  import { type Module, inject, type PartialLangiumSharedCoreServices } from 'langium';
2
2
  import { createDefaultModule, createDefaultSharedModule, type DefaultSharedModuleContext, type LangiumServices, type LangiumSharedServices, type PartialLangiumServices } from 'langium/lsp';
3
- import { ReqlanGeneratedModule, ReqlanGeneratedSharedModule } from './generated/module.js';
3
+ import { ReqlanGeneratedModule, reqlanGeneratedSharedModule } from './generated/module.js';
4
4
  import { ReqlanDefinitionProvider } from './reqlan-definition-provider.js';
5
5
  import { ReqlanDocumentHighlightProvider } from './reqlan-document-highlight-provider.js';
6
6
  import { ReqlanDocumentLinkProvider } from './reqlan-document-link-provider.js';
@@ -98,7 +98,7 @@ export function createReqlanServices(context: DefaultSharedModuleContext): {
98
98
  } {
99
99
  const shared = inject(
100
100
  createDefaultSharedModule(context),
101
- ReqlanGeneratedSharedModule,
101
+ reqlanGeneratedSharedModule,
102
102
  ReqlanSharedModule
103
103
  );
104
104
  const Reqlan = inject(
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Resolves document-relative and import-root-aliased paths (default `@/`).
3
+ * rq:["../../../reqlan rq/ontology.rq".configuration]
3
4
  * rq:["../../../reqlan rq/extension/configuration.rq".configuration_location]
4
5
  * rq:["../../../reqlan rq/extension/configuration.rq".configuration_import_roots]
5
6
  * rq:["../../../reqlan rq/language/imports.rq".configuration_import_root_alias]
@@ -13,6 +14,33 @@ export const REQLAN_DIR = '.reqlan';
13
14
  /** Config filename under `<base>/.reqlan/`. */
14
15
  export const CONFIG_FILENAME = 'config.json';
15
16
 
17
+ const WINDOWS_DRIVE_ABS = /^[A-Za-z]:[\\/]/;
18
+ const URI_SCHEME = /^[a-zA-Z][a-zA-Z0-9+.-]*:/;
19
+
20
+ /** Drive-letter or UNC filesystem path (not a URI). */
21
+ export function isWindowsAbsolutePath(value: string): boolean {
22
+ return WINDOWS_DRIVE_ABS.test(value) || value.startsWith('\\\\');
23
+ }
24
+
25
+ /** True for posix/Windows absolute paths and URIs, including `file:`. */
26
+ export function isAbsoluteUriOrPath(value: string): boolean {
27
+ return value.startsWith('/') || isWindowsAbsolutePath(value) || URI_SCHEME.test(value);
28
+ }
29
+
30
+ /**
31
+ * Build a `file:` URI from a filesystem path.
32
+ * Windows drive paths must not go through `URI.parse` (scheme would be `c:`).
33
+ */
34
+ export function fileUriFromFsPath(fsPath: string): URI {
35
+ if (WINDOWS_DRIVE_ABS.test(fsPath)) {
36
+ return UriCtor.parse(`file:///${fsPath.replace(/\\/g, '/')}`);
37
+ }
38
+ if (fsPath.startsWith('\\\\')) {
39
+ return UriCtor.parse(`file:${fsPath.replace(/\\/g, '/')}`);
40
+ }
41
+ return UriCtor.file(fsPath);
42
+ }
43
+
16
44
  export interface ImportRootMapping {
17
45
  alias: string;
18
46
  /** Absolute URI of that alias’s import-root directory, when set. */
@@ -285,15 +313,14 @@ function parseHtmlExportConfig(raw: unknown): RqHtmlExportConfig | undefined {
285
313
  return Object.keys(config).length > 0 ? config : undefined;
286
314
  }
287
315
 
288
- function isAbsoluteUriOrPath(value: string): boolean {
289
- return /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(value) || value.startsWith('/');
290
- }
291
-
292
- function toDirectoryUri(value: string): URI {
293
- if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(value)) {
316
+ export function toDirectoryUri(value: string): URI {
317
+ if (isWindowsAbsolutePath(value)) {
318
+ return fileUriFromFsPath(value);
319
+ }
320
+ if (URI_SCHEME.test(value)) {
294
321
  return UriCtor.parse(value);
295
322
  }
296
- return UriCtor.file(value);
323
+ return fileUriFromFsPath(value);
297
324
  }
298
325
 
299
326
  export function resolveRqConfig(document: LangiumDocument, context?: PathResolveContext): RqConfig {