Skip to content

Commit

Permalink
Fix parsing for type literals (#4996)
Browse files Browse the repository at this point in the history
The currently parsing rules for type literals allow a type literal to
be specified inside of a type literal (e.g., <(int64, <string>)>). This
pr fixes this undesired behavior.
  • Loading branch information
mattnibs authored Jan 18, 2024
1 parent 144cc28 commit b58a6d7
Show file tree
Hide file tree
Showing 5 changed files with 869 additions and 879 deletions.
1 change: 1 addition & 0 deletions compiler/parser/invalid.zed
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ count() by _path; count() by addr
sort -r -r,-r,-r
sort -r a a, b, c
every 1h count() by _path with -limit 10
yield cast(1, <(<int64>,string)>)
7 changes: 2 additions & 5 deletions compiler/parser/parser.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -11563,12 +11563,9 @@ function peg$parse(input, options) {
function peg$parseType() {
var s0;

s0 = peg$parseTypeLiteral();
s0 = peg$parseAmbiguousType();
if (s0 === peg$FAILED) {
s0 = peg$parseAmbiguousType();
if (s0 === peg$FAILED) {
s0 = peg$parseComplexType();
}
s0 = peg$parseComplexType();
}

return s0;
Expand Down
Loading

0 comments on commit b58a6d7

Please sign in to comment.