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

Lexer error: can't match any token #5

Open
ghost opened this issue Mar 4, 2020 · 3 comments
Open

Lexer error: can't match any token #5

ghost opened this issue Mar 4, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 4, 2020

Whenever I evaluate anything with this library that has a -: in it, it breaks and gives me the error in the title, please help me. For example, if I try to evaluate 1(1)/(5)-:-1(1)/(3) it throws Lexer error: can't match any token.

@arthanzel
Copy link
Owner

A : is not valid syntax. What behaviour would you expect from 1(1)/(5)-:-1(1)/(3)?

@ghost
Copy link
Author

ghost commented Mar 4, 2020

I expect division from -:
It is ascii math

@arthanzel
Copy link
Owner

Touché. Evaluatex only supports the operations described in its manual --- that's not even close to the full feature set of AsciiMath or LaTeX --- because it sufficed for the use case I had for it at the time.

I imagine that the minimum viable change to implement the -: operator would be modifying the lexer to recognize the -: token and emit a / token instead.

Note to self: this is an excellent reason to split the current lexer into AsciiMath and LaTeX lexers, and have them emit a common IR for the parser. Be wary of situations like -:- where the sequence should be interpreted as -: -.

I wish I had the free time to work on Evaluatex, although I would welcome a PR with test cases for the various AsciiMath features. Either way, thanks for bringing up this deficiency.

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

1 participant