Skip to content
New issue

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

Linear list of tokens #19

Closed
LoganDark opened this issue Jan 14, 2018 · 6 comments
Closed

Linear list of tokens #19

LoganDark opened this issue Jan 14, 2018 · 6 comments

Comments

@LoganDark
Copy link

LoganDark commented Jan 14, 2018

Currently, LexLua returns a large list full of tokens, each token potentially containing more lists of tokens, for example LeadingWhite full of more tokens that have to be plucked out manually and all sorts of weird things like that. Additionally, the order of LeadingWhite cannot be relied on by index (not even reversed), as I figured out earlier (see issue #18). Also, comments are preserved incorrectly in LeadingWhite (#20).

I'm looking to get a list containing tokens in the order they are encountered. That means by looping through the list and adding up the Data of each token, I'll be able to reconstruct the original input string passed to LexLua exactly.

Is there a ready-made function to create that list for me? If not, how would I create such a function?

@LoganDark
Copy link
Author

I ended up rewriting the lexer from scratch myself. I could share the code if anyone's interested.

@tst2005
Copy link
Contributor

tst2005 commented Feb 14, 2018

@LoganDark : I'm always interested by Lexer/Parser :D

@LoganDark
Copy link
Author

@tst2005
Copy link
Contributor

tst2005 commented Feb 15, 2018

Can you publish it in a repository ? with LICENSE etc ?

@LoganDark
Copy link
Author

@tst2005
Copy link
Contributor

tst2005 commented Feb 16, 2018

thanks!

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

No branches or pull requests

2 participants