-
Notifications
You must be signed in to change notification settings - Fork 8
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
Unclear error when defining / using an identifier with spaces #30
Comments
@fdb This is more difficult than it seems to be. |
Alternatively, instead of doing this during the compilation pass, it could also be done in a validation pass, that quickly goes over the document and checks for lines that start with a character and end with a |
Ohkay.. So we can write the check here..? |
The checks already happen at the compilation stage. I think the issue is that the error messages produced by DefParser (and also those by PhraseParser) should be more evolved than they are now. |
@stebanos Exactly, when I was trying to understand the code in class |
I think all this needs after where in the source: we check whether This will probably suffice because logically a key token cannot be followed by another key token. |
I think |
Yes, and also to this (second case). |
Okay, but the error is cause inside the |
Well no, the code does the right thing.
|
Well as I said before:
if KEY is followed by KEY I don't think it could mean anything else than that there was whitespace in between. |
Ohhh 😲 |
It works correctly for both cases. The issue is what to communicate to the user. |
The position is available, if you want that to be mentioned. |
Yes, I think the position is always handy, but probably not enough. |
😅 |
Having the line numbers available at the parsing/runtime stage would definitely be great! It would indeed involve some rewriting. Also, in theory it's possible that a tag might end on a different line than where it began, in that case it becomes even more complex. |
Right. Perhaps there needs to be a function that keeps track of the line numbers and is called upon every time when we need the updated line numbers? |
This deserves its own issue: #40 |
Was thinking the same! Error handling needs quite a bit of attention. |
I guess this can be closed now? |
Phrase identifiers can't have spaces in them. If users accidentally do add them, the error is unclear:
This is the error when defining a block with an invalid identifier:
This is the error when using an invalid identifier:
The text was updated successfully, but these errors were encountered: