Skip to content

Commit

Permalink
Fix parsing of parenthesized expression and inline function. (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign authored Dec 3, 2024
1 parent 0fdf2f8 commit 89203c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion spec/examples/argument
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ component Main {
test()
}
}

-------------------------------------------------------------------------------
component Main {
fun render : String {
(value: String) { value }("")
}
}
3 changes: 2 additions & 1 deletion src/parsers/base_expression.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module Mint
left =
case char
when '('
parenthesized_expression || inline_function
# TODO: Remove `oneof` when `:` deprecation ends.
oneof { parenthesized_expression || inline_function }
when '-', .ascii_number?
state_setter || number_literal || unary_minus
when '!'
Expand Down

0 comments on commit 89203c0

Please sign in to comment.