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 as Whitespace vs Stop Characters #314

Open
rmarrowstone opened this issue May 2, 2024 · 0 comments
Open

Comments as Whitespace vs Stop Characters #314

rmarrowstone opened this issue May 2, 2024 · 0 comments

Comments

@rmarrowstone
Copy link
Contributor

There is some ambiguity between the spoken-language spec and the Text Grammar about whether comment starts delimit the end of "numeric_entities" and "sexp_keyword_entities."

Consider the below:

2004T/* comment after Timestamp with no whitespace*/

Per the grammar, that should be legal as comments are included in ws.

top_level_value
    : annotation+ top_level_value
...
    | numeric_entity ws // timestamp is a "numeric_entity"
... 

ws
    : WHITESPACE
    | INLINE_COMMENT
    | BLOCK_COMMENT
    ;

But per the spoken-language spec, '/' is not a "stop-character."

In the text notation, timestamp values must be followed by one of the fifteen numeric stop-characters: {}[](),\"\'\ \t\n\r\v\f

This same ambiguity exists for integers, real numbers and keywords.

The ion CLI considers following any of the above a parse error. I have not canvassed other implementations.

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

No branches or pull requests

1 participant