We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Affects backends:
[String]
[Char]
For the grammar
[]. [Integer] ::= ""; (:). [Integer] ::= "-" Integer ";" [Integer];
and the input
- 1; - 2; - 3;
the backends C/C++/Java render the parsed syntax tree wrongly as:
1 - 2 - 3 -
Haskell does the right job (reproducing the input), and OCaml almost, with some extra space before the semicolon:
- 1 ; - 2 ; - 3 ;
The imperative backends seem to assume that the only terminal in the (:) rule is the separator.
(:)
bnfc/source/src/BNFC/CF.hs
Lines 735 to 744 in e91a342
getCons
The text was updated successfully, but these errors were encountered:
Also, terminals in the nil and singleton rules are dropped:
Top. S ::= "{" [Integer] [Char]; []. [Integer] ::= "}"; (:). [Integer] ::= "-" Integer ";" [Integer]; (:[]). [Char] ::= "finally" Char ";"; (:). [Char] ::= "*" Char ";" [Char];
with input
{ - 1; - 2; - 3; } * 'A'; * 'B'; finally 'C';
prints
{ 1 - 2 - 3 - 'A' * 'B' * 'C'
Sorry, something went wrong.
[ #358 refactor ] C: towards correct mixfix list printing
705341e
[ #358 ] C: correct mixfix list printing
a0de6d6
Instead of with a while loop, we use recursion to print a list also in C.
[ #358 ] fixed for cpp-nostl by copypasting the C solution
3da1b0e
[ #358 ] fixed for Java
0a077af
[ #358 ] fixed for CPP/STL (adapted from Java)
05dadea
[ #358 clean ] purged getSeparatorByPrecedence
5e564f7
This only worked for infix-lists.
[ #358 ] CHANGELOG
083d170
[ #358 ] regression test
b54dcef
Fixed for imperative backends by making list printers recursive, instead of using for- or while-loops.
for
while
andreasabel
No branches or pull requests
Affects backends:
[String]
and[Char]
, see also Haskell backend prints a list[Char]
containing characters as string #359)For the grammar
and the input
the backends C/C++/Java render the parsed syntax tree wrongly as:
Haskell does the right job (reproducing the input), and OCaml almost, with some extra space before the semicolon:
The imperative backends seem to assume that the only terminal in the
(:)
rule is the separator.bnfc/source/src/BNFC/CF.hs
Lines 735 to 744 in e91a342
(Found this bug by trying to understand
getCons
.)The text was updated successfully, but these errors were encountered: