Skip to content

Commit

Permalink
Update expressions.y ParseError -> SyntaxError
Browse files Browse the repository at this point in the history
  • Loading branch information
osteele committed Jul 20, 2017
1 parent dde3ea7 commit 17c5c9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions expressions/expressions.y
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ expr2:
string: LITERAL {
s, ok := $1.(string)
if !ok {
panic(ParseError(fmt.Sprintf("expected a string for %q", $1)))
panic(SyntaxError(fmt.Sprintf("expected a string for %q", $1)))
}
$$ = s
};
Expand Down Expand Up @@ -108,7 +108,7 @@ loop_modifiers: /* empty */ { $$ = loopModifiers{Cols: math.MaxUint32} }
case "reversed":
$1.Reversed = true
default:
panic(ParseError(fmt.Sprintf("undefined loop modifier %q", $2)))
panic(SyntaxError(fmt.Sprintf("undefined loop modifier %q", $2)))
}
$$ = $1
}
Expand All @@ -117,23 +117,23 @@ loop_modifiers: /* empty */ { $$ = loopModifiers{Cols: math.MaxUint32} }
case "cols":
cols, ok := $3.(int)
if !ok {
panic(ParseError(fmt.Sprintf("loop cols must an integer")))
panic(SyntaxError(fmt.Sprintf("loop cols must an integer")))
}
$1.Cols = cols
case "limit":
limit, ok := $3.(int)
if !ok {
panic(ParseError(fmt.Sprintf("loop limit must an integer")))
panic(SyntaxError(fmt.Sprintf("loop limit must an integer")))
}
$1.Limit = &limit
case "offset":
offset, ok := $3.(int)
if !ok {
panic(ParseError(fmt.Sprintf("loop offset must an integer")))
panic(SyntaxError(fmt.Sprintf("loop offset must an integer")))
}
$1.Offset = offset
default:
panic(ParseError(fmt.Sprintf("undefined loop modifier %q", $2)))
panic(SyntaxError(fmt.Sprintf("undefined loop modifier %q", $2)))
}
$$ = $1
}
Expand Down

0 comments on commit 17c5c9c

Please sign in to comment.