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
When parsing a byte stream (bytes) using the grammar.parse()-method, the last letter is missing.
Steps to reproduce:
<start> ::= <entry_bit> <entry_bit> ::= <bit>+ <entry_byte> ::= <byte>+ <byte> ::= <bit>{8} <bit> ::= 0 | 1
Run:
with open("bit_grammar.fan") as f: grammar, constraints = parse(f, use_stdlib=False) grammar.parse(b'test', NonTerminal("<entry_bit>")).to_bytes() # returns b'tes' grammar.parse(b'test', NonTerminal("<entry_byte>")).to_bytes() # returns b'test'
The text was updated successfully, but these errors were encountered:
Also one case where parsing fails for me. When pasing directly into bytes. Some bytes inputs also don't work.
grammar.parse(b'\x04test', NonTerminal("<entry_byte>")).to_bytes() # returns b'\x04test' <-- Works grammar.parse(b'\x04test\x02', NonTerminal("<entry_byte>")).to_bytes() # returns b'\x04test\x02' <-- Works grammar.parse(b'\x04test\x02d', NonTerminal("<entry_byte>")).to_bytes() # returns b'\x04test\x02' <-- Last letter missing grammar.parse(b'\x04test\x02de', NonTerminal("<entry_byte>")).to_bytes() # returns b'\x04test\x02d' <-- Last letter missing
In this case the parser looses one letter when I add a second hexadecimal number to the parsing input.
Sorry, something went wrong.
Just to be sure: Is this in .parse() or in .to_bytes()? (Replace .to_bytes() by .value() and report the result)
.parse()
.to_bytes()
.value()
Added test for #318
77a82dd
This is the result using the two example with .values() instead of .to_bytes()
6dae8c4
andreas-zeller
No branches or pull requests
When parsing a byte stream (bytes) using the grammar.parse()-method, the last letter is missing.
Steps to reproduce:
Run:
The text was updated successfully, but these errors were encountered: