ion-docs icon indicating copy to clipboard operation
ion-docs copied to clipboard

Make top-level and s-expression Productions More Concise

Open jonwilsdon opened this issue 6 years ago • 0 comments

In particular the current grammar has the following:

top_level_value
    : annotation+ top_level_value
    | delimiting_entity
    // numeric literals (if followed by something), need to be followed by
    // whitespace or a token that is either quoted (e.g. string) or
    // starts with punctuation (e.g. clob, struct, list)
    | numeric_entity ws
    | numeric_entity quoted_annotation value
    | numeric_entity delimiting_entity
    // literals that are unquoted symbols or keywords have a similar requirement
    // as the numerics above, they have different productions because the
    // rules for numerics are the same in s-expressions, but keywords
    // have differnt rules between top-level and s-expressions.
    | keyword_entity ws
    | keyword_entity quoted_annotation value
    | keyword_entity keyword_delimiting_entity
    ;

Do we need a separate rule for keyword-like tokens (also in s-expressions)? If not it would make the grammar far more concise.

Migrated from ION-593.

jonwilsdon avatar Jan 31 '19 00:01 jonwilsdon