Skip to content

Fix SDSL postfix parser silently dropping a dangling '.' or '[' - #3426

Merged
xen2 merged 1 commit into
stride3d:masterfrom
xen2:fix/postfix-dangling-accessor
Sep 12, 2026
Merged

xen2 merged 1 commit into
stride3d:masterfrom
xen2:fix/postfix-dangling-accessor

Conversation

@xen2

@xen2 xen2 commented Sep 12, 2026

Copy link
Copy Markdown
Member

PR Details

The SDSL postfix parser consumed a '.' or '[' and then silently dropped it when nothing valid followed, so statements like a.;, 1..; or a[1; parsed without any error.

This reports a parse error at that point instead (SDSL0021 for a dangling '.', SDSL0015 for '[' without an expression, SDSL0019 for a missing ']'), and adds negative and positive parsing tests for accessor chains.

Follow-up to #3421, which made 1.. reachable through this path.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

PostfixParser consumed the '.' or '[' and then fell out of the loop when no member, call, index or closing bracket followed, so `a.;`, `1..;` or `a[1;` parsed without error. Report SDSL0021/SDSL0015/SDSL0019 at that point instead.
@xen2
xen2 merged commit 7b57174 into stride3d:master Sep 12, 2026
33 checks passed
@xen2
xen2 deleted the fix/postfix-dangling-accessor branch September 12, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant