Skip to content
This repository has been archived by the owner on Jul 26, 2018. It is now read-only.

thunk->begin and thunk->end don't consistently work #19

Open
fletcher opened this issue Jun 12, 2014 · 1 comment
Open

thunk->begin and thunk->end don't consistently work #19

fletcher opened this issue Jun 12, 2014 · 1 comment

Comments

@fletcher
Copy link

It's entirely possible that I'm being daft, or that my google-fu is failing me, but thunk->begin and thunk->end don't consistently indicate the offsets of the beginning/end of the recipe. In particular, the accuracy of nested recipes seems inaccurate. For example, matching a string that includes some whitespace at the end that I need to keep track of.

What are the rules for which components of a "recipe" are included inside the thunk begin/end offsets?

Thanks!

@nddrylliog
Copy link
Member

While a maintainer of the fork, I'm not peg/leg grammar expert myself. However, you can take a look at how it's done in nagaqueen, rock's grammar. Noteworthy places are:

Usage of "<" and ">" are key as to what gets captured inside 'yyText' / '$$' - maybe it influences thunk->{begin,end} too?

Is your source file UTF-8? Could that influence counting as well?

Also, maybe the whitespace is matched by some outer rule rather than the inner one you expect it to? That would be weird, but when encountering weird errors it's good to keep an open mind.. If @rurban, @tokuhirom, @guliopaci or @onnlucky could pitch in, I'd appreciate it. I'm quite busy with other projects nowadays!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants