Expression grammar improvements
This PR bundles a few expression grammar improvements. To review it might help to look at each commit individually. If preferred, I can also split these of into separate PRs.
The examples below are mainly taken from https://github.com/home-assistant/core/blob/dev/.github/workflows/ci.yaml
Fix syntax highlighting for if blocks
| Before | After |
|---|---|
Before the || would be interpreted as the start of an unquoted block and break the syntax highlighting until the next job starts.
Fixes #224
Disable syntax highlighting for if keys in comments
| Before | After |
|---|---|
Multiline if blocks didn't change since they weren't even recognized in the first place previously
Fixes: #259 Fixes partially: #158 (not addressed here inline-expressions inside comments: https://github.com/github/vscode-github-actions/issues/158#issuecomment-1570255022)
Fix syntax highlighting for inline expressions spanning multiple lines
| Before | After |
|---|---|
This is quite a common pattern, especially for cache key and restore-keys.
One caveat of this change is how it affects invalid expressions. E.g. missing the closing }}. IMO it isn't as bad since it clearly highlights the invalid syntax. There is also the opportunity to improve on it later.
| Before | After |
|---|---|
Fix nested curly brackets
| Before | After |
|---|---|
Side effect I discovered while testing. Seems these cases are also fixed now.
Fixes #394 Fixes #223