Cross reference in separate files with rule name same as type name raises error
See original GitHub issueThe error Use the rule type 'X' instead of the typed rule name 'X' for cross references.
is raised when
- The name of the referenced type and the name of its parse rule are the same,
- The parse rule of the referenced type and the cross reference are placed in different files.
Using different name or placing them in one file can remove this error.
A minimal example:
// file debug.langium
grammar Debug
import './foo'
entry Model:
(b+=B | a+=A)*;
// A infers A:
// 'A' a=ID;
B infers B:
'B' b=[A:ID];
// file foo.langium
A infers A:
'A' a=ID;
terminal ID: /[_a-zA-Z][\w_]*/;
Renaming the rule A
or moving it into debug.langium both resolve the error.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Cross-reference links do not update to correct heading number
Describes the problem where cross-reference links in Word do not update to the correct heading number after you insert a new heading.
Read more >46 Working with Cross References
A cross reference name is used to uniquely identify a cross reference table. Two cross reference tables cannot have same name in the...
Read more >Referencing long names with Python Sphinx - Stack Overflow
I'm working on documentation for my Python module (using Sphinx and reST), and I'm finding that when cross-referencing other Python objects ( ...
Read more >GNU make
GNU make. This file documents the GNU make utility, which determines automatically which pieces of a large program need to be recompiled, ...
Read more >Python Scope & the LEGB Rule: Resolving Names in Your Code
Otherwise, you'll get an error. Note: Notice that the local and enclosing Python scopes are searched only if you use a name inside...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
See #768
Closed due to https://github.com/langium/langium/pull/768