You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
results in code like this when the action clause for a rule is empty:
case 1:/* rule_list ::= */func codeBlockForRule01()throws->EBNF.RuleList{#sourceLocation(file: "Sources/ebnf-citron/EBNFGrammar.citron", line: 37)#sourceLocation()}
That causes the error report to point into the generated .swift file instead of the grammar file, which is not very useful.
Sources/ebnf-citron/EBNFGrammar.citron:37:1: error: missing return in local function expected to return 'EBNF.RuleList' (aka 'Array<(lhs: Substring, rhs: Array<Optional<Array<EBNF.Term>>>)>')
}
^
If you move the #sourceLocation() to just after the closing brace, the report shows up in the right place. This is an important case because parsers will often be developed by capturing the grammar first and using %default_nonterminal_type Void. When making the transition, it doesn't work out so well.
The text was updated successfully, but these errors were encountered:
citron/Sources/citron/main.c
Line 3822 in a1b26d4
results in code like this when the action clause for a rule is empty:
That causes the error report to point into the generated .swift file instead of the grammar file, which is not very useful.
If you move the
#sourceLocation()
to just after the closing brace, the report shows up in the right place. This is an important case because parsers will often be developed by capturing the grammar first and using%default_nonterminal_type Void
. When making the transition, it doesn't work out so well.The text was updated successfully, but these errors were encountered: