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

Comments lead to an evaluation error #1

Closed
bmo-at opened this issue Nov 7, 2020 · 2 comments
Closed

Comments lead to an evaluation error #1

bmo-at opened this issue Nov 7, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@bmo-at
Copy link
Owner

bmo-at commented Nov 7, 2020

This should be easily remedied with the interpreterOptions, I think.

@bmo-at bmo-at added the bug Something isn't working label Nov 7, 2020
@PH111P
Copy link

PH111P commented Nov 7, 2020

While I cannot directly tell you why comments lead to an evaluation error for you, I can at least offer some general comments. (In any case, nice work!)

In your interpreter settings, you could try to set allowCommentToken to false: While this shouldn't actually change anything relevant, I don't really see why you would need the CommentTokens, either (they're useful for syntax highlighting, if you want to use SOSML for that as well, though. SOSML-frontend does something like that, feel free to check out https://github.com/SOSML/SOSML-frontend/blob/master/frontend/src/sml.js, in case you're interested). (On a similar note, you should probably set strictMode to true and allowSuccessorML to false, or at least make them configurable; these flags enable features that do not fully conform to the SML standard.)

Further, it would be better to pass the interpreter settings also to getFirstState, otherwise that function uses the default settings.

@bmo-at
Copy link
Owner Author

bmo-at commented Nov 8, 2020

Thank you!

I started off based on the code in the SOSML cli and experimented from there. I followed your suggestions, and the comments are now no longer causing evaluation errors. Unfortunately, the extension I depend on for syntax highlighting and formatting does crash vscode when it encounters a comment during formatting, but that's not a high enough concern for me currently.

So anyway, as of release of 1.1.0 this should be fixed :)

@bmo-at bmo-at closed this as completed Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants