Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow trailing whitespace for complex messages #812

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/message.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ simple-start = simple-start-char / escaped-char / placeholder
pattern = *(text-char / escaped-char / placeholder)
placeholder = expression / markup

complex-message = *(declaration [s]) complex-body
complex-message = *(declaration [s]) complex-body [s]
declaration = input-declaration / local-declaration / reserved-statement
complex-body = quoted-pattern / matcher

Expand Down
3 changes: 2 additions & 1 deletion spec/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ and consists of:

1. an optional list of _declarations_, followed by
2. a _complex body_
3. optional trailing whitespace
eemeli marked this conversation as resolved.
Show resolved Hide resolved

```abnf
complex-message = *(declaration [s]) complex-body
complex-message = *(declaration [s]) complex-body [s]
```

### Declarations
Expand Down
5 changes: 5 additions & 0 deletions test/tests/syntax.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@
"type": "unsupported-statement"
}
]
},
{
"src": "{{trailing whitespace}} \n",
"expCleanSrc": "trailing whitespace",
"exp": "trailing whitespace"
}
]
}