Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Fixed a parsing error in Dyck expressions #795

Merged
merged 1 commit into from
Nov 21, 2023
Merged

Conversation

stephen-hawley
Copy link
Contributor

Added missing operators to the standard list to stop parse errors where there is inline code that uses these.
This fixes issue 793.

As background, a Dyck expression is any expression which consists of arbitrary token that may be surrounded by balanced sets of a bracketing tokens. Inline functions and default values in Swift may have very complicated expressions, but we don't care at all about these, so we can get away with writing these of as a Dyck expression, of which the Swift language is a subset.

@@ -297,7 +297,7 @@ dyckSubExpression :
| any_other_things_for_dyck_expression;

any_other_things_for_dyck_expression :
( OpDot | OpComma | OpColon | OpSemi | OpAssign | OpAt | OpPound | OpBackTick | OpQuestion | OpUnder)
( OpDot | OpComma | OpColon | OpSemi | OpAssign | OpAt | OpPound | OpBackTick | OpQuestion | OpUnder | OpPlus | OpMinus | OpAmp | OpBang | OpTilde | OpGreater | opGreater)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any other operators that should be in this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great question - I tried to name all the operators in the language with Op prefix. These are all of them. Swift has general operators as well which are it's own weird token syntax which should get picked up by the production rules under dyckExcression with the literal and operator rules.

@stephen-hawley stephen-hawley merged commit 3084620 into main Nov 21, 2023
1 check passed
@stephen-hawley stephen-hawley deleted the inline-func-parsing branch November 21, 2023 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants