Skip to content

Missing comma between fields results in misleading pipeline-level syntax error #45

@datasc31

Description

@datasc31

Background
When a comma , is missing between fields inside a group definition, the WPL editor reports a generic syntax error at the pipeline level instead of indicating that a field separator is missing.

This causes confusion because the reported error location and message suggest an issue with the pipeline or group syntax, while the real problem is a missing comma between two fields.

Steps to Reproduce

  1. Open the online WPL editor.

  2. Use the following rule snippet (note the missing comma after ip:sip):

    package /fb/web {
    rule nginx {
    (
    json | take(log) | json_unescape() | (
    ip:sip
    2*_,
    time:recv_time<[,]>,
    http/request",
    http/status,
    digit,
    chars",
    http/agent",
    _"
    )
    )
    }
    }

  3. Click the “Parse” button.

Actual Result
The editor reports a syntax error at the pipeline level:

WPL parse failed: [500] syntax error > parse error at line 4, column 36
invalid symbol
expected ,, next field, ( ... ), group '( ... )' content, group, , rule <name> { ... }, { rule ... }
Error Code: WPL_PARSE_ERROR

The error location points to the pipeline expression (json | take(log) | json_unescape() | () instead of the actual field where the comma is missing.

Image

Expected Result
The error message should clearly indicate that:

  • A comma , is missing between fields
  • The error originates from the field list inside the group
  • The reported location should point to the line containing ip:sip

For example:
Missing comma , after field definition ip:sip.
Each field inside a group must be separated by a comma.

Impact
Users may spend time inspecting the pipeline or group syntax instead of checking field separators. This increases debugging time and reduces the clarity of error diagnostics, especially for new users.

Suggested Improvement

  • Improve error recovery inside group field lists to detect missing separators.
  • When encountering two consecutive field expressions without a delimiter, emit a targeted error indicating a missing comma.
  • Report the error location at the field boundary rather than at the pipeline level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions