Skip to content

List separators (, or ;) should be optional, but throw off syntax highlighting when not present #1

Open

Description

@bcronin

Screenshot of the syntax highlighting error:

image

Activity

  1. davidcelis commented on May 14, 2015

    @davidcelis
    Owner

    Hey, sorry it's taken me so long to comment on this. The problem here is that you haven't put in the required trailing semicolons, so the syntax is invalid. Here's what it looks like with the required semicolons added:

  2. bcronin commented on May 14, 2015

    @bcronin
    Author

    Preface: this issue is obviously very minor! I really don't mind it staying closed.

    Semicolons are optional according to the closest-thing-to-official Thrift IDL docs. Snippet from the spec doc (namely the ? after the ListSeparator is the point of interest):

    [12] Struct          ::=  'struct' Identifier 'xsd_all'? '{' Field* '}'
    ...
    [16] Field           ::=  FieldID? FieldReq? FieldType Identifier ('= ConstValue)? XsdFieldOptions ListSeparator?
    ...
    [40] ListSeparator   ::=  ',' | ';'
    
    

    Also, the thrift compiler compiles such structs without warning or error (at least on v0.9.2 which is the version I'm working with -- which is not the latest release AFAIK).

    On the other side of the argument, it's fair to point out the To Do/Questions section of the IDL docs which contains the note: "What to do about ListSeparator? Do we really want to be as lax as we currently are?"

    Anyway, just wanted to point out that it seems (via the not-so-strict-spec and the compiler behavior) that semicolons are optional.

  3. davidcelis commented on May 14, 2015

    @davidcelis
    Owner

    Ack I just realized that what I really meant were commas; shouldn't field definitions be comma-separated? The Thrift IDL docs you linked to have an example file used by their own tests, which involves commas between field and function definitions...

  4. bcronin commented on May 14, 2015

    @bcronin
    Author

    Well, the IDL implies any ListSeparator is optional (if I'm interpreting the ? symbol after it correctly) -- and I do know the thrift compiler v0.9.2 accepts fields without commas or semicolons (since that's still what's in our codebase).

    I certainly don't feel strongly about the issue! If I'm the first and last person to have noticed the issue, it's probably not worth your time to fix :)

  5. davidcelis commented on May 14, 2015

    @davidcelis
    Owner

    It does look like ListSeparator is optional. So here's the deal; I'd fix this, but I'm not terribly familiar with the grammar and how to make that work in the cson file. This is foremost a simple port of the Thrift tmbundle and I haven't done much editing with it. I also haven't had to write any Thrift since I left New Relic, so I'm unfortunately not in a rush to fix that.

    I would be happy to accept a PR to fix the issue of optional ListSeparators, and willing to give a commit bit to anybody who wants to do so and is more familiar with the Thrift grammar!

  6. changed the title [-]An equal sign in a end of line comment throws off the syntax highlighting[/-] [+]List separators (, or ;) should be optional, but throw off syntax highlighting when not present[/+] on May 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions