Skip to content

Extraneous space inserted after trailing comma #63

Description

@bbannier

In many places Zeek allows trailing commas. This seems to be handled inconsistently.

For enums I see expected behavior:

type E: enum { a, b, c, };

For set-like constructs I see an additional space:

const s = { 1, 2, 3,  };
#                    ^

const r: RecordType = [ $a=1, $b=2, $c=3,  ];
#                                         ^

We probably have the same issue for function-like constructors, e.g.,

const a = vector(1, 2, 3, );
#                        ^

The issue seems to be that we insert an space after , in the contexts even though it is not followed by more arguments.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions