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

re-enable parsing older definitions (or in *assoc) #3688

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
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
9 changes: 8 additions & 1 deletion kore/src/Kore/Parser/Parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ AliasHead :: {Alias}

SymbolHead :: {Symbol}
: Id SortVariables { Symbol $1 $2 }

SortVariables :: {[SortVariable]}
: '{' SortVariableList '}' { reverse $2 }
| '{' '}' { [] }
Expand Down Expand Up @@ -229,6 +229,11 @@ ApplicationPattern :: {ParsedPattern}
{ mkAssoc True $5 $6 $7 }
| rightAssoc '{' '}' '(' ident SortsBrace NePatterns ')'
{ mkAssoc False $5 $6 $7 }
-- special cases for multi-or in definitions prior to Oct 2023
| rightAssoc '{' '}' '(' or SortsBrace NePatterns ')'
{ mkAssoc False $5 $6 $7 }
| leftAssoc '{' '}' '(' or SortsBrace NePatterns ')'
{ mkAssoc True $5 $6 $7 }
| top '{' Sort '}' '(' ')'
{ embedParsedPattern $ TopF Top{topSort = $3} }
| bottom '{' Sort '}' '(' ')'
Expand Down Expand Up @@ -426,6 +431,8 @@ the result. Namely, \\and, \\or, \\implies, and \\iff. Designed to be passed to
foldl1' or foldr1.
-}
mkApply :: Token -> [Sort] -> ParsedPattern -> ParsedPattern -> ParsedPattern
mkApply tok@(Token _ TokenOr) [orSort] orFirst orSecond =
embedParsedPattern $ OrF Or{orSort, orChildren=[orFirst, orSecond]}
mkApply tok@(Token _ (TokenIdent _)) sorts first second =
embedParsedPattern $ ApplicationF Application
{ applicationSymbolOrAlias = SymbolOrAlias { symbolOrAliasConstructor = mkId tok
Expand Down