test hexadecimal literal with whitespace [[0x 6]] parse fails
Parse failure expected: Decimal(“6”)

It parses [[0x 6]] to Decimal(“6”) which is actually just [[6]]. It parses fine with the stable version of Spoofax.

Submitted by Daco Harkes on 15 March 2013 at 09:26

On 15 March 2013 at 09:44 Gabriël Konat commented:

The syntax for Decimal: https://github.com/metaborg/metac/blob/basec/BaseC/syntax/BaseC-Constants.tmpl
Several other ‘parse fails’ tests also accept programs that it should not accept.

I’ve seen this behavior in other Spoofax editors in nightly as well. If a small error is made, such as a missing or extra ; in Stratego, it is shown as a comment in the editor and no error is reported. Maybe the error recovery is too aggressive in the new parser? The Stratego compiler does report the error though, maybe that uses a different parser?

On 15 March 2013 at 09:44 Gabriël Konat tagged parser

On 15 March 2013 at 09:44 Gabriël Konat tagged @maartje

On 15 March 2013 at 11:48 Maartje commented:

The error recovery (correctly) decides to parse the erroneous character as layout (WATER production). However, for some reason the recover production is not detected when the parsetree is further processed. This only occurs for WATER productions (skip substring by parsing as layout), not for INSERT productions (reduce token from empty string)

On 15 March 2013 at 15:54 Maartje commented:

Fixed in r26016
Problem seems to be introduced by the changes in: TreeBuilder public Object buildTreeNode(ParseNode node) {…}.
Code is not easy to understand but I added some lines that seems to fix the problem.

On 15 March 2013 at 15:54 Maartje closed this issue.

Log in to post comments