From e037eef491e4432bd1cefd33ad1bd5b3d3c7c90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Wed, 27 Nov 2024 14:02:31 +0100 Subject: [PATCH] Change parsing order of parenthesized expression and inline function. --- spec/examples/argument | 7 ++++++- src/parsers/base_expression.cr | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/examples/argument b/spec/examples/argument index bee51852..aee4d702 100644 --- a/spec/examples/argument +++ b/spec/examples/argument @@ -48,4 +48,9 @@ component Main { test() } } - +------------------------------------------------------------------------------- +component Main { + fun render : String { + (value: String) { value }("") + } +} diff --git a/src/parsers/base_expression.cr b/src/parsers/base_expression.cr index 60f5130c..aea74461 100644 --- a/src/parsers/base_expression.cr +++ b/src/parsers/base_expression.cr @@ -10,7 +10,7 @@ module Mint left = case char when '(' - parenthesized_expression || inline_function + inline_function || parenthesized_expression when '-', .ascii_number? state_setter || number_literal || unary_minus when '!'