Skip to content

parser: enforce statement end after commands#59

Open
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:fix-bug#36-Parser-unenforced-statement-end-after-commands
Open

parser: enforce statement end after commands#59
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:fix-bug#36-Parser-unenforced-statement-end-after-commands

Conversation

@Franklin-Qi

Copy link
Copy Markdown
Contributor

Reject bare { after commands instead of treating it as nested brace depth.

Fixes #36

@Alonely0

This comment was marked as resolved.

@Alonely0 Alonely0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice these changes make it so now the proper grammar fails: { print 1; { print 2 } }. Please, also add a test case for it so we don't regress in the future.

Comment thread parser/src/lib.rs Outdated
Reject bare `{` after commands instead of treating it as nested brace depth.

Fixes uutils#36
@Franklin-Qi Franklin-Qi force-pushed the fix-bug#36-Parser-unenforced-statement-end-after-commands branch from 76bf401 to 55c7352 Compare July 3, 2026 02:23
@Franklin-Qi

Copy link
Copy Markdown
Contributor Author

请注意,这些更改导致正确的语法现在会出错:{ print 1; { print 2 } }。请同时添加一个测试用例,以免将来出现倒退。

Additional tests have been added: { print 1; { print 2 } }

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.

Parser: unenforced statement end after commands.

2 participants