Skip to content

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Oct 3, 2012

PLEASE DON'T MERGE THIS PULL REQUEST YET!

I'm almost sure it's broken. I just couldn't test it, because currently many tests aren't working, so I don't know which errors are mine and which aren't. Please ensure that the test cases in master branch work again and I'll merge this here after correcting my mistakes.

So this pull request is just to show such a Parser is possible.

The parser although has a drawback - it's admittedly shorter, but also more complicated than the parser just constructing FtanValues directly. So it would be harder to maintain.
One of the reasons is that we can't allow backtracking. When for example checking the first key/value pair of an element, our standard parser just parses the name, THEN checks if there is an equals sign and a value (=> attribute) or there is anoter name (=>the first was the tag name). This is done by backtracking, something like:

def firstpair = ((name ~ "=" ~ value) | name)

A Parser calling Acceptor functions can't take them back, so I needed a more complicated approach.

@errt
Copy link

errt commented Mar 21, 2013

Now that the test work again, seems to be working well mostly, but isn't working for elements. As far as I can tell, it's not passing content to the acceptor (correctly) and fails to pass attributes, if an element is unnamed.

@errt
Copy link

errt commented Mar 22, 2013

Fixed some of the problems in my own version of the branch. For some reason I can't explain, it won't recognize arguments with quoted names, if they are not in the first position, though. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants