From 430dc9b0bf172b6b6a6c632726b6c3d871afb40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Thu, 8 Jul 2021 10:35:26 +0200 Subject: [PATCH 01/20] Initial commit for implementing code blocks. --- spec/parsers/function_spec.cr | 9 +++--- src/ast/function.cr | 12 ++++++++ src/ast/statement.cr | 1 + src/compilers/function.cr | 4 +++ src/formatters/function.cr | 4 +++ src/parsers/block.cr | 2 +- src/parsers/function.cr | 48 +++++++++++++++++++++++++----- src/parsers/statement.cr | 3 +- src/parsers/tuple_destructuring.cr | 1 + src/type_checkers/function.cr | 4 +++ 10 files changed, 74 insertions(+), 14 deletions(-) diff --git a/spec/parsers/function_spec.cr b/spec/parsers/function_spec.cr index 7b16fdd65..bfb23cc23 100644 --- a/spec/parsers/function_spec.cr +++ b/spec/parsers/function_spec.cr @@ -9,14 +9,15 @@ describe "Function Definition" do expect_error "fun", Mint::Parser::FunctionExpectedName expect_error "fun ", Mint::Parser::FunctionExpectedName - expect_error "fun a", Mint::Parser::FunctionExpectedOpeningBracket - expect_error "fun a ", Mint::Parser::FunctionExpectedOpeningBracket + expect_error "fun a", Mint::SyntaxError + expect_error "fun a ", Mint::SyntaxError expect_error "fun a (", Mint::Parser::FunctionExpectedClosingParentheses expect_error "fun a ( ", Mint::Parser::FunctionExpectedClosingParentheses - expect_error "fun a ()", Mint::Parser::FunctionExpectedOpeningBracket - expect_error "fun a () ", Mint::Parser::FunctionExpectedOpeningBracket + expect_error "fun a ()", Mint::SyntaxError + expect_error "fun a () ", Mint::SyntaxError expect_error "fun a () :", Mint::Parser::FunctionExpectedTypeOrVariable expect_error "fun a () : ", Mint::Parser::FunctionExpectedTypeOrVariable + expect_error "fun a () { x", Mint::SyntaxError expect_ok "fun a { true } " expect_ok "fun a : T { true } " diff --git a/src/ast/function.cr b/src/ast/function.cr index 66e4d0e3c..d27c9dc4a 100644 --- a/src/ast/function.cr +++ b/src/ast/function.cr @@ -1,5 +1,17 @@ module Mint class Ast + class Block < Node + getter statements, expression, tail_comments + + def initialize(@tail_comments : Array(Comment), + @statements : Array(Node), + @expression : Expression, + @input : Data, + @from : Int32, + @to : Int32) + end + end + class Function < Node getter name, where, arguments, body, type getter comment, head_comments, tail_comments diff --git a/src/ast/statement.cr b/src/ast/statement.cr index 98f433535..8549aa6b9 100644 --- a/src/ast/statement.cr +++ b/src/ast/statement.cr @@ -5,6 +5,7 @@ module Mint Try Sequence Parallel + None end getter target, expression, parent diff --git a/src/compilers/function.cr b/src/compilers/function.cr index 0dda72767..c6a1d50d5 100644 --- a/src/compilers/function.cr +++ b/src/compilers/function.cr @@ -8,6 +8,10 @@ module Mint end end + def _compile(node : Ast::Block) : String + compile node.expression + end + def _compile(node : Ast::Function, contents = "") : String name = js.variable_of(node) diff --git a/src/formatters/function.cr b/src/formatters/function.cr index 54e9d84e8..4ba526315 100644 --- a/src/formatters/function.cr +++ b/src/formatters/function.cr @@ -1,5 +1,9 @@ module Mint class Formatter + def format(node : Ast::Block) : String + list node.statements + [node.expression] + node.tail_comments + end + def format(node : Ast::Function) : String name = format node.name diff --git a/src/parsers/block.cr b/src/parsers/block.cr index bfacd02a3..9813f6031 100644 --- a/src/parsers/block.cr +++ b/src/parsers/block.cr @@ -21,8 +21,8 @@ module Mint whitespace result = yield - whitespace + char '}', closing_bracket result end diff --git a/src/parsers/function.cr b/src/parsers/function.cr index c7fd8d3f1..b2fb2f2d3 100644 --- a/src/parsers/function.cr +++ b/src/parsers/function.cr @@ -7,6 +7,35 @@ module Mint syntax_error FunctionExpectedExpression syntax_error FunctionExpectedName + def code_block : Ast::Block? + start do |start_position| + char '{', SyntaxError + whitespace + + statements = + many { comment || statement(:none, require_name: true) } + + whitespace + + expression = + expression! SyntaxError + + whitespace + tail_comments = many { comment } + + whitespace + char '}', SyntaxError + + self << Ast::Block.new( + tail_comments: tail_comments, + statements: statements, + expression: expression, + from: start_position, + to: position, + input: data) + end + end + def function : Ast::Function? start do |start_position| comment = self.comment @@ -41,21 +70,24 @@ module Mint item end - head_comments, body, tail_comments = block_with_comments( - opening_bracket: FunctionExpectedOpeningBracket, - closing_bracket: FunctionExpectedClosingBracket - ) do - expression! FunctionExpectedExpression - end + body = + code_block + + # head_comments, body, tail_comments = block_with_comments( + # opening_bracket: FunctionExpectedOpeningBracket, + # closing_bracket: FunctionExpectedClosingBracket + # ) do + # expression! FunctionExpectedExpression + # end end_position = position whitespace self << Ast::Function.new( + head_comments: [] of Ast::Comment, + tail_comments: [] of Ast::Comment, body: body.as(Ast::Expression), - head_comments: head_comments, - tail_comments: tail_comments, arguments: arguments, from: start_position, comment: comment, diff --git a/src/parsers/statement.cr b/src/parsers/statement.cr index db2ed3f2a..b656b05bd 100644 --- a/src/parsers/statement.cr +++ b/src/parsers/statement.cr @@ -1,6 +1,6 @@ module Mint class Parser - def statement(parent : Ast::Statement::Parent) : Ast::Statement? + def statement(parent : Ast::Statement::Parent, require_name : Bool = false) : Ast::Statement? start do |start_position| target = start do value = variable(track: false) || tuple_destructuring @@ -11,6 +11,7 @@ module Mint value end + next if require_name && !target body = expression next unless body diff --git a/src/parsers/tuple_destructuring.cr b/src/parsers/tuple_destructuring.cr index 3a6629405..f94ae2e86 100644 --- a/src/parsers/tuple_destructuring.cr +++ b/src/parsers/tuple_destructuring.cr @@ -8,6 +8,7 @@ module Mint next unless char! '{' value = tuple_destructuring || variable whitespace + next if char.in?('|', '=') # Don't parse record or record update as tuple destructuring char! ',' whitespace value diff --git a/src/type_checkers/function.cr b/src/type_checkers/function.cr index 9b28351cc..f53ae1e2f 100644 --- a/src/type_checkers/function.cr +++ b/src/type_checkers/function.cr @@ -17,6 +17,10 @@ module Mint Comparer.normalize(defined_type) end + def check(node : Ast::Block) : Checkable + resolve node.expression + end + def check(node : Ast::Function) : Checkable scope node do scope node.where.try(&.statements) || [] of Ast::WhereStatement do From facfd52470e5e2d3bdfcaf6c026855539d575447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Mon, 12 Jul 2021 11:13:47 +0200 Subject: [PATCH 02/20] Implement initial type checker for block. --- spec/compilers/block | 18 ++++++++++++++++++ src/ast/function.cr | 6 ++---- src/compilers/function.cr | 17 ++++++++++++++++- src/compilers/statement.cr | 6 +++++- src/formatters/function.cr | 2 +- src/parsers/function.cr | 12 +----------- src/type_checkers/function.cr | 13 ++++++++++++- 7 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 spec/compilers/block diff --git a/spec/compilers/block b/spec/compilers/block new file mode 100644 index 000000000..ed07939e3 --- /dev/null +++ b/spec/compilers/block @@ -0,0 +1,18 @@ +component Main { + fun render : String { + a = "Some string..." + + a + ", other string..." + } +} +-------------------------------------------------------------------------------- +class A extends _C { + render() { + return (() => { + const a = `Some string...`; + return a + `, other string...`; + })(); + } +}; + +A.displayName = "Main"; diff --git a/src/ast/function.cr b/src/ast/function.cr index d27c9dc4a..81bef6dce 100644 --- a/src/ast/function.cr +++ b/src/ast/function.cr @@ -1,11 +1,9 @@ module Mint class Ast class Block < Node - getter statements, expression, tail_comments + getter statements - def initialize(@tail_comments : Array(Comment), - @statements : Array(Node), - @expression : Expression, + def initialize(@statements : Array(Node), @input : Data, @from : Int32, @to : Int32) diff --git a/src/compilers/function.cr b/src/compilers/function.cr index c6a1d50d5..e3a30a5de 100644 --- a/src/compilers/function.cr +++ b/src/compilers/function.cr @@ -9,7 +9,22 @@ module Mint end def _compile(node : Ast::Block) : String - compile node.expression + if node.statements.size == 1 + compile node.statements.first + else + compiled_statements = + compile( + node + .statements + .sort_by! { |item| resolve_order.index(item) || -1 }) + + last = + compiled_statements.pop + + js.iif do + js.statements(compiled_statements + [js.return(last)]) + end + end end def _compile(node : Ast::Function, contents = "") : String diff --git a/src/compilers/statement.cr b/src/compilers/statement.cr index 9c0c74f03..83caf027f 100644 --- a/src/compilers/statement.cr +++ b/src/compilers/statement.cr @@ -1,7 +1,11 @@ module Mint class Compiler def _compile(node : Ast::Statement) : String - compile node.expression + if node.parent == Ast::Statement::Parent::None && (target = node.target) + js.const(js.variable_of(target), compile node.expression) + else + compile node.expression + end end end end diff --git a/src/formatters/function.cr b/src/formatters/function.cr index 4ba526315..4b5270f4a 100644 --- a/src/formatters/function.cr +++ b/src/formatters/function.cr @@ -1,7 +1,7 @@ module Mint class Formatter def format(node : Ast::Block) : String - list node.statements + [node.expression] + node.tail_comments + list node.statements end def format(node : Ast::Function) : String diff --git a/src/parsers/function.cr b/src/parsers/function.cr index b2fb2f2d3..054d3a22a 100644 --- a/src/parsers/function.cr +++ b/src/parsers/function.cr @@ -13,23 +13,13 @@ module Mint whitespace statements = - many { comment || statement(:none, require_name: true) } - - whitespace - - expression = - expression! SyntaxError - - whitespace - tail_comments = many { comment } + many { comment || statement(:none) } whitespace char '}', SyntaxError self << Ast::Block.new( - tail_comments: tail_comments, statements: statements, - expression: expression, from: start_position, to: position, input: data) diff --git a/src/type_checkers/function.cr b/src/type_checkers/function.cr index f53ae1e2f..ce319d5d2 100644 --- a/src/type_checkers/function.cr +++ b/src/type_checkers/function.cr @@ -18,7 +18,18 @@ module Mint end def check(node : Ast::Block) : Checkable - resolve node.expression + scope node.statements.reject(Ast::Comment) do + resolve node.statements + end + + last = + node + .statements + .reject(Ast::Comment) + .sort_by! { |item| resolve_order.index(item) || -1 } + .last + + cache[last] end def check(node : Ast::Function) : Checkable From 9e1201f4040faae205591acd273a30f2835b4f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Tue, 5 Oct 2021 09:25:24 +0200 Subject: [PATCH 03/20] Extract block related functions to their own files. --- src/ast/block.cr | 13 +++++++++++++ src/ast/function.cr | 10 ---------- src/compilers/block.cr | 22 ++++++++++++++++++++++ src/compilers/function.cr | 19 ------------------- src/formatters/block.cr | 7 +++++++ src/formatters/function.cr | 4 ---- src/parsers/code_block.cr | 22 ++++++++++++++++++++++ src/parsers/function.cr | 19 ------------------- src/type_checkers/block.cr | 18 ++++++++++++++++++ src/type_checkers/function.cr | 15 --------------- 10 files changed, 82 insertions(+), 67 deletions(-) create mode 100644 src/ast/block.cr create mode 100644 src/compilers/block.cr create mode 100644 src/formatters/block.cr create mode 100644 src/parsers/code_block.cr create mode 100644 src/type_checkers/block.cr diff --git a/src/ast/block.cr b/src/ast/block.cr new file mode 100644 index 000000000..c4454a0f8 --- /dev/null +++ b/src/ast/block.cr @@ -0,0 +1,13 @@ +module Mint + class Ast + class Block < Node + getter statements + + def initialize(@statements : Array(Node), + @input : Data, + @from : Int32, + @to : Int32) + end + end + end +end diff --git a/src/ast/function.cr b/src/ast/function.cr index 81bef6dce..66e4d0e3c 100644 --- a/src/ast/function.cr +++ b/src/ast/function.cr @@ -1,15 +1,5 @@ module Mint class Ast - class Block < Node - getter statements - - def initialize(@statements : Array(Node), - @input : Data, - @from : Int32, - @to : Int32) - end - end - class Function < Node getter name, where, arguments, body, type getter comment, head_comments, tail_comments diff --git a/src/compilers/block.cr b/src/compilers/block.cr new file mode 100644 index 000000000..d0d40b050 --- /dev/null +++ b/src/compilers/block.cr @@ -0,0 +1,22 @@ +module Mint + class Compiler + def _compile(node : Ast::Block) : String + if node.statements.size == 1 + compile node.statements.first + else + compiled_statements = + compile( + node + .statements + .sort_by! { |item| resolve_order.index(item) || -1 }) + + last = + compiled_statements.pop + + js.iif do + js.statements(compiled_statements + [js.return(last)]) + end + end + end + end +end diff --git a/src/compilers/function.cr b/src/compilers/function.cr index e3a30a5de..0dda72767 100644 --- a/src/compilers/function.cr +++ b/src/compilers/function.cr @@ -8,25 +8,6 @@ module Mint end end - def _compile(node : Ast::Block) : String - if node.statements.size == 1 - compile node.statements.first - else - compiled_statements = - compile( - node - .statements - .sort_by! { |item| resolve_order.index(item) || -1 }) - - last = - compiled_statements.pop - - js.iif do - js.statements(compiled_statements + [js.return(last)]) - end - end - end - def _compile(node : Ast::Function, contents = "") : String name = js.variable_of(node) diff --git a/src/formatters/block.cr b/src/formatters/block.cr new file mode 100644 index 000000000..c7035d35e --- /dev/null +++ b/src/formatters/block.cr @@ -0,0 +1,7 @@ +module Mint + class Formatter + def format(node : Ast::Block) : String + list node.statements + end + end +end diff --git a/src/formatters/function.cr b/src/formatters/function.cr index 4b5270f4a..54e9d84e8 100644 --- a/src/formatters/function.cr +++ b/src/formatters/function.cr @@ -1,9 +1,5 @@ module Mint class Formatter - def format(node : Ast::Block) : String - list node.statements - end - def format(node : Ast::Function) : String name = format node.name diff --git a/src/parsers/code_block.cr b/src/parsers/code_block.cr new file mode 100644 index 000000000..4e008533a --- /dev/null +++ b/src/parsers/code_block.cr @@ -0,0 +1,22 @@ +module Mint + class Parser + def code_block : Ast::Block? + start do |start_position| + char '{', SyntaxError + whitespace + + statements = + many { comment || statement(:none) } + + whitespace + char '}', SyntaxError + + self << Ast::Block.new( + statements: statements, + from: start_position, + to: position, + input: data) + end + end + end +end diff --git a/src/parsers/function.cr b/src/parsers/function.cr index 054d3a22a..f0461ffff 100644 --- a/src/parsers/function.cr +++ b/src/parsers/function.cr @@ -7,25 +7,6 @@ module Mint syntax_error FunctionExpectedExpression syntax_error FunctionExpectedName - def code_block : Ast::Block? - start do |start_position| - char '{', SyntaxError - whitespace - - statements = - many { comment || statement(:none) } - - whitespace - char '}', SyntaxError - - self << Ast::Block.new( - statements: statements, - from: start_position, - to: position, - input: data) - end - end - def function : Ast::Function? start do |start_position| comment = self.comment diff --git a/src/type_checkers/block.cr b/src/type_checkers/block.cr new file mode 100644 index 000000000..c69fd559e --- /dev/null +++ b/src/type_checkers/block.cr @@ -0,0 +1,18 @@ +module Mint + class TypeChecker + def check(node : Ast::Block) : Checkable + scope node.statements.reject(Ast::Comment) do + resolve node.statements + end + + last = + node + .statements + .reject(Ast::Comment) + .sort_by! { |item| resolve_order.index(item) || -1 } + .last + + cache[last] + end + end +end diff --git a/src/type_checkers/function.cr b/src/type_checkers/function.cr index ce319d5d2..9b28351cc 100644 --- a/src/type_checkers/function.cr +++ b/src/type_checkers/function.cr @@ -17,21 +17,6 @@ module Mint Comparer.normalize(defined_type) end - def check(node : Ast::Block) : Checkable - scope node.statements.reject(Ast::Comment) do - resolve node.statements - end - - last = - node - .statements - .reject(Ast::Comment) - .sort_by! { |item| resolve_order.index(item) || -1 } - .last - - cache[last] - end - def check(node : Ast::Function) : Checkable scope node do scope node.where.try(&.statements) || [] of Ast::WhereStatement do From 47920575f16744034a2f9f8d94d94d8704fd6b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Tue, 5 Oct 2021 11:49:19 +0200 Subject: [PATCH 04/20] Remove where block language feature. --- core/source/Math.mint | 4 +- spec/compilers/access | 7 +- spec/compilers/block | 6 +- spec/compilers/component_instance_access | 2 +- spec/compilers/css_definition | 2 +- spec/compilers/css_media | 2 +- spec/compilers/css_selector | 2 +- spec/compilers/css_selector_multiple | 2 +- spec/compilers/dce_remove_where | 28 -------- spec/compilers/function_with_where | 33 --------- spec/compilers/get | 2 +- spec/compilers/get_with_where | 28 -------- spec/compilers/html_with_custom_style | 2 +- .../html_with_style_and_custom_style | 2 +- spec/compilers/inline_function | 7 +- spec/compilers/inline_function_recursive | 12 ++-- spec/compilers/inline_function_with_arguments | 6 +- spec/compilers/inline_functions_recursive | 16 ++--- spec/compilers/module_access | 6 +- spec/compilers/module_access_get | 2 +- spec/compilers/store_with_get | 2 +- spec/compilers/variable_component_get | 2 +- spec/compilers/variable_module_function | 7 +- spec/compilers/variable_where | 26 ------- spec/compilers/where | 33 --------- .../where_with_nested_tuple_destructuring | 16 ----- .../compilers/where_with_statement_reordering | 26 ------- spec/compilers/where_with_tuple_destructuring | 22 ------ spec/formatters/access | 8 +-- spec/formatters/function_with_where | 12 ---- spec/formatters/get_with_where | 12 ---- spec/formatters/inline_function | 7 +- spec/formatters/inline_function_multiline | 8 +-- spec/formatters/inline_function_multiline_1 | 7 +- spec/formatters/inline_function_with_comments | 7 +- spec/formatters/record_update_multiline | 14 ++-- spec/formatters/record_update_singleline | 8 +-- spec/formatters/tuple_destructuring | 8 +-- spec/formatters/where | 20 ------ spec/formatters/where_with_comments | 25 ------- spec/parsers/where_spec.cr | 16 ----- spec/recursion_spec.cr | 8 +-- spec/type_checking/access | 16 ++--- spec/type_checking/function_returning_where | 25 ------- spec/type_checking/get_returning_where | 33 --------- spec/type_checking/inline_function | 15 ++-- spec/type_checking/module_access | 4 +- spec/type_checking/module_access_provider | 5 +- spec/type_checking/next_call | 5 +- spec/type_checking/record_update | 34 ++++----- spec/type_checking/recursive | 19 ++--- spec/type_checking/where | 70 ------------------ src/ast/function.cr | 9 +-- src/ast/get.cr | 3 +- src/ast/where.cr | 14 ---- src/ast/where_statement.cr | 14 ---- src/compilers/block.cr | 22 +++++- src/compilers/function.cr | 21 +++--- src/compilers/get.cr | 21 ++---- src/compilers/variable.cr | 4 +- src/compilers/where_statement.cr | 37 ---------- src/debugger.cr | 22 ++---- src/formatters/function.cr | 7 +- src/formatters/get.cr | 5 +- src/formatters/where.cr | 10 --- src/formatters/where_statement.cr | 13 ---- src/ls/hover/where_statement.cr | 24 ------- .../function_expected_closing_bracket.cr | 7 -- src/messages/function_expected_expression.cr | 15 ---- .../function_expected_opening_bracket.cr | 7 -- .../where_expected_closing_bracket.cr | 7 -- src/messages/where_expected_equal_sign.cr | 13 ---- src/messages/where_expected_expression.cr | 13 ---- .../where_expected_opening_bracket.cr | 7 -- src/messages/where_expected_where.cr | 11 --- src/parsers/function.cr | 16 +---- src/parsers/get.cr | 1 - src/parsers/where.cr | 43 ----------- src/parsers/where_statement.cr | 26 ------- src/type_checker.cr | 2 +- src/type_checker/scope.cr | 10 --- src/type_checkers/function.cr | 72 +++++++++---------- src/type_checkers/get.cr | 34 ++++----- src/type_checkers/statement.cr | 2 +- src/type_checkers/variable.cr | 2 +- src/type_checkers/where.cr | 9 --- 86 files changed, 238 insertions(+), 976 deletions(-) delete mode 100644 spec/compilers/dce_remove_where delete mode 100644 spec/compilers/function_with_where delete mode 100644 spec/compilers/get_with_where delete mode 100644 spec/compilers/variable_where delete mode 100644 spec/compilers/where delete mode 100644 spec/compilers/where_with_nested_tuple_destructuring delete mode 100644 spec/compilers/where_with_statement_reordering delete mode 100644 spec/compilers/where_with_tuple_destructuring delete mode 100644 spec/formatters/function_with_where delete mode 100644 spec/formatters/get_with_where delete mode 100644 spec/formatters/where delete mode 100644 spec/formatters/where_with_comments delete mode 100644 spec/parsers/where_spec.cr delete mode 100644 spec/type_checking/function_returning_where delete mode 100644 spec/type_checking/get_returning_where delete mode 100644 spec/type_checking/where delete mode 100644 src/ast/where.cr delete mode 100644 src/ast/where_statement.cr delete mode 100644 src/compilers/where_statement.cr delete mode 100644 src/formatters/where.cr delete mode 100644 src/formatters/where_statement.cr delete mode 100644 src/ls/hover/where_statement.cr delete mode 100644 src/messages/function_expected_closing_bracket.cr delete mode 100644 src/messages/function_expected_expression.cr delete mode 100644 src/messages/function_expected_opening_bracket.cr delete mode 100644 src/messages/where_expected_closing_bracket.cr delete mode 100644 src/messages/where_expected_equal_sign.cr delete mode 100644 src/messages/where_expected_expression.cr delete mode 100644 src/messages/where_expected_opening_bracket.cr delete mode 100644 src/messages/where_expected_where.cr delete mode 100644 src/parsers/where.cr delete mode 100644 src/parsers/where_statement.cr delete mode 100644 src/type_checkers/where.cr diff --git a/core/source/Math.mint b/core/source/Math.mint index b8767415d..4edd5a11c 100644 --- a/core/source/Math.mint +++ b/core/source/Math.mint @@ -108,14 +108,14 @@ module Math { Math.truncate(0.123456) == 0.12 */ fun truncate (to : Number, value : Number) : Number { - `Math.trunc(#{value} * #{multiplier}) / #{multiplier}` - } where { multiplier = if (to == 0) { 1 } else { to * 100 } + + `Math.trunc(#{value} * #{multiplier}) / #{multiplier}` } /* Returns a pseudo-random number in the range 0 to less than 1. */ diff --git a/spec/compilers/access b/spec/compilers/access index c08aee46e..b2174aec3 100644 --- a/spec/compilers/access +++ b/spec/compilers/access @@ -4,9 +4,10 @@ record X { component Main { fun render : String { + x = + { name = "test" } + x.name - } where { - x = { name = "test" } } } -------------------------------------------------------------------------------- @@ -19,7 +20,7 @@ const A = _R({ class B extends _C { render() { - let a = new A({ + const a = new A({ name: `test` }); diff --git a/spec/compilers/block b/spec/compilers/block index ed07939e3..b0aa2e822 100644 --- a/spec/compilers/block +++ b/spec/compilers/block @@ -8,10 +8,8 @@ component Main { -------------------------------------------------------------------------------- class A extends _C { render() { - return (() => { - const a = `Some string...`; - return a + `, other string...`; - })(); + const a = `Some string...`; + return a + `, other string...`; } }; diff --git a/spec/compilers/component_instance_access b/spec/compilers/component_instance_access index 1603b052d..79ddd55a6 100644 --- a/spec/compilers/component_instance_access +++ b/spec/compilers/component_instance_access @@ -42,7 +42,7 @@ class D extends _E { class A extends _C { get a() { - return `Instance`; + return `Instance` } render() { diff --git a/spec/compilers/css_definition b/spec/compilers/css_definition index 71fa50265..cde3f2843 100644 --- a/spec/compilers/css_definition +++ b/spec/compilers/css_definition @@ -22,7 +22,7 @@ class A extends _C { } get a() { - return 10; + return 10 } render() { diff --git a/spec/compilers/css_media b/spec/compilers/css_media index ce83643e2..f677d586c 100644 --- a/spec/compilers/css_media +++ b/spec/compilers/css_media @@ -29,7 +29,7 @@ class A extends _C { } get a() { - return `blue`; + return `blue` } render() { diff --git a/spec/compilers/css_selector b/spec/compilers/css_selector index 453dafe46..894b2a490 100644 --- a/spec/compilers/css_selector +++ b/spec/compilers/css_selector @@ -28,7 +28,7 @@ class A extends _C { } get a() { - return `blue`; + return `blue` } render() { diff --git a/spec/compilers/css_selector_multiple b/spec/compilers/css_selector_multiple index bb4970284..03e8b68f0 100644 --- a/spec/compilers/css_selector_multiple +++ b/spec/compilers/css_selector_multiple @@ -29,7 +29,7 @@ class A extends _C { } get a() { - return `blue`; + return `blue` } render() { diff --git a/spec/compilers/dce_remove_where b/spec/compilers/dce_remove_where deleted file mode 100644 index fc6f917c3..000000000 --- a/spec/compilers/dce_remove_where +++ /dev/null @@ -1,28 +0,0 @@ -component Main { - get test : String { - x - } where { - x = - "Hello" - - y = - "Blah" - } - - fun render : String { - test - } -} --------------------------------------------------------------------------------- -class A extends _C { - get a() { - let b = `Hello`; - return b; - } - - render() { - return this.a; - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/function_with_where b/spec/compilers/function_with_where deleted file mode 100644 index 5b1f24cfd..000000000 --- a/spec/compilers/function_with_where +++ /dev/null @@ -1,33 +0,0 @@ -component Main { - fun test : String { - something - } where { - something = - "Asd" - } - - fun render : String { - try { - test() - - "" - } - } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - let b = `Asd`; - return b; - } - - render() { - return (() => { - this.a(); - return ``; - })(); - } -}; - -A.displayName = "Main"; - diff --git a/spec/compilers/get b/spec/compilers/get index cdaf514da..0f34adc78 100644 --- a/spec/compilers/get +++ b/spec/compilers/get @@ -10,7 +10,7 @@ component Main { -------------------------------------------------------------------------------- class A extends _C { get a() { - return ``; + return `` } render() { diff --git a/spec/compilers/get_with_where b/spec/compilers/get_with_where deleted file mode 100644 index 05316ea4e..000000000 --- a/spec/compilers/get_with_where +++ /dev/null @@ -1,28 +0,0 @@ -component Main { - get test : String { - something - } where { - something = - "Asd" - - otherThing = - 0 - } - - fun render : String { - test - } -} --------------------------------------------------------------------------------- -class A extends _C { - get a() { - let b = `Asd`; - return b; - } - - render() { - return this.a; - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/html_with_custom_style b/spec/compilers/html_with_custom_style index 622ce4728..ad393499f 100644 --- a/spec/compilers/html_with_custom_style +++ b/spec/compilers/html_with_custom_style @@ -21,7 +21,7 @@ class A extends _C { } get a() { - return; + return } get b() { diff --git a/spec/compilers/html_with_style_and_custom_style b/spec/compilers/html_with_style_and_custom_style index fa2addc33..cf9ae227f 100644 --- a/spec/compilers/html_with_style_and_custom_style +++ b/spec/compilers/html_with_style_and_custom_style @@ -34,7 +34,7 @@ class A extends _C { } get b() { - return; + return } get a() { diff --git a/spec/compilers/inline_function b/spec/compilers/inline_function index 86d4d9487..e18aa1ce0 100644 --- a/spec/compilers/inline_function +++ b/spec/compilers/inline_function @@ -1,14 +1,15 @@ component Main { fun render : String { + a = + () : String { "Hello" } + a() - } where { - a = () : String { "Hello" } } } -------------------------------------------------------------------------------- class A extends _C { render() { - let a = () => { + const a = () => { return `Hello` }; diff --git a/spec/compilers/inline_function_recursive b/spec/compilers/inline_function_recursive index ae7a34749..eec7c85f7 100644 --- a/spec/compilers/inline_function_recursive +++ b/spec/compilers/inline_function_recursive @@ -1,7 +1,5 @@ module Test { fun factorial(n : Number) : Number { - helper(n, 1) - } where { helper = (n : Number, acc : Number) : Number { if (n == 0) { acc @@ -9,6 +7,8 @@ module Test { helper(n - 1, acc * n) } } + + helper(n, 1) } } @@ -23,12 +23,12 @@ component Main { } -------------------------------------------------------------------------------- const B = new(class extends _M { - a(c) { - let b = (d, e) => { - return (_compare(d, 0) ? e : b(d - 1, e * d)) + a(e) { + const b = (c, d) => { + return (_compare(c, 0) ? d : b(c - 1, d * c)) }; - return b(c, 1); + return b(e, 1); } }); diff --git a/spec/compilers/inline_function_with_arguments b/spec/compilers/inline_function_with_arguments index 5fe03a8bf..5337189b1 100644 --- a/spec/compilers/inline_function_with_arguments +++ b/spec/compilers/inline_function_with_arguments @@ -1,9 +1,9 @@ component Main { fun test : String { - getName("Joe") - } where { getName = (name : String) : String { name } + + getName("Joe") } fun render : String { @@ -17,7 +17,7 @@ component Main { -------------------------------------------------------------------------------- class A extends _C { a() { - let b = (c) => { + const b = (c) => { return c }; diff --git a/spec/compilers/inline_functions_recursive b/spec/compilers/inline_functions_recursive index e0f757e82..777e14379 100644 --- a/spec/compilers/inline_functions_recursive +++ b/spec/compilers/inline_functions_recursive @@ -1,7 +1,5 @@ module Test { fun a(n : Number) : Number { - c(n, 1) - } where { b = (n : Number, acc : Number) : Number { if (n == 0) { acc @@ -19,6 +17,8 @@ module Test { b(n - 1, acc * n) } } + + c(n, 1) } } @@ -33,16 +33,16 @@ component Main { } -------------------------------------------------------------------------------- const B = new(class extends _M { - a(c) { - let f = (d, e) => { - return (_compare(d, 0) ? e : b(d - 1, e * d)) + a(h) { + const b = (c, d) => { + return (_compare(c, 0) ? d : e(c - 1, d * c)) }; - let b = (g, h) => { - return (_compare(g, 0) ? h : f(g - 1, h * g)) + const e = (f, g) => { + return (_compare(f, 0) ? g : b(f - 1, g * f)) }; - return b(c, 1); + return b(h, 1); } }); diff --git a/spec/compilers/module_access b/spec/compilers/module_access index 18f22cb09..64213d6d8 100644 --- a/spec/compilers/module_access +++ b/spec/compilers/module_access @@ -10,10 +10,10 @@ module Test { component Main { fun render : String { - x() - } where { x = Test.b() + + x() } } -------------------------------------------------------------------------------- @@ -29,7 +29,7 @@ const B = new(class extends _M { class A extends _C { render() { - let a = B.b(); + const a = B.b(); return a(); } }; diff --git a/spec/compilers/module_access_get b/spec/compilers/module_access_get index afe55394e..6728adfee 100644 --- a/spec/compilers/module_access_get +++ b/spec/compilers/module_access_get @@ -29,7 +29,7 @@ const B = new(class extends _S { } get b() { - return `Hello`; + return `Hello` } a() { diff --git a/spec/compilers/store_with_get b/spec/compilers/store_with_get index 67858cd72..d09d51cd7 100644 --- a/spec/compilers/store_with_get +++ b/spec/compilers/store_with_get @@ -48,6 +48,6 @@ const B = new(class extends _S { } get c() { - return `hello`; + return `hello` } }); diff --git a/spec/compilers/variable_component_get b/spec/compilers/variable_component_get index 34d2108eb..134357fea 100644 --- a/spec/compilers/variable_component_get +++ b/spec/compilers/variable_component_get @@ -10,7 +10,7 @@ component Main { -------------------------------------------------------------------------------- class A extends _C { get a() { - return `Hello`; + return `Hello` } render() { diff --git a/spec/compilers/variable_module_function b/spec/compilers/variable_module_function index e12495b01..a0b020b39 100644 --- a/spec/compilers/variable_module_function +++ b/spec/compilers/variable_module_function @@ -10,9 +10,10 @@ module A { component Main { fun render : String { + a = + A.b() + a() - } where { - a = A.b() } } -------------------------------------------------------------------------------- @@ -28,7 +29,7 @@ const B = new(class extends _M { class A extends _C { render() { - let a = B.b(); + const a = B.b(); return a(); } }; diff --git a/spec/compilers/variable_where b/spec/compilers/variable_where deleted file mode 100644 index 748d73cb8..000000000 --- a/spec/compilers/variable_where +++ /dev/null @@ -1,26 +0,0 @@ -component Main { - fun test : String { - a - } where { - a = - "Hello" - } - - fun render : String { - test() - } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - let b = `Hello`; - return b; - } - - render() { - return this.a(); - } -}; - -A.displayName = "Main"; - diff --git a/spec/compilers/where b/spec/compilers/where deleted file mode 100644 index fc8d237fd..000000000 --- a/spec/compilers/where +++ /dev/null @@ -1,33 +0,0 @@ -component Main { - fun test : Html { -
- <{ something }> -
- } where { - something = - "Asd" - - otherThing = - 0 - } - - fun render : Html { - test() - } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - let b = `Asd`; - - return _h("div", {}, [ - b - ]); - } - - render() { - return this.a(); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/where_with_nested_tuple_destructuring b/spec/compilers/where_with_nested_tuple_destructuring deleted file mode 100644 index a0bc89865..000000000 --- a/spec/compilers/where_with_nested_tuple_destructuring +++ /dev/null @@ -1,16 +0,0 @@ -component Main { - fun render : String { - y - } where { - {x, {y}} = {"hello", {"a", "b"}} - } -} --------------------------------------------------------------------------------- -class A extends _C { - render() { - const [b,[a]] = [`hello`, [`a`, `b`]]; - return a; - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/where_with_statement_reordering b/spec/compilers/where_with_statement_reordering deleted file mode 100644 index 720c6033a..000000000 --- a/spec/compilers/where_with_statement_reordering +++ /dev/null @@ -1,26 +0,0 @@ -component Main { - fun render : Html { -
- <{ something }> -
- } where { - something = - otherThing - - otherThing = - "Asd" - } -} --------------------------------------------------------------------------------- -class A extends _C { - render() { - let b = `Asd`; - let a = b; - - return _h("div", {}, [ - a - ]); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/where_with_tuple_destructuring b/spec/compilers/where_with_tuple_destructuring deleted file mode 100644 index f3f69b257..000000000 --- a/spec/compilers/where_with_tuple_destructuring +++ /dev/null @@ -1,22 +0,0 @@ -component Main { - fun render : Html { -
- <{ something }> -
- } where { - {something, otherThing} = - {"Asd", 0} - } -} --------------------------------------------------------------------------------- -class A extends _C { - render() { - const [a,b] = [`Asd`, 0]; - - return _h("div", {}, [ - a - ]); - } -}; - -A.displayName = "Main"; diff --git a/spec/formatters/access b/spec/formatters/access index 42af37aae..2aecacceb 100644 --- a/spec/formatters/access +++ b/spec/formatters/access @@ -8,10 +8,10 @@ record Blah { module Test { fun test : Bool { - blah.blah.blah - } where { blah = { blah = { blah = true } } + + blah.blah.blah } } -------------------------------------------------------------------------------- @@ -25,9 +25,9 @@ record Blah { module Test { fun test : Bool { - blah.blah.blah - } where { blah = { blah = { blah = true } } + + blah.blah.blah } } diff --git a/spec/formatters/function_with_where b/spec/formatters/function_with_where deleted file mode 100644 index 7ef17cde3..000000000 --- a/spec/formatters/function_with_where +++ /dev/null @@ -1,12 +0,0 @@ -module A { - funtest(a:String):Void{b}where{b=void} -} --------------------------------------------------------------------------------- -module A { - fun test (a : String) : Void { - b - } where { - b = - void - } -} diff --git a/spec/formatters/get_with_where b/spec/formatters/get_with_where deleted file mode 100644 index e98e0681f..000000000 --- a/spec/formatters/get_with_where +++ /dev/null @@ -1,12 +0,0 @@ -store A { - gettest:Void{b}where{b=void} -} --------------------------------------------------------------------------------- -store A { - get test : Void { - b - } where { - b = - void - } -} diff --git a/spec/formatters/inline_function b/spec/formatters/inline_function index bb187eb11..b95358364 100644 --- a/spec/formatters/inline_function +++ b/spec/formatters/inline_function @@ -1,16 +1,15 @@ module A { fun test : String { - a() - } where { a = ():String{"Hello"} + a() } } -------------------------------------------------------------------------------- module A { fun test : String { - a() - } where { a = () : String { "Hello" } + + a() } } diff --git a/spec/formatters/inline_function_multiline b/spec/formatters/inline_function_multiline index b436c1f32..f1a9061af 100644 --- a/spec/formatters/inline_function_multiline +++ b/spec/formatters/inline_function_multiline @@ -5,12 +5,12 @@ record X { module A { fun test : String { - result.name - } where { a = (name:String,age:Number):X{{name = name, age = age}} result = a("Joe", 25) + + result.name } } -------------------------------------------------------------------------------- @@ -21,8 +21,6 @@ record X { module A { fun test : String { - result.name - } where { a = (name : String, age : Number) : X { { @@ -33,5 +31,7 @@ module A { result = a("Joe", 25) + + result.name } } diff --git a/spec/formatters/inline_function_multiline_1 b/spec/formatters/inline_function_multiline_1 index 72f887d8a..4e1f804a3 100644 --- a/spec/formatters/inline_function_multiline_1 +++ b/spec/formatters/inline_function_multiline_1 @@ -1,19 +1,18 @@ module A { fun test : String { - a() - } where { a = ():String{ "Hello"} + a() } } -------------------------------------------------------------------------------- module A { fun test : String { - a() - } where { a = () : String { "Hello" } + + a() } } diff --git a/spec/formatters/inline_function_with_comments b/spec/formatters/inline_function_with_comments index 6e9cf8b55..658753740 100644 --- a/spec/formatters/inline_function_with_comments +++ b/spec/formatters/inline_function_with_comments @@ -1,17 +1,14 @@ module A { // fun test : String { - a() - } where { a = ():String{/*A*/"Hello"/*B*/} + a() } } -------------------------------------------------------------------------------- module A { // fun test : String { - a() - } where { a = () : String { /* A */ @@ -19,5 +16,7 @@ module A { /* B */ } + + a() } } diff --git a/spec/formatters/record_update_multiline b/spec/formatters/record_update_multiline index e024a273b..e9e219dcc 100644 --- a/spec/formatters/record_update_multiline +++ b/spec/formatters/record_update_multiline @@ -5,10 +5,10 @@ record A { module Test { fun test : A { - {x|a="Hello",b=true} - } where { x = { a = "Blah", b = false } + + {x|a="Hello",b=true} } } -------------------------------------------------------------------------------- @@ -19,15 +19,15 @@ record A { module Test { fun test : A { - { x | - a = "Hello", - b = true - } - } where { x = { a = "Blah", b = false } + + { x | + a = "Hello", + b = true + } } } diff --git a/spec/formatters/record_update_singleline b/spec/formatters/record_update_singleline index 258f6fa0d..5c0ba7166 100644 --- a/spec/formatters/record_update_singleline +++ b/spec/formatters/record_update_singleline @@ -4,10 +4,10 @@ record A { module Test { fun test : A { - {x|a="Hello"} - } where { x = { a = "Blah" } + + {x|a="Hello"} } } -------------------------------------------------------------------------------- @@ -17,9 +17,9 @@ record A { module Test { fun test : A { - { x | a = "Hello" } - } where { x = { a = "Blah" } + + { x | a = "Hello" } } } diff --git a/spec/formatters/tuple_destructuring b/spec/formatters/tuple_destructuring index e29156d33..9dc7c83be 100644 --- a/spec/formatters/tuple_destructuring +++ b/spec/formatters/tuple_destructuring @@ -1,17 +1,17 @@ module Test { fun test : String { - a - } where { {a, b} = {"A", "B"} + + a } } -------------------------------------------------------------------------------- module Test { fun test : String { - a - } where { {a, b} = {"A", "B"} + + a } } diff --git a/spec/formatters/where b/spec/formatters/where deleted file mode 100644 index db170ef25..000000000 --- a/spec/formatters/where +++ /dev/null @@ -1,20 +0,0 @@ -module A { - fun test () : Number { - something - } where { - something = 0.100 - otherThing = false - } -} --------------------------------------------------------------------------------- -module A { - fun test : Number { - something - } where { - something = - 0.100 - - otherThing = - false - } -} diff --git a/spec/formatters/where_with_comments b/spec/formatters/where_with_comments deleted file mode 100644 index 2409f8b03..000000000 --- a/spec/formatters/where_with_comments +++ /dev/null @@ -1,25 +0,0 @@ -module A { - fun test () : Number { - something - } where { - /*A*/something = 0.100 - /*B*/otherThing = false - /*C*/ - } -} --------------------------------------------------------------------------------- -module A { - fun test : Number { - something - } where { - /* A */ - something = - 0.100 - - /* B */ - otherThing = - false - - /* C */ - } -} diff --git a/spec/parsers/where_spec.cr b/spec/parsers/where_spec.cr deleted file mode 100644 index 94e1a7d21..000000000 --- a/spec/parsers/where_spec.cr +++ /dev/null @@ -1,16 +0,0 @@ -require "../spec_helper" - -describe "Where" do - subject where - - expect_error "where", Mint::Parser::WhereExpectedOpeningBracket - expect_error "where ", Mint::Parser::WhereExpectedOpeningBracket - expect_error "where {", Mint::Parser::WhereExpectedWhere - expect_error "where { ", Mint::Parser::WhereExpectedWhere - expect_error "where { a", Mint::Parser::WhereExpectedEqualSign - expect_error "where { a ", Mint::Parser::WhereExpectedEqualSign - expect_error "where { a =", Mint::Parser::WhereExpectedExpression - expect_error "where { a = ", Mint::Parser::WhereExpectedExpression - expect_error "where { a = a", Mint::Parser::WhereExpectedClosingBracket - expect_error "where { a = a ", Mint::Parser::WhereExpectedClosingBracket -end diff --git a/spec/recursion_spec.cr b/spec/recursion_spec.cr index 8db3b97cc..3ee7be93d 100644 --- a/spec/recursion_spec.cr +++ b/spec/recursion_spec.cr @@ -8,16 +8,16 @@ describe "variable" do state greeting : String = "" fun test : Void { - sequence { - next { greeting = greeting } - } - } where { greeting = if (greeting == "hello") { "bye" } else { "hello" } + + sequence { + next { greeting = greeting } + } } fun render : Html { diff --git a/spec/type_checking/access b/spec/type_checking/access index c38cf1bab..618fb1381 100644 --- a/spec/type_checking/access +++ b/spec/type_checking/access @@ -8,18 +8,18 @@ record Blah { component Main { fun render : String { - blah.blah.blah - } where { blah = { blah = { blah = "Helllo" } } + + blah.blah.blah } } -----------------------------------------------------------------AccessNotRecord component Main { fun render : Bool { - blah.blah.blah - } where { blah = "" + + blah.blah.blah } } -----------------------------------------------------------------AccessNotRecord @@ -29,10 +29,10 @@ record Blah { component Main { fun render : Bool { - blah.blah.blah - } where { blah = { blah = "Blah" } + + blah.blah.blah } } -------------------------------------------------------------AccessFieldNotFound @@ -42,9 +42,9 @@ record Blah { component Main { fun render : Bool { - blah.blaha - } where { blah = { blah = "Hello" } + + blah.blaha } } diff --git a/spec/type_checking/function_returning_where b/spec/type_checking/function_returning_where deleted file mode 100644 index 6d0d779cf..000000000 --- a/spec/type_checking/function_returning_where +++ /dev/null @@ -1,25 +0,0 @@ -component Main { - fun test : Bool { - x - } where { - x = - true - } - - fun render : String { - "" - } -} -------------------------------------------------------------FunctionTypeMismatch -component Main { - fun test : Bool { - x - } where { - x = - "hello" - } - - fun render : Html { - "" - } -} diff --git a/spec/type_checking/get_returning_where b/spec/type_checking/get_returning_where deleted file mode 100644 index 430c11f4b..000000000 --- a/spec/type_checking/get_returning_where +++ /dev/null @@ -1,33 +0,0 @@ -store A { - get test : Bool { - x - } where { - x = - true - } -} - -component Main { - connect A exposing { test } - - fun render : String { - "" - } -} ------------------------------------------------------------------GetTypeMismatch -store A { - get test : Bool { - x - } where { - x = - "hello" - } -} - -component Main { - connect A exposing { test } - - fun render : String { - "" - } -} diff --git a/spec/type_checking/inline_function b/spec/type_checking/inline_function index 6981b43f4..55f9bca01 100644 --- a/spec/type_checking/inline_function +++ b/spec/type_checking/inline_function @@ -1,8 +1,9 @@ component Main { fun test : String { + a = + () : String { "Hello" } + a() - } where { - a = () : String { "Hello" } } fun render : String { @@ -12,9 +13,10 @@ component Main { ------------------------------------------------------------FunctionTypeMismatch component Main { fun test : String { + a = + () : Bool { true } + a() - } where { - a = () : Bool { true } } fun render : String { @@ -24,9 +26,10 @@ component Main { ------------------------------------------------------InlineFunctionTypeMismatch component Main { fun test : String { + a = + () : String { true } + a() - } where { - a = () : String { true } } fun render : String { diff --git a/spec/type_checking/module_access b/spec/type_checking/module_access index 985252303..79a454874 100644 --- a/spec/type_checking/module_access +++ b/spec/type_checking/module_access @@ -10,10 +10,10 @@ module Test { component Main { fun render : String { - x() - } where { x = Test.b() + + x() } } ----------------------------------------------------ModuleAccessNotFoundFunction diff --git a/spec/type_checking/module_access_provider b/spec/type_checking/module_access_provider index fe5a0f8ac..b98611b45 100644 --- a/spec/type_checking/module_access_provider +++ b/spec/type_checking/module_access_provider @@ -1,6 +1,7 @@ record Test { test : String } + provider Test : Test { fun print (a : String) : String { a @@ -13,9 +14,9 @@ component Main { } fun render : String { - x - } where { x = Test.print("x") + + x } } diff --git a/spec/type_checking/next_call b/spec/type_checking/next_call index e4a223ef6..ea69c2578 100644 --- a/spec/type_checking/next_call +++ b/spec/type_checking/next_call @@ -22,9 +22,10 @@ module Test { component Main { fun render : Html { + test = + Test.test() +
- } where { - test = Test.test() } } -------------------------------------------------------NextCallStateTypeMismatch diff --git a/spec/type_checking/record_update b/spec/type_checking/record_update index da150d3c4..828d9e576 100644 --- a/spec/type_checking/record_update +++ b/spec/type_checking/record_update @@ -5,16 +5,16 @@ record Test { component Main { fun test : Test { - { x | - a = "Hello", - b = 0 - } - } where { x = { a = "Blah", b = 1 } + + { x | + a = "Hello", + b = 0 + } } fun render : String { @@ -33,12 +33,12 @@ record Test { component Main { fun test : Test { + x = "" + { x | a = "Hello", b = 0 } - } where { - x = "" } fun render : String { @@ -57,16 +57,16 @@ record Test { component Main { fun test : Test { - { x | - a = "Hello", - b = "Hello" - } - } where { x = { a = "Blah", b = 0 } + + { x | + a = "Hello", + b = "Hello" + } } fun render : String { @@ -85,16 +85,16 @@ record Test { component Main { fun test : Test { - { x | - a = "Hello", - c = "Hello" - } - } where { x = { a = "Blah", b = 0 } + + { x | + a = "Hello", + c = "Hello" + } } fun render : String { diff --git a/spec/type_checking/recursive b/spec/type_checking/recursive index 40b1a664d..30947b4b2 100644 --- a/spec/type_checking/recursive +++ b/spec/type_checking/recursive @@ -10,8 +10,6 @@ component Main { -------------------------------------------------------------------------------- module Test { fun factorial(n : Number) : Number { - helper(n, 1) - } where { helper = (n : Number, acc : Number) : Number { if (n == 0) { acc @@ -20,13 +18,13 @@ module Test { helper(n - 1, acc * n) } } + + helper(n, 1) } } -------------------------------------------------------------------------------- module Test { fun factorial (n : Number) : Number { - 1 - } where { helper = (n : Number, acc : Number) : Number { if (n == 0) { @@ -35,13 +33,13 @@ module Test { helper(n - 1, acc * n) } } + + 1 } } -------------------------------------------------------------------------------- module Test { fun factorial (n : Number) : Number { - 1 - } where { helper = (n : Number, acc : Number) : Number { if (n == 0) { @@ -51,14 +49,15 @@ module Test { } } - result = helper(n, 1) + result = + helper(n, 1) + + 1 } } -------------------------------------------------------------------------------- module Test { fun a(n : Number) : Number { - c(n, 1) - } where { b = (n : Number, acc : Number) : Number { if (n == 0) { acc @@ -76,6 +75,8 @@ module Test { b(n - 1, acc * n) } } + + c(n, 1) } } -------------------------------------------------------------------------------- diff --git a/spec/type_checking/where b/spec/type_checking/where deleted file mode 100644 index 3946f7090..000000000 --- a/spec/type_checking/where +++ /dev/null @@ -1,70 +0,0 @@ -component Main { - fun test : Number { - value - } where { - value = - 10 - } - - fun render : String { - "" - } -} ---------------------------------------------------------------- -component Main { - fun render : String { - x - } where { - {x} = {"hello"} - } -} ---------------------------------------------------------------- -component Main { - fun render : String { - y - } where { - {x, {y}} = {"hello", {"a", "b"}} - } -} ----------------------------------------------------------------StatementNotTuple -component Main { - fun render : String { - x - } where { - {x, y, z} = "hello" - } -} -----------------------------------------------------------StatementTupleMismatch -component Main { - fun render : String { - x - } where { - {x, y, z} = {"hello", "a"} - } -} -------------------------------------------------------InlineFunctionTypeMismatch -module Test { - fun test1(a : Number) : String { - "" - } where { - test2 = (a : Number) : String { - 0 - } - } -} -----------------------------------------------------------StatementNotTuple -component Main { - fun render : String { - y - } where { - {x, {y}} = {"hello", "a"} - } -} -----------------------------------------------------------StatementTupleMismatch -component Main { - fun render : String { - y - } where { - {x, {y, z}} = {"hello", {"a"}} - } -} diff --git a/src/ast/function.cr b/src/ast/function.cr index 66e4d0e3c..ee6cb9d14 100644 --- a/src/ast/function.cr +++ b/src/ast/function.cr @@ -1,19 +1,16 @@ module Mint class Ast class Function < Node - getter name, where, arguments, body, type - getter comment, head_comments, tail_comments + getter name, arguments, body, type + getter comment property? keep_name = false - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @arguments : Array(Argument), + def initialize(@arguments : Array(Argument), @type : TypeOrVariable?, @comment : Comment?, @body : Expression, @name : Variable, - @where : Where?, @input : Data, @from : Int32, @to : Int32) diff --git a/src/ast/get.cr b/src/ast/get.cr index f8a692552..8a50b03ae 100644 --- a/src/ast/get.cr +++ b/src/ast/get.cr @@ -1,7 +1,7 @@ module Mint class Ast class Get < Node - getter name, body, type, comment, head_comments, tail_comments, where + getter name, body, type, comment, head_comments, tail_comments def initialize(@head_comments : Array(Comment), @tail_comments : Array(Comment), @@ -9,7 +9,6 @@ module Mint @comment : Comment?, @body : Expression, @name : Variable, - @where : Where?, @input : Data, @from : Int32, @to : Int32) diff --git a/src/ast/where.cr b/src/ast/where.cr deleted file mode 100644 index b8c064150..000000000 --- a/src/ast/where.cr +++ /dev/null @@ -1,14 +0,0 @@ -module Mint - class Ast - class Where < Node - getter statements, comments - - def initialize(@statements : Array(WhereStatement), - @comments : Array(Comment), - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/ast/where_statement.cr b/src/ast/where_statement.cr deleted file mode 100644 index e8caddb0d..000000000 --- a/src/ast/where_statement.cr +++ /dev/null @@ -1,14 +0,0 @@ -module Mint - class Ast - class WhereStatement < Node - getter target, expression - - def initialize(@target : Node, - @expression : Expression, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/compilers/block.cr b/src/compilers/block.cr index d0d40b050..efd3d95d8 100644 --- a/src/compilers/block.cr +++ b/src/compilers/block.cr @@ -1,8 +1,20 @@ module Mint class Compiler - def _compile(node : Ast::Block) : String + def compile(node : Ast::Block, for_function = true) : String + if checked.includes?(node) + _compile(node, for_function) + else + "" + end + end + + def _compile(node : Ast::Block, for_function = true) : String if node.statements.size == 1 - compile node.statements.first + if for_function + js.return(compile(node.statements.first)) + else + compile(node.statements.first) + end else compiled_statements = compile( @@ -13,8 +25,12 @@ module Mint last = compiled_statements.pop - js.iif do + if for_function js.statements(compiled_statements + [js.return(last)]) + else + js.iif do + js.statements(compiled_statements + [js.return(last)]) + end end end end diff --git a/src/compilers/function.cr b/src/compilers/function.cr index 0dda72767..9a2d470a1 100644 --- a/src/compilers/function.cr +++ b/src/compilers/function.cr @@ -13,24 +13,23 @@ module Mint js.variable_of(node) expression = - compile node.body - - wheres = - node.where - .try(&.statements) - .try(&.sort_by { |item| resolve_order.index(item) || -1 }) - .try { |statements| compile statements } + case item = node.body + when Ast::Block + compile item, for_function: true + else + compile item + end arguments = compile node.arguments - last = - [js.return(expression)] + items = + [expression] - last.unshift(contents) unless contents.empty? + items.unshift(contents) unless contents.empty? body = - js.statements(%w[] &+ wheres &+ last) + js.statements(items) js.function(name, arguments, body) end diff --git a/src/compilers/get.cr b/src/compilers/get.cr index 2a5bc5227..b92f62620 100644 --- a/src/compilers/get.cr +++ b/src/compilers/get.cr @@ -2,24 +2,17 @@ module Mint class Compiler def _compile(node : Ast::Get) : String body = - compile node.body - - wheres = - node.where - .try(&.statements) - .try(&.sort_by { |item| resolve_order.index(item) || -1 }) - .try { |statements| compile statements } + case item = node.body + when Ast::Block + compile item, for_function: true + else + compile item + end name = js.variable_of(node) - last = - [js.return(body)] - - body = - js.statements(%w[] &+ wheres &+ last) - - js.get(name, body) + js.get(name, js.return(body)) end end end diff --git a/src/compilers/variable.cr b/src/compilers/variable.cr index 6c4b7a954..1c3191b82 100644 --- a/src/compilers/variable.cr +++ b/src/compilers/variable.cr @@ -89,7 +89,7 @@ module Mint end when Ast::Argument compile entity - when Ast::Statement, Ast::WhereStatement + when Ast::Statement case target = entity.target when Ast::Variable js.variable_of(target) @@ -98,7 +98,7 @@ module Mint end when Tuple(Ast::Node, Array(Int32) | Int32) case item = entity[0] - when Ast::WhereStatement, Ast::Statement + when Ast::Statement case target = item.target when Ast::TupleDestructuring case val = entity[1] diff --git a/src/compilers/where_statement.cr b/src/compilers/where_statement.cr deleted file mode 100644 index f35479be6..000000000 --- a/src/compilers/where_statement.cr +++ /dev/null @@ -1,37 +0,0 @@ -module Mint - class Compiler - def _compile(node : Ast::WhereStatement) : String - expression = - compile node.expression - - case target = node.target - when Ast::Variable - name = - js.variable_of(target) - - "let #{name} = #{expression}" - when Ast::TupleDestructuring - "const #{_to_variable(target)} = #{expression}" - else - "" - end - end - - def _to_variable(node : Ast::TupleDestructuring) - variables = - node - .parameters - .join(',') do |param| - case param - when Ast::Variable, Ast::TupleDestructuring - _to_variable(param) - end - end - "[#{variables}]" - end - - def _to_variable(node : Ast::Variable) - js.variable_of(node) - end - end -end diff --git a/src/debugger.cr b/src/debugger.cr index 63e7e1624..21cd3d159 100644 --- a/src/debugger.cr +++ b/src/debugger.cr @@ -28,27 +28,13 @@ module Mint end def debug(node : Ast::Function) - arguments = - node.arguments.join('\n') do |argument| - "#{argument.name.value} => #{argument}" - end - - statements = - node.where.try do |where| - where.statements.join('\n') do |statement| - "#{statement.target.class.name} => #{statement}" - end - end.to_s - - {arguments, statements}.join('\n') + node.arguments.join('\n') do |argument| + "#{argument.name.value} => #{argument}" + end end def debug(node : Ast::Get) - node.where.try do |where| - where.statements.join('\n') do |statement| - "#{statement.target.class.name} => #{statement}" - end - end.to_s + "" end def debug(node : Ast::Module) diff --git a/src/formatters/function.cr b/src/formatters/function.cr index 54e9d84e8..b39129a5a 100644 --- a/src/formatters/function.cr +++ b/src/formatters/function.cr @@ -10,21 +10,18 @@ module Mint end body = - list [node.body] + node.head_comments + node.tail_comments + format node.body arguments = format_arguments node.arguments - where = - format node.where - comment = node.comment.try { |item| "#{format item}\n" } head = ["fun", name, arguments, type].compact!.join(' ') - "#{comment}#{head} {\n#{indent(body)}\n}#{where}" + "#{comment}#{head} {\n#{indent(body)}\n}" end end end diff --git a/src/formatters/get.cr b/src/formatters/get.cr index 0062edd5a..278e52eeb 100644 --- a/src/formatters/get.cr +++ b/src/formatters/get.cr @@ -12,13 +12,10 @@ module Mint body = list [node.body] + node.head_comments + node.tail_comments - where = - format node.where - comment = node.comment.try { |item| "#{format(item)}\n" } - "#{comment}get #{name}#{type} {\n#{indent(body)}\n}#{where}" + "#{comment}get #{name}#{type} {\n#{indent(body)}\n}" end end end diff --git a/src/formatters/where.cr b/src/formatters/where.cr deleted file mode 100644 index c8274a05a..000000000 --- a/src/formatters/where.cr +++ /dev/null @@ -1,10 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::Where) : String - statements = - list node.statements + node.comments - - " where {\n#{indent(statements)}\n}" - end - end -end diff --git a/src/formatters/where_statement.cr b/src/formatters/where_statement.cr deleted file mode 100644 index 273171eaa..000000000 --- a/src/formatters/where_statement.cr +++ /dev/null @@ -1,13 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::WhereStatement) : String - expression = - format node.expression - - target = - format node.target - - "#{target} =\n#{indent(expression)}" - end - end -end diff --git a/src/ls/hover/where_statement.cr b/src/ls/hover/where_statement.cr deleted file mode 100644 index 05d7fce43..000000000 --- a/src/ls/hover/where_statement.cr +++ /dev/null @@ -1,24 +0,0 @@ -module Mint - module LS - class Hover < LSP::RequestMessage - def hover(node : Ast::WhereStatement, workspace) : Array(String) - type = - workspace - .type_checker - .cache[node]? - .try(&.to_pretty) - .try { |value| "```\n#{value}\n```" } - - head = - workspace - .formatter - .format(node.target) - - [ - "**#{head} =**", - type, - ].compact - end - end - end -end diff --git a/src/messages/function_expected_closing_bracket.cr b/src/messages/function_expected_closing_bracket.cr deleted file mode 100644 index 53b486751..000000000 --- a/src/messages/function_expected_closing_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message FunctionExpectedClosingBracket do - title "Syntax Error" - - closing_bracket "function", got - - snippet node -end diff --git a/src/messages/function_expected_expression.cr b/src/messages/function_expected_expression.cr deleted file mode 100644 index 4c1623b2e..000000000 --- a/src/messages/function_expected_expression.cr +++ /dev/null @@ -1,15 +0,0 @@ -message FunctionExpectedExpression do - title "Syntax Error" - - block do - text "The" - bold "body" - text "of a" - bold "function" - text "must be a single expression." - end - - was_looking_for "expression", got - - snippet node -end diff --git a/src/messages/function_expected_opening_bracket.cr b/src/messages/function_expected_opening_bracket.cr deleted file mode 100644 index b4adbf966..000000000 --- a/src/messages/function_expected_opening_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message FunctionExpectedOpeningBracket do - title "Syntax Error" - - opening_bracket "function", got - - snippet node -end diff --git a/src/messages/where_expected_closing_bracket.cr b/src/messages/where_expected_closing_bracket.cr deleted file mode 100644 index b166fc19f..000000000 --- a/src/messages/where_expected_closing_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message WhereExpectedClosingBracket do - title "Syntax Error" - - closing_bracket "where", got - - snippet node -end diff --git a/src/messages/where_expected_equal_sign.cr b/src/messages/where_expected_equal_sign.cr deleted file mode 100644 index f537db825..000000000 --- a/src/messages/where_expected_equal_sign.cr +++ /dev/null @@ -1,13 +0,0 @@ -message WhereExpectedEqualSign do - title "Syntax Error" - - block do - text "A where statement must have an" - bold "equal sign" - text "before the expression." - end - - was_looking_for "equal sign", got, "=" - - snippet node -end diff --git a/src/messages/where_expected_expression.cr b/src/messages/where_expected_expression.cr deleted file mode 100644 index a7218c11a..000000000 --- a/src/messages/where_expected_expression.cr +++ /dev/null @@ -1,13 +0,0 @@ -message WhereExpectedExpression do - title "Syntax Error" - - block do - text "A where statement must have an" - bold "expression" - text "after the equal sign." - end - - was_looking_for "expression", got - - snippet node -end diff --git a/src/messages/where_expected_opening_bracket.cr b/src/messages/where_expected_opening_bracket.cr deleted file mode 100644 index 2e18b4438..000000000 --- a/src/messages/where_expected_opening_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message WhereExpectedOpeningBracket do - title "Syntax Error" - - opening_bracket "where", got - - snippet node -end diff --git a/src/messages/where_expected_where.cr b/src/messages/where_expected_where.cr deleted file mode 100644 index 1d1a2ae10..000000000 --- a/src/messages/where_expected_where.cr +++ /dev/null @@ -1,11 +0,0 @@ -message WhereExpectedWhere do - title "Syntax Error" - - block do - text "A where block must have at least one statement." - end - - was_looking_for "statement", got - - snippet node -end diff --git a/src/parsers/function.cr b/src/parsers/function.cr index f0461ffff..40f23dfa2 100644 --- a/src/parsers/function.cr +++ b/src/parsers/function.cr @@ -1,10 +1,7 @@ module Mint class Parser syntax_error FunctionExpectedClosingParentheses - syntax_error FunctionExpectedOpeningBracket - syntax_error FunctionExpectedClosingBracket syntax_error FunctionExpectedTypeOrVariable - syntax_error FunctionExpectedExpression syntax_error FunctionExpectedName def function : Ast::Function? @@ -44,26 +41,17 @@ module Mint body = code_block - # head_comments, body, tail_comments = block_with_comments( - # opening_bracket: FunctionExpectedOpeningBracket, - # closing_bracket: FunctionExpectedClosingBracket - # ) do - # expression! FunctionExpectedExpression - # end - - end_position = position + end_position = + position whitespace self << Ast::Function.new( - head_comments: [] of Ast::Comment, - tail_comments: [] of Ast::Comment, body: body.as(Ast::Expression), arguments: arguments, from: start_position, comment: comment, to: end_position, - where: where, input: data, name: name, type: type) diff --git a/src/parsers/get.cr b/src/parsers/get.cr index 9ff3118f8..2b8453540 100644 --- a/src/parsers/get.cr +++ b/src/parsers/get.cr @@ -40,7 +40,6 @@ module Mint from: start_position, comment: comment, to: position, - where: where, input: data, name: name, body: body, diff --git a/src/parsers/where.cr b/src/parsers/where.cr deleted file mode 100644 index b684fe076..000000000 --- a/src/parsers/where.cr +++ /dev/null @@ -1,43 +0,0 @@ -module Mint - class Parser - syntax_error WhereExpectedOpeningBracket - syntax_error WhereExpectedClosingBracket - syntax_error WhereExpectedWhere - - def where : Ast::Where? - start do |start_position| - next unless keyword "where" - - body = block( - opening_bracket: WhereExpectedOpeningBracket, - closing_bracket: WhereExpectedClosingBracket - ) do - items = many { where_statement || comment } - - raise WhereExpectedWhere if items.none?(Ast::WhereStatement) - - items - end - - statements = [] of Ast::WhereStatement - comments = [] of Ast::Comment - - body.each do |item| - case item - when Ast::WhereStatement - statements << item - when Ast::Comment - comments << item - end - end - - self << Ast::Where.new( - statements: statements, - from: start_position, - comments: comments, - to: position, - input: data) - end - end - end -end diff --git a/src/parsers/where_statement.cr b/src/parsers/where_statement.cr deleted file mode 100644 index 9dce1c09a..000000000 --- a/src/parsers/where_statement.cr +++ /dev/null @@ -1,26 +0,0 @@ -module Mint - class Parser - syntax_error WhereExpectedExpression - syntax_error WhereExpectedEqualSign - - def where_statement : Ast::WhereStatement? - start do |start_position| - target = variable || tuple_destructuring - next unless target - whitespace - - char '=', WhereExpectedEqualSign - whitespace - - expression = expression! WhereExpectedExpression - - self << Ast::WhereStatement.new( - expression: expression, - from: start_position, - target: target, - to: position, - input: data) - end - end - end -end diff --git a/src/type_checker.cr b/src/type_checker.cr index 1db2ae64f..d3b0a1f46 100644 --- a/src/type_checker.cr +++ b/src/type_checker.cr @@ -244,7 +244,7 @@ module Mint NEVER when Ast::Function, Ast::InlineFunction static_type_signature(node) - when Ast::WhereStatement, Ast::Statement + when Ast::Statement expression = node.expression diff --git a/src/type_checker/scope.cr b/src/type_checker/scope.cr index 5100fd019..8778de68c 100644 --- a/src/type_checker/scope.cr +++ b/src/type_checker/scope.cr @@ -2,7 +2,6 @@ module Mint class TypeChecker class Scope alias Node = Tuple(String, Checkable, Ast::Node) | - Ast::WhereStatement | Ast::Statement | Ast::Component | Ast::InlineFunction | @@ -117,15 +116,6 @@ module Mint end end - def find(variable : String, node : Ast::WhereStatement) - case target = node.target - when Ast::Variable - node if target.value == variable - when Ast::TupleDestructuring - _find(variable, target).try { |result| {node, result} } - end - end - def _find(variable : String, node : Ast::TupleDestructuring) : Array(Int32)? node.parameters.each_with_index do |param, idx| case param diff --git a/src/type_checkers/function.cr b/src/type_checkers/function.cr index 9b28351cc..0e44ccd2b 100644 --- a/src/type_checkers/function.cr +++ b/src/type_checkers/function.cr @@ -19,52 +19,48 @@ module Mint def check(node : Ast::Function) : Checkable scope node do - scope node.where.try(&.statements) || [] of Ast::WhereStatement do - node.arguments.each do |argument| - name = - argument.name.value - - other = - (node.arguments - [argument]).find(&.name.value.==(name)) - - raise FunctionArgumentConflict, { - "node" => argument, - "other" => other, - "name" => name, - } if other - end - - node.where.try { |item| resolve item } + node.arguments.each do |argument| + name = + argument.name.value + + other = + (node.arguments - [argument]).find(&.name.value.==(name)) + + raise FunctionArgumentConflict, { + "node" => argument, + "other" => other, + "name" => name, + } if other + end - arguments = - resolve node.arguments + arguments = + resolve node.arguments - body_type = - resolve node.body + body_type = + resolve node.body - final_type = - Type.new("Function", arguments + [body_type]) + final_type = + Type.new("Function", arguments + [body_type]) - if type = node.type - return_type = - resolve type + if type = node.type + return_type = + resolve type - defined_type = - Comparer.normalize(Type.new("Function", arguments + [return_type])) + defined_type = + Comparer.normalize(Type.new("Function", arguments + [return_type])) - resolved = - Comparer.compare(defined_type, final_type) + resolved = + Comparer.compare(defined_type, final_type) - raise FunctionTypeMismatch, { - "expected" => return_type, - "got" => body_type, - "node" => node, - } unless resolved + raise FunctionTypeMismatch, { + "expected" => return_type, + "got" => body_type, + "node" => node, + } unless resolved - resolved - else - Comparer.normalize(final_type) - end + resolved + else + Comparer.normalize(final_type) end end end diff --git a/src/type_checkers/get.cr b/src/type_checkers/get.cr index 842310f6e..78a445e08 100644 --- a/src/type_checkers/get.cr +++ b/src/type_checkers/get.cr @@ -7,29 +7,25 @@ module Mint end def check(node : Ast::Get) : Checkable - scope node.where.try(&.statements) || [] of Ast::WhereStatement do - body_type = - resolve node.body + body_type = + resolve node.body - if type = node.type - return_type = - resolve type + if type = node.type + return_type = + resolve type - node.where.try { |item| resolve item } + resolved = + Comparer.compare(body_type, return_type) - resolved = - Comparer.compare(body_type, return_type) + raise GetTypeMismatch, { + "expected" => return_type, + "got" => body_type, + "node" => node, + } unless resolved - raise GetTypeMismatch, { - "expected" => return_type, - "got" => body_type, - "node" => node, - } unless resolved - - resolved - else - body_type - end + resolved + else + body_type end end end diff --git a/src/type_checkers/statement.cr b/src/type_checkers/statement.cr index f6525e6ef..b8c84308f 100644 --- a/src/type_checkers/statement.cr +++ b/src/type_checkers/statement.cr @@ -3,7 +3,7 @@ module Mint type_error StatementTupleMismatch type_error StatementNotTuple - def check(node : Ast::Statement | Ast::WhereStatement) : Checkable + def check(node : Ast::Statement) : Checkable type = resolve node.expression _check_statement_target(node.target, node, type) diff --git a/src/type_checkers/variable.cr b/src/type_checkers/variable.cr index 759ff1965..81059ad8a 100644 --- a/src/type_checkers/variable.cr +++ b/src/type_checkers/variable.cr @@ -54,7 +54,7 @@ module Mint resolve item case item - when Ast::Statement, Ast::WhereStatement + when Ast::Statement case item.target when Ast::TupleDestructuring case val = value[1] diff --git a/src/type_checkers/where.cr b/src/type_checkers/where.cr deleted file mode 100644 index 3a06ec6e4..000000000 --- a/src/type_checkers/where.cr +++ /dev/null @@ -1,9 +0,0 @@ -module Mint - class TypeChecker - def check(node : Ast::Where) : Checkable - check node.statements - - NEVER - end - end -end From 99fd37bc79b4de0bf53f53e1b5606e27598e74a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Tue, 5 Oct 2021 13:00:30 +0200 Subject: [PATCH 05/20] Rmove with language feature. --- core/source/Test/Context.mint | 40 ++++------- core/tests/tests/Dom.mint | 18 ++--- core/tests/tests/File.mint | 16 ++--- core/tests/tests/Html/Portals/Body.mint | 58 +++++++-------- core/tests/tests/Http.mint | 68 +++++++----------- core/tests/tests/Object/Encode.mint | 14 ++-- core/tests/tests/Promise.mint | 48 ++++++------- core/tests/tests/Provider/AnimationFrame.mint | 12 ++-- core/tests/tests/Provider/Mouse.mint | 36 ++++------ core/tests/tests/Provider/Scroll.mint | 14 ++-- core/tests/tests/Provider/Tick.mint | 14 ++-- core/tests/tests/Timer.mint | 58 +++++++-------- core/tests/tests/Window.mint | 72 +++++++------------ spec/compilers/with | 27 ------- spec/formatters/with | 25 ------- spec/formatters/with_with_comments | 28 -------- spec/parsers/with_spec.cr | 21 ------ spec/type_checking/with | 29 -------- src/ast.cr | 1 - src/ast/with.cr | 16 ----- src/compilers/with.cr | 7 -- src/formatters/with.cr | 10 --- src/messages/with_expected_closing_bracket.cr | 7 -- src/messages/with_expected_expression.cr | 12 ---- src/messages/with_expected_module.cr | 13 ---- src/messages/with_expected_opening_bracket.cr | 7 -- src/messages/with_not_found_module.cr | 11 --- src/parsers/basic_expression.cr | 1 - src/parsers/html_body.cr | 1 - src/parsers/with.cr | 34 --------- src/type_checker.cr | 1 - src/type_checkers/with.cr | 21 ------ 32 files changed, 186 insertions(+), 554 deletions(-) delete mode 100644 spec/compilers/with delete mode 100644 spec/formatters/with delete mode 100644 spec/formatters/with_with_comments delete mode 100644 spec/parsers/with_spec.cr delete mode 100644 spec/type_checking/with delete mode 100644 src/ast/with.cr delete mode 100644 src/compilers/with.cr delete mode 100644 src/formatters/with.cr delete mode 100644 src/messages/with_expected_closing_bracket.cr delete mode 100644 src/messages/with_expected_expression.cr delete mode 100644 src/messages/with_expected_module.cr delete mode 100644 src/messages/with_expected_opening_bracket.cr delete mode 100644 src/messages/with_not_found_module.cr delete mode 100644 src/parsers/with.cr delete mode 100644 src/type_checkers/with.cr diff --git a/core/source/Test/Context.mint b/core/source/Test/Context.mint index 259734301..c52730727 100644 --- a/core/source/Test/Context.mint +++ b/core/source/Test/Context.mint @@ -4,10 +4,8 @@ module Test.Context { Starts a test using the given value. test { - with Test.Context { - of(5) - |> assertEqual(5) - } + Test.Context.of(5) + |> Test.Context.assertEqual(5) } */ fun of (a : a) : Test.Context(a) { @@ -18,11 +16,9 @@ module Test.Context { Adds a transformation step to the test. test { - with Test.Context { - of(5) - |> then((number : Number) { Promise.resolve(number + 2) }) - |> assertEqual(7) - } + Test.Context.of(5) + |> Test.Context.then((number : Number) { Promise.resolve(number + 2) }) + |> Test.Context.assertEqual(7) } */ fun then ( @@ -40,11 +36,9 @@ module Test.Context { Adds a timeout to the test using the given duration (in milliseconds). test { - with Test.Context { - of(5) - |> timeout(1000) - |> assertEqual(5) - } + Test.Context.of(5) + |> Test.Context.timeout(1000) + |> Test.Context.assertEqual(5) } */ fun timeout (duration : Number, context : Test.Context(a)) : Test.Context(a) { @@ -56,10 +50,8 @@ module Test.Context { Asserts the equality of the current value of the test with the given one. test { - with Test.Context { - of(5) - |> assertEqual(5) - } + Test.Context.of(5) + |> Test.Context.assertEqual(5) } */ fun assertEqual (value : a, context : Test.Context(a)) : Test.Context(a) { @@ -77,9 +69,9 @@ module Test.Context { Asserts if the given value equals of the returned value from the given function. - with Test.Context { - of(5) - |> assertOf("5", Number.toString) + test { + Test.Context.of(5) + |> Test.Context.assertOf("5", Number.toString) } */ fun assertOf ( @@ -103,10 +95,8 @@ module Test.Context { Maps the given subject to a new subject. test { - with Test.Context { - of(5) - |> map(Number.toString) - } + Test.Context.of(5) + |> Test.Context.map(Number.toString) } */ fun map (method : Function(a, b), context : Test.Context(a)) : Test.Context(b) { diff --git a/core/tests/tests/Dom.mint b/core/tests/tests/Dom.mint index c36555216..72f61e3f4 100644 --- a/core/tests/tests/Dom.mint +++ b/core/tests/tests/Dom.mint @@ -146,16 +146,12 @@ component Test.Dom.Focus { suite "Dom.focusWhenVisible" { test "it waits for the element to be visible" { - with Test.Html { - with Test.Context { - - |> start() - |> triggerClick("#focus") - |> triggerClick("#show") - |> timeout(200) - |> assertCssOf("#input", "display", "inline-block") - |> assertActiveElement("#input") - } - } + + |> Test.Html.start() + |> Test.Html.triggerClick("#focus") + |> Test.Html.triggerClick("#show") + |> Test.Context.timeout(200) + |> Test.Html.assertCssOf("#input", "display", "inline-block") + |> Test.Html.assertActiveElement("#input") } } diff --git a/core/tests/tests/File.mint b/core/tests/tests/File.mint index 6eafd5bd0..b5fd8e648 100644 --- a/core/tests/tests/File.mint +++ b/core/tests/tests/File.mint @@ -1,20 +1,16 @@ suite "File.readAsString" { test "it reads it as string" { - with Test.Context { - of(File.fromString("content", "test.txt", "text/plain")) - |> then(File.readAsString) - |> assertEqual("content") - } + Test.Context.of(File.fromString("content", "test.txt", "text/plain")) + |> Test.Context.then(File.readAsString) + |> Test.Context.assertEqual("content") } } suite "File.readAsDataURL" { test "it reads it as data url" { - with Test.Context { - of(File.fromString("content", "test.txt", "text/plain")) - |> then(File.readAsDataURL) - |> assertEqual("data:text/plain;base64,Y29udGVudA==") - } + Test.Context.of(File.fromString("content", "test.txt", "text/plain")) + |> Test.Context.then(File.readAsDataURL) + |> Test.Context.assertEqual("data:text/plain;base64,Y29udGVudA==") } } diff --git a/core/tests/tests/Html/Portals/Body.mint b/core/tests/tests/Html/Portals/Body.mint index d8b18e78a..5a1cac988 100644 --- a/core/tests/tests/Html/Portals/Body.mint +++ b/core/tests/tests/Html/Portals/Body.mint @@ -1,40 +1,32 @@ suite "Html.Portals.Body" { test "renders single children into the body" { - with Test.Html { - with Test.Context { - - - - |> start() - |> then( - (subject : Dom.Element) : Promise(a, Bool) { - Dom.getElementBySelector("body > portal-body") - |> Maybe.map((element : Dom.Element) : Bool { true }) - |> Maybe.withDefault(false) - |> Promise.resolve() - }) - |> assertEqual(true) - } - } + + + + |> Test.Html.start() + |> Test.Context.then( + (subject : Dom.Element) : Promise(a, Bool) { + Dom.getElementBySelector("body > portal-body") + |> Maybe.map((element : Dom.Element) : Bool { true }) + |> Maybe.withDefault(false) + |> Promise.resolve() + }) + |> Test.Context.assertEqual(true) } test "renders multiple children into the body" { - with Test.Html { - with Test.Context { - - - - - |> start() - |> then( - (subject : Dom.Element) : Promise(a, Bool) { - Dom.getElementBySelector("body > portal-body2") - |> Maybe.map((element : Dom.Element) : Bool { true }) - |> Maybe.withDefault(false) - |> Promise.resolve() - }) - |> assertEqual(true) - } - } + + + + + |> Test.Html.start() + |> Test.Context.then( + (subject : Dom.Element) : Promise(a, Bool) { + Dom.getElementBySelector("body > portal-body2") + |> Maybe.map((element : Dom.Element) : Bool { true }) + |> Maybe.withDefault(false) + |> Promise.resolve() + }) + |> Test.Context.assertEqual(true) } } diff --git a/core/tests/tests/Http.mint b/core/tests/tests/Http.mint index b55201bb6..7c5333846 100644 --- a/core/tests/tests/Http.mint +++ b/core/tests/tests/Http.mint @@ -340,63 +340,43 @@ component Test.Http { suite "Successful request" { test "it loads" { - with Test.Context { - with Test.Html { - - |> start() - |> timeout(50) - |> assertTextOf("error", "") - |> assertTextOf("status", "200") - } - } + + |> Test.Html.start() + |> Test.Context.timeout(50) + |> Test.Html.assertTextOf("error", "") + |> Test.Html.assertTextOf("status", "200") } } suite "Http.Error" { test "BadUrl" { - with Test.Context { - with Test.Html { - - |> start() - |> timeout(50) - |> assertTextOf("error", "bad-url") - |> assertTextOf("status", "0") - } - } + + |> Test.Html.start() + |> Test.Context.timeout(50) + |> Test.Html.assertTextOf("error", "bad-url") + |> Test.Html.assertTextOf("status", "0") } test "NetWorkError" { - with Test.Context { - with Test.Html { - - |> start() - |> assertTextOf("error", "network-error") - |> assertTextOf("status", "0") - } - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("error", "network-error") + |> Test.Html.assertTextOf("status", "0") } test "Timeout" { - with Test.Context { - with Test.Html { - - |> start() - |> timeout(50) - |> assertTextOf("error", "timeout") - |> assertTextOf("status", "0") - } - } + + |> Test.Html.start() + |> Test.Context.timeout(50) + |> Test.Html.assertTextOf("error", "timeout") + |> Test.Html.assertTextOf("status", "0") } test "Aborted" { - with Test.Context { - with Test.Html { - - |> start() - |> timeout(50) - |> assertTextOf("error", "aborted") - |> assertTextOf("status", "0") - } - } + + |> Test.Html.start() + |> Test.Context.timeout(50) + |> Test.Html.assertTextOf("error", "aborted") + |> Test.Html.assertTextOf("status", "0") } } diff --git a/core/tests/tests/Object/Encode.mint b/core/tests/tests/Object/Encode.mint index a1da70657..d2ba6c5c1 100644 --- a/core/tests/tests/Object/Encode.mint +++ b/core/tests/tests/Object/Encode.mint @@ -35,16 +35,14 @@ suite "Object.Encode.field" { suite "Object.Encode.object" { test "encodes an array of fields to an object" { - with Object.Encode { - try { - encodedField = - field("test", `"a"`) + try { + encodedField = + Object.Encode.field("test", `"a"`) - encodedObject = - object([encodedField]) + encodedObject = + Object.Encode.object([encodedField]) - `#{encodedObject}.test == "a"` - } + `#{encodedObject}.test == "a"` } } } diff --git a/core/tests/tests/Promise.mint b/core/tests/tests/Promise.mint index 021f51b4d..cdc3ebde1 100644 --- a/core/tests/tests/Promise.mint +++ b/core/tests/tests/Promise.mint @@ -76,46 +76,38 @@ component Test.Promise2 { suite "Promise.create" { test "resolve resolves a promise" { - with Test.Html { - - |> start() - |> assertTextOf("result", "") - |> triggerClick("resolve") - |> assertTextOf("result", "resolved") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("result", "") + |> Test.Html.triggerClick("resolve") + |> Test.Html.assertTextOf("result", "resolved") } test "reject rejects a promise" { - with Test.Html { - - |> start() - |> assertTextOf("result", "") - |> triggerClick("reject") - |> assertTextOf("result", "rejected") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("result", "") + |> Test.Html.triggerClick("reject") + |> Test.Html.assertTextOf("result", "rejected") } } suite "Promise.resolve" { test "resolves a promise" { - with Test.Html { - - |> start() - |> assertTextOf("result", "") - |> triggerClick("resolve") - |> assertTextOf("result", "resolved") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("result", "") + |> Test.Html.triggerClick("resolve") + |> Test.Html.assertTextOf("result", "resolved") } } suite "Promise.reject" { test "rejects a promise" { - with Test.Html { - - |> start() - |> assertTextOf("result", "") - |> triggerClick("reject") - |> assertTextOf("result", "rejected") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("result", "") + |> Test.Html.triggerClick("reject") + |> Test.Html.assertTextOf("result", "rejected") } } diff --git a/core/tests/tests/Provider/AnimationFrame.mint b/core/tests/tests/Provider/AnimationFrame.mint index ed29922f1..5adc72e41 100644 --- a/core/tests/tests/Provider/AnimationFrame.mint +++ b/core/tests/tests/Provider/AnimationFrame.mint @@ -21,12 +21,10 @@ component Test.Provider.AnimationFrame { suite "Provider.AnimationFrame.frames" { test "called on an animation frame" { - with Test.Html { - - |> start() - |> assertTextOf("div", "1") - |> assertTextOf("div", "2") - |> assertTextOf("div", "3") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("div", "1") + |> Test.Html.assertTextOf("div", "2") + |> Test.Html.assertTextOf("div", "3") } } diff --git a/core/tests/tests/Provider/Mouse.mint b/core/tests/tests/Provider/Mouse.mint index a264b8b95..015d6ca76 100644 --- a/core/tests/tests/Provider/Mouse.mint +++ b/core/tests/tests/Provider/Mouse.mint @@ -28,36 +28,30 @@ component Test.Provider.Mouse { suite "Provider.Mouse.clicks" { test "calls clicks on click" { - with Test.Html { - - |> start() - |> assertTextOf("clicks", "0") - |> triggerClick("clicks") - |> assertTextOf("clicks", "1") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("clicks", "0") + |> Test.Html.triggerClick("clicks") + |> Test.Html.assertTextOf("clicks", "1") } } suite "Provider.Mouse.moves" { test "calls moves on mouse move" { - with Test.Html { - - |> start() - |> assertTextOf("moves", "0") - |> triggerMouseMove("moves") - |> assertTextOf("moves", "1") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("moves", "0") + |> Test.Html.triggerMouseMove("moves") + |> Test.Html.assertTextOf("moves", "1") } } suite "Provider.Mouse.ups" { test "calls ups on mouse up" { - with Test.Html { - - |> start() - |> assertTextOf("ups", "0") - |> triggerMouseUp("ups") - |> assertTextOf("ups", "1") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("ups", "0") + |> Test.Html.triggerMouseUp("ups") + |> Test.Html.assertTextOf("ups", "1") } } diff --git a/core/tests/tests/Provider/Scroll.mint b/core/tests/tests/Provider/Scroll.mint index 6f629be0c..88463bb09 100644 --- a/core/tests/tests/Provider/Scroll.mint +++ b/core/tests/tests/Provider/Scroll.mint @@ -17,14 +17,10 @@ component Test.Provider.Scroll { suite "Provider.Scroll.scrolls" { test "it notifies subscribers about scroll events" { - with Test.Html { - with Test.Window { - - |> start() - |> assertTextOf("div", "0") - |> setScrollTop(100) - |> assertTextOf("div", "100") - } - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("div", "0") + |> Test.Window.setScrollTop(100) + |> Test.Html.assertTextOf("div", "100") } } diff --git a/core/tests/tests/Provider/Tick.mint b/core/tests/tests/Provider/Tick.mint index ee254a459..791da0076 100644 --- a/core/tests/tests/Provider/Tick.mint +++ b/core/tests/tests/Provider/Tick.mint @@ -12,14 +12,10 @@ component Test.Provider.Tick { suite "Provider.Tick.ticks" { test "called every second" { - with Test.Html { - with Test.Context { - - |> start() - |> assertTextOf("div", "0") - |> timeout(1010) - |> assertTextOf("div", "1") - } - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("div", "0") + |> Test.Context.timeout(1010) + |> Test.Html.assertTextOf("div", "1") } } diff --git a/core/tests/tests/Timer.mint b/core/tests/tests/Timer.mint index 418fc7d42..922da39aa 100644 --- a/core/tests/tests/Timer.mint +++ b/core/tests/tests/Timer.mint @@ -1,40 +1,36 @@ suite "Timer.timeout" { test "resolves after a time" { - with Test.Context { - of("TEST") - |> timeout(1) - |> then( - (subject : String) : Promise(a, String) { - subject - |> String.toLowerCase() - |> Promise.resolve() - }) - |> then( - (subject : String) : Promise(a, Bool) { - subject == "test" - |> Promise.resolve() - }) - } + Test.Context.of("TEST") + |> Test.Context.timeout(1) + |> Test.Context.then( + (subject : String) : Promise(a, String) { + subject + |> String.toLowerCase() + |> Promise.resolve() + }) + |> Test.Context.then( + (subject : String) : Promise(a, Bool) { + subject == "test" + |> Promise.resolve() + }) } } suite "Timer.nextFrame" { test "resolves after the next frame" { - with Test.Context { - of("TEST") - |> then( - (subject : String) : Promise(a, String) { Timer.nextFrame(subject) }) - |> then( - (subject : String) : Promise(a, String) { - subject - |> String.toLowerCase() - |> Promise.resolve() - }) - |> then( - (subject : String) : Promise(a, Bool) { - subject == "test" - |> Promise.resolve() - }) - } + Test.Context.of("TEST") + |> Test.Context.then( + (subject : String) : Promise(a, String) { Timer.nextFrame(subject) }) + |> Test.Context.then( + (subject : String) : Promise(a, String) { + subject + |> String.toLowerCase() + |> Promise.resolve() + }) + |> Test.Context.then( + (subject : String) : Promise(a, Bool) { + subject == "test" + |> Promise.resolve() + }) } } diff --git a/core/tests/tests/Window.mint b/core/tests/tests/Window.mint index 952b0f593..1929529b9 100644 --- a/core/tests/tests/Window.mint +++ b/core/tests/tests/Window.mint @@ -100,13 +100,11 @@ suite "Window.scrollWidth" { } test "returns the scrollable width when overflown" { - with Test.Html { - - |> start() - |> Test.Context.then( - (subject : Dom.Element) : Promise(Never, Dom.Element) { Timer.nextFrame(subject) }) - |> assertTextOf("scroll-width", "3008") - } + + |> Test.Html.start() + |> Test.Context.then( + (subject : Dom.Element) : Promise(Never, Dom.Element) { Timer.nextFrame(subject) }) + |> Test.Html.assertTextOf("scroll-width", "3008") } } @@ -116,11 +114,9 @@ suite "Window.scrollHeight" { } test "returns the scrollable height when overflown" { - with Test.Html { - - |> start() - |> assertTextOf("scroll-height", "3016") - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("scroll-height", "3016") } } @@ -130,14 +126,10 @@ suite "Window.scrollLeft" { } test "returns the left scroll position when scrolled" { - with Test.Html { - with Test.Window { - - |> start() - |> setScrollLeft(100) - |> assertTextOf("scroll-left", "100") - } - } + + |> Test.Html.start() + |> Test.Window.setScrollLeft(100) + |> Test.Html.assertTextOf("scroll-left", "100") } } @@ -147,41 +139,29 @@ suite "Window.scrollTop" { } test "returns the left scroll position when scrolled" { - with Test.Html { - with Test.Window { - - |> start() - |> setScrollTop(100) - |> assertTextOf("scroll-top", "100") - } - } + + |> Test.Html.start() + |> Test.Window.setScrollTop(100) + |> Test.Html.assertTextOf("scroll-top", "100") } } suite "Window.setScrollLeft" { test "sets the left scroll position" { - with Test.Html { - with Test.Window { - - |> start() - |> assertTextOf("scroll-left", "0") - |> setScrollLeft(100) - |> assertTextOf("scroll-left", "100") - } - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("scroll-left", "0") + |> Test.Window.setScrollLeft(100) + |> Test.Html.assertTextOf("scroll-left", "100") } } suite "Window.setScrollTop" { test "sets the top scroll position" { - with Test.Html { - with Test.Window { - - |> start() - |> assertTextOf("scroll-top", "0") - |> setScrollTop(100) - |> assertTextOf("scroll-top", "100") - } - } + + |> Test.Html.start() + |> Test.Html.assertTextOf("scroll-top", "0") + |> Test.Window.setScrollTop(100) + |> Test.Html.assertTextOf("scroll-top", "100") } } diff --git a/spec/compilers/with b/spec/compilers/with deleted file mode 100644 index d732b93b1..000000000 --- a/spec/compilers/with +++ /dev/null @@ -1,27 +0,0 @@ -module SomeModule { - fun someFunction : String { - "" - } -} - -component Main { - fun render : String { - with SomeModule { - someFunction() - } - } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - a() { - return ``; - } -}); - -class A extends _C { - render() { - return B.a(); - } -}; - -A.displayName = "Main"; diff --git a/spec/formatters/with b/spec/formatters/with deleted file mode 100644 index 55517f16d..000000000 --- a/spec/formatters/with +++ /dev/null @@ -1,25 +0,0 @@ -module X { - fun a : Void { - void - } -} - -module Test { - fun test : Void { - with X{void} - } -} --------------------------------------------------------------------------------- -module X { - fun a : Void { - void - } -} - -module Test { - fun test : Void { - with X { - void - } - } -} diff --git a/spec/formatters/with_with_comments b/spec/formatters/with_with_comments deleted file mode 100644 index 75124a0c8..000000000 --- a/spec/formatters/with_with_comments +++ /dev/null @@ -1,28 +0,0 @@ -module X { - fun a : Void { - void - } -} - -module Test { - fun test : Void { - with X{/*A*/void/*B*/} - } -} --------------------------------------------------------------------------------- -module X { - fun a : Void { - void - } -} - -module Test { - fun test : Void { - with X { - /* A */ - void - - /* B */ - } - } -} diff --git a/spec/parsers/with_spec.cr b/spec/parsers/with_spec.cr deleted file mode 100644 index c6a5d63d5..000000000 --- a/spec/parsers/with_spec.cr +++ /dev/null @@ -1,21 +0,0 @@ -require "../spec_helper" - -describe "With" do - subject with_expression - - expect_ignore "" - expect_ignore ".." - expect_ignore "a" - expect_ignore "asdasd" - expect_ignore "withA" - - expect_error "with ", Mint::Parser::WithExpectedModule - expect_error "with A", Mint::Parser::WithExpectedOpeningBracket - expect_error "with A ", Mint::Parser::WithExpectedOpeningBracket - expect_error "with A {", Mint::Parser::WithExpectedExpression - expect_error "with A { ", Mint::Parser::WithExpectedExpression - expect_error "with A { void", Mint::Parser::WithExpectedClosingBracket - expect_error "with A { void ", Mint::Parser::WithExpectedClosingBracket - - expect_ok "with A { void }" -end diff --git a/spec/type_checking/with b/spec/type_checking/with deleted file mode 100644 index f3ab99a73..000000000 --- a/spec/type_checking/with +++ /dev/null @@ -1,29 +0,0 @@ -module X { - fun a : Void { - void - } -} - -component Main { - fun test : Void { - with X { - a() - } - } - - fun render : String { - "" - } -} ---------------------------------------------------------------WithNotFoundModule -component Main { - fun test : Void { - with XXX { - void - } - } - - fun render : String { - "" - } -} diff --git a/src/ast.cr b/src/ast.cr index b1f9d0058..d84fe0404 100644 --- a/src/ast.cr +++ b/src/ast.cr @@ -26,7 +26,6 @@ module Mint Record | Access | Route | - With | Void | Case | Try | diff --git a/src/ast/with.cr b/src/ast/with.cr deleted file mode 100644 index 92a448a7a..000000000 --- a/src/ast/with.cr +++ /dev/null @@ -1,16 +0,0 @@ -module Mint - class Ast - class With < Node - getter body, name, head_comments, tail_comments - - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @body : Expression, - @name : String, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/compilers/with.cr b/src/compilers/with.cr deleted file mode 100644 index bb04176a9..000000000 --- a/src/compilers/with.cr +++ /dev/null @@ -1,7 +0,0 @@ -module Mint - class Compiler - def _compile(node : Ast::With) : String - compile node.body - end - end -end diff --git a/src/formatters/with.cr b/src/formatters/with.cr deleted file mode 100644 index c739f6631..000000000 --- a/src/formatters/with.cr +++ /dev/null @@ -1,10 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::With) : String - body = - list [node.body] + node.head_comments + node.tail_comments - - "with #{node.name} {\n#{indent(body)}\n}" - end - end -end diff --git a/src/messages/with_expected_closing_bracket.cr b/src/messages/with_expected_closing_bracket.cr deleted file mode 100644 index 7dc2aed3c..000000000 --- a/src/messages/with_expected_closing_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message WithExpectedClosingBracket do - title "Syntax Error" - - closing_bracket "with expression", got - - snippet node -end diff --git a/src/messages/with_expected_expression.cr b/src/messages/with_expected_expression.cr deleted file mode 100644 index 5fa9ad198..000000000 --- a/src/messages/with_expected_expression.cr +++ /dev/null @@ -1,12 +0,0 @@ -message WithExpectedExpression do - title "Syntax Error" - - block do - text "The body of a with expression must be a single" - bold "expression." - end - - was_looking_for "expression", got - - snippet node -end diff --git a/src/messages/with_expected_module.cr b/src/messages/with_expected_module.cr deleted file mode 100644 index 599a66f17..000000000 --- a/src/messages/with_expected_module.cr +++ /dev/null @@ -1,13 +0,0 @@ -message WithExpectedModule do - title "Syntax Error" - - block do - text "I was looking for" - bold "name of a module" - text "for a with expression but found" - code got - text "instead." - end - - snippet node -end diff --git a/src/messages/with_expected_opening_bracket.cr b/src/messages/with_expected_opening_bracket.cr deleted file mode 100644 index 950bd7e7a..000000000 --- a/src/messages/with_expected_opening_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message WithExpectedOpeningBracket do - title "Syntax Error" - - opening_bracket "with expression", got - - snippet node -end diff --git a/src/messages/with_not_found_module.cr b/src/messages/with_not_found_module.cr deleted file mode 100644 index 0c5924699..000000000 --- a/src/messages/with_not_found_module.cr +++ /dev/null @@ -1,11 +0,0 @@ -message WithNotFoundModule do - title "Type Error" - - block do - text "I was look for the module named:" - bold name - text "for a with expression but could not find it." - end - - snippet node -end diff --git a/src/parsers/basic_expression.cr b/src/parsers/basic_expression.cr index 196406707..97819b969 100644 --- a/src/parsers/basic_expression.cr +++ b/src/parsers/basic_expression.cr @@ -27,7 +27,6 @@ module Mint encode || if_expression || for_expression || - with_expression || next_call || sequence || parallel || diff --git a/src/parsers/html_body.cr b/src/parsers/html_body.cr index 068c7a85d..4fce0fb1b 100644 --- a/src/parsers/html_body.cr +++ b/src/parsers/html_body.cr @@ -10,7 +10,6 @@ module Mint array || if_expression(for_html: true) || for_expression || - with_expression || try_expression || case_expression || comment diff --git a/src/parsers/with.cr b/src/parsers/with.cr deleted file mode 100644 index 9b05d700d..000000000 --- a/src/parsers/with.cr +++ /dev/null @@ -1,34 +0,0 @@ -module Mint - class Parser - syntax_error WithExpectedOpeningBracket - syntax_error WithExpectedClosingBracket - syntax_error WithExpectedExpression - syntax_error WithExpectedModule - - def with_expression : Ast::With? - start do |start_position| - next unless keyword "with" - next unless whitespace? - whitespace - - name = type_id! WithExpectedModule - - head_comments, body, tail_comments = block_with_comments( - opening_bracket: WithExpectedOpeningBracket, - closing_bracket: WithExpectedClosingBracket - ) do - expression! WithExpectedExpression - end - - self << Ast::With.new( - body: body.as(Ast::Expression), - head_comments: head_comments, - tail_comments: tail_comments, - from: start_position, - to: position, - input: data, - name: name) - end - end - end -end diff --git a/src/type_checker.cr b/src/type_checker.cr index d3b0a1f46..6f6b3c66d 100644 --- a/src/type_checker.cr +++ b/src/type_checker.cr @@ -68,7 +68,6 @@ module Mint x = case i when Ast::Component then i.name when Ast::Function then i.name.value - when Ast::With then "" when Ast::Try then "" when Ast::Call then "" else diff --git a/src/type_checkers/with.cr b/src/type_checkers/with.cr deleted file mode 100644 index e2f2bc212..000000000 --- a/src/type_checkers/with.cr +++ /dev/null @@ -1,21 +0,0 @@ -module Mint - class TypeChecker - type_error WithNotFoundModule - - def check(node : Ast::With) : Checkable - entity = - ast.unified_modules.find(&.name.==(node.name)) - - raise WithNotFoundModule, { - "name" => node.name, - "node" => node, - } unless entity - - check! entity - - scope.push entity do - resolve node.body - end - end - end -end From 0c7665a6d45e2aa9acd28bdf69564c8ea144d7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Tue, 5 Oct 2021 13:11:44 +0200 Subject: [PATCH 06/20] Use blocks in linline function as well. --- spec/parsers/inline_function_spec.cr | 8 ++++---- src/ast/inline_function.cr | 6 ++---- src/compilers/inline_function.cr | 9 +++++++-- src/formatters/inline_function.cr | 2 +- src/parsers/function.cr | 12 ++---------- src/parsers/inline_function.cr | 12 +----------- 6 files changed, 17 insertions(+), 32 deletions(-) diff --git a/spec/parsers/inline_function_spec.cr b/spec/parsers/inline_function_spec.cr index 405c24743..ac5803438 100644 --- a/spec/parsers/inline_function_spec.cr +++ b/spec/parsers/inline_function_spec.cr @@ -9,11 +9,11 @@ describe "Inline Function" do expect_error "(", Mint::Parser::InlineFunctionExpectedClosingParentheses expect_error "(a : Event ", Mint::Parser::InlineFunctionExpectedClosingParentheses - expect_error "(a : Event)", Mint::Parser::InlineFunctionExpectedOpeningBracket + expect_error "(a : Event)", Mint::SyntaxError expect_error "(a : Event) :", Mint::Parser::InlineFunctionExpectedType - expect_error "(a : Event) : X", Mint::Parser::InlineFunctionExpectedOpeningBracket - expect_error "(a : Event) : X {", Mint::Parser::InlineFunctionExpectedExpression - expect_error "(a : Event) : X { b ", Mint::Parser::InlineFunctionExpectedClosingBracket + expect_error "(a : Event) : X", Mint::SyntaxError + expect_error "(a : Event) : X {", Mint::SyntaxError + expect_error "(a : Event) : X { b ", Mint::SyntaxError expect_ok "(a : Event) { b }" expect_ok "(a : Event) : X { b }" diff --git a/src/ast/inline_function.cr b/src/ast/inline_function.cr index 4bbcc84b5..2e5aa844e 100644 --- a/src/ast/inline_function.cr +++ b/src/ast/inline_function.cr @@ -1,11 +1,9 @@ module Mint class Ast class InlineFunction < Node - getter body, arguments, head_comments, tail_comments, type + getter body, arguments, type - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @arguments : Array(Argument), + def initialize(@arguments : Array(Argument), @type : TypeOrVariable?, @body : Expression, @input : Data, diff --git a/src/compilers/inline_function.cr b/src/compilers/inline_function.cr index 6dada9498..aeb83a276 100644 --- a/src/compilers/inline_function.cr +++ b/src/compilers/inline_function.cr @@ -2,12 +2,17 @@ module Mint class Compiler def _compile(node : Ast::InlineFunction) : String body = - compile node.body + case item = node.body + when Ast::Block + compile item, for_function: true + else + compile item + end arguments = compile node.arguments - js.arrow_function(arguments, js.return(body)) + js.arrow_function(arguments, body) end end end diff --git a/src/formatters/inline_function.cr b/src/formatters/inline_function.cr index 2a7788a5c..c48b8a7e1 100644 --- a/src/formatters/inline_function.cr +++ b/src/formatters/inline_function.cr @@ -2,7 +2,7 @@ module Mint class Formatter def format(node : Ast::InlineFunction) : String body = - list [node.body] + node.head_comments + node.tail_comments + format node.body value = format node.arguments diff --git a/src/parsers/function.cr b/src/parsers/function.cr index 40f23dfa2..3e1df2141 100644 --- a/src/parsers/function.cr +++ b/src/parsers/function.cr @@ -38,20 +38,12 @@ module Mint item end - body = - code_block - - end_position = - position - - whitespace - self << Ast::Function.new( - body: body.as(Ast::Expression), arguments: arguments, from: start_position, comment: comment, - to: end_position, + body: code_block, + to: position, input: data, name: name, type: type) diff --git a/src/parsers/inline_function.cr b/src/parsers/inline_function.cr index 8fdf41e56..cd719ed80 100644 --- a/src/parsers/inline_function.cr +++ b/src/parsers/inline_function.cr @@ -29,20 +29,10 @@ module Mint item end - head_comments, body, tail_comments = - block_with_comments( - opening_bracket: InlineFunctionExpectedOpeningBracket, - closing_bracket: InlineFunctionExpectedClosingBracket - ) do - expression! InlineFunctionExpectedExpression - end - self << Ast::InlineFunction.new( - body: body.as(Ast::Expression), - head_comments: head_comments, - tail_comments: tail_comments, arguments: arguments, from: start_position, + body: code_block, to: position, input: data, type: type) From 9cbef12cd5091032b18ed5b27a8b7e53d05aa612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Thu, 7 Oct 2021 15:19:35 +0200 Subject: [PATCH 07/20] Convert more blocks to new code blocks. [skip ci] --- core/source/Dom.mint | 32 +++--- core/source/Html.Event.mint | 12 +- core/source/Number.mint | 50 ++++---- core/source/Provider/AnimationFrame.mint | 10 +- core/source/Provider/ElementSize.mint | 28 +++-- core/source/Provider/Intersection.mint | 107 ++++++++---------- core/source/Provider/Keydown.mint | 6 +- core/source/Provider/Keyup.mint | 6 +- core/source/Provider/MediaQuery.mint | 96 ++++++++-------- core/source/Provider/Mouse.mint | 30 +++-- core/source/Provider/Mutation.mint | 34 +++--- core/source/Provider/OutsideClick.mint | 24 ++-- core/source/Provider/Resize.mint | 6 +- core/source/Provider/Scroll.mint | 6 +- core/source/Provider/Shortcuts.mint | 68 +++++------ core/source/Provider/TabFocus.mint | 50 ++++---- core/source/Provider/Tick.mint | 14 +-- core/source/Provider/Url.mint | 16 +-- core/source/Provider/Websocket.mint | 98 ++++++++-------- core/source/Set.mint | 7 +- core/source/Test/Html.mint | 36 +----- core/source/Test/Window.mint | 12 +- core/source/Window.mint | 26 ++--- spec/compilers/block_with_await | 32 ++++++ spec/compilers/inline_function_recursive | 6 +- spec/compilers/inline_function_with_arguments | 6 +- spec/compilers/inline_functions_recursive | 10 +- spec/compilers/module_access | 6 +- spec/compilers/variable_module_function | 6 +- spec/parsers/catch_spec.cr | 8 +- spec/parsers/for_spec.cr | 6 +- src/ast/catch.cr | 6 +- src/ast/catch_all.cr | 6 +- src/ast/for.cr | 6 +- src/ast/for_condition.cr | 6 +- src/ast/if.cr | 8 +- src/ast/statement.cr | 7 +- src/compilers/block.cr | 4 +- src/compilers/statement.cr | 7 +- src/formatters/catch.cr | 2 +- src/formatters/catch_all.cr | 2 +- src/formatters/for.cr | 4 +- src/formatters/if.cr | 12 +- src/parsers/catch.cr | 16 +-- src/parsers/catch_all.cr | 11 +- src/parsers/for.cr | 15 +-- src/parsers/for_condition.cr | 13 +-- src/parsers/if.cr | 44 +++---- src/parsers/statement.cr | 8 +- src/type_checkers/block.cr | 21 +++- src/type_checkers/statement.cr | 6 +- 51 files changed, 471 insertions(+), 587 deletions(-) create mode 100644 spec/compilers/block_with_await diff --git a/core/source/Dom.mint b/core/source/Dom.mint index 11b3456b5..650c392fa 100644 --- a/core/source/Dom.mint +++ b/core/source/Dom.mint @@ -255,14 +255,12 @@ module Dom { /* If the attribute is present, it will return its value on the given element. - try { - outcome = - Dom.getElementById("my-div") + outcome = + Dom.getElementById("my-div") - case (outcome) { - Maybe::Just(element) => Dom.getAttribute("id", element) == "my-div" - Maybe::Nothing => false - } + case (outcome) { + Maybe::Just(element) => Dom.getAttribute("id", element) == "my-div" + Maybe::Nothing => false } */ fun getAttribute (name : String, element : Dom.Element) : Maybe(String) { @@ -552,20 +550,18 @@ module Dom { |> getElementsBySelector(selector) |> Array.map( (item : Dom.Element) : Tuple(String, String, String) { - try { - tag = - item - |> getTagName() - |> String.toLowerCase() + tag = + item + |> getTagName() + |> String.toLowerCase() - text = - getTextContent(item) + text = + getTextContent(item) - hash = - String.parameterize(text) + hash = + String.parameterize(text) - {tag, text, hash} - } + {tag, text, hash} }) } } diff --git a/core/source/Html.Event.mint b/core/source/Html.Event.mint index c71fa3e2d..3f7a7007e 100644 --- a/core/source/Html.Event.mint +++ b/core/source/Html.Event.mint @@ -194,10 +194,8 @@ module Html.Event { /* Stops the propagation of the given event. - try { - Html.Event.stopPropagation(event) - doSomethingElse() - } + Html.Event.stopPropagation(event) + doSomethingElse() */ fun stopPropagation (event : Html.Event) : Void { `#{event.event}.stopPropagation()` @@ -215,10 +213,8 @@ module Html.Event { /* Prevents the default action of the event from happening. - try { - Html.Event.preventDefault(event) - doSomethingElse() - } + Html.Event.preventDefault(event) + doSomethingElse() */ fun preventDefault (event : Html.Event) : Void { `#{event.event}.preventDefault()` diff --git a/core/source/Number.mint b/core/source/Number.mint index dfe8a0cd2..f2c90b89e 100644 --- a/core/source/Number.mint +++ b/core/source/Number.mint @@ -77,32 +77,30 @@ module Number { Number.format("$ ", 1034150) == "$ 1,034,150" */ fun format (prefix : String, number : Number) : String { - try { - string = - Number.toFixed(2, number) - - parts = - String.split(".", string) - - digits = - parts[0] - |> Maybe.withDefault("") - |> String.lchop("-") - |> String.split("") - |> Array.groupsOfFromEnd(3) - |> Array.map(String.join("")) - |> String.join(",") - - decimals = - parts[1] - |> Maybe.withDefault("") - |> String.rchop("0") - - if (String.isEmpty(decimals)) { - prefix + digits - } else { - prefix + digits + "." + decimals - } + string = + Number.toFixed(2, number) + + parts = + String.split(".", string) + + digits = + parts[0] + |> Maybe.withDefault("") + |> String.lchop("-") + |> String.split("") + |> Array.groupsOfFromEnd(3) + |> Array.map(String.join("")) + |> String.join(",") + + decimals = + parts[1] + |> Maybe.withDefault("") + |> String.rchop("0") + + if (String.isEmpty(decimals)) { + prefix + digits + } else { + prefix + digits + "." + decimals } } } diff --git a/core/source/Provider/AnimationFrame.mint b/core/source/Provider/AnimationFrame.mint index b9b4415fb..86ba16498 100644 --- a/core/source/Provider/AnimationFrame.mint +++ b/core/source/Provider/AnimationFrame.mint @@ -10,13 +10,11 @@ provider Provider.AnimationFrame : Provider.AnimationFrame.Subscription { /* Call the subscribers. */ fun process (timestamp : Number) : Promise(Never, Void) { - try { - for (subscription of subscriptions) { - subscription.frames(timestamp) - } - - next { id = AnimationFrame.request(process) } + for (subscription of subscriptions) { + subscription.frames(timestamp) } + + next { id = AnimationFrame.request(process) } } /* Updates the provider. */ diff --git a/core/source/Provider/ElementSize.mint b/core/source/Provider/ElementSize.mint index 76b47b54a..45003ebc8 100644 --- a/core/source/Provider/ElementSize.mint +++ b/core/source/Provider/ElementSize.mint @@ -27,24 +27,22 @@ provider Provider.ElementSize : Provider.ElementSize.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { - try { - for (element of Array.compact(observedElements)) { - ResizeObserver.unobserve(element, observer) - } + for (element of Array.compact(observedElements)) { + ResizeObserver.unobserve(element, observer) + } - for (subscription of subscriptions) { - case (subscription.element) { - Maybe::Just(element) => - try { - ResizeObserver.observe(element, observer) - void - } + for (subscription of subscriptions) { + case (subscription.element) { + Maybe::Just(element) => + try { + ResizeObserver.observe(element, observer) + void + } - Maybe::Nothing => void - } + Maybe::Nothing => void } - - next { observedElements = Array.map(.element, subscriptions) } } + + next { observedElements = Array.map(.element, subscriptions) } } } diff --git a/core/source/Provider/Intersection.mint b/core/source/Provider/Intersection.mint index 99b048820..8bc42865e 100644 --- a/core/source/Provider/Intersection.mint +++ b/core/source/Provider/Intersection.mint @@ -13,76 +13,61 @@ provider Provider.Intersection : Provider.Intersection.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { - try { - /* - Gather all of the current observers, and remove ones that are no - longer present. - */ - currentObservers = - for (item of observers) { - try { - {subscription, observer} = - item + /* + Gather all of the current observers, and remove ones that are no + longer present. + */ + currentObservers = + for (item of observers) { + {subscription, observer} = + item - if (Array.contains(subscription, subscriptions)) { - Maybe::Just({subscription, observer}) - } else { - try { - case (subscription.element) { - Maybe::Just(observed) => - try { - IntersectionObserver.unobserve(observed, observer) - Maybe::Nothing - } - - => Maybe::Nothing - } - } - } - } - } - |> Array.compact() - - /* Create new observers. */ - newObservers = - for (subscription of subscriptions) { + if (Array.contains(subscription, subscriptions)) { + Maybe::Just({subscription, observer}) + } else { case (subscription.element) { Maybe::Just(observed) => - Maybe::Just( - { - subscription, - IntersectionObserver.new( - subscription.rootMargin, - subscription.threshold, - subscription.callback) - |> IntersectionObserver.observe(observed) - }) + try { + IntersectionObserver.unobserve(observed, observer) + Maybe::Nothing + } => Maybe::Nothing } - } when { - try { - size = - observers - |> Array.select( - ( - item : Tuple(Provider.Intersection.Subscription, IntersectionObserver) - ) { - try { - {key, value} = - item + } + } + |> Array.compact() - (key == subscription) - } - }) - |> Array.size() + /* Create new observers. */ + newObservers = + for (subscription of subscriptions) { + case (subscription.element) { + Maybe::Just(observed) => + Maybe::Just( + { + subscription, + IntersectionObserver.new( + subscription.rootMargin, + subscription.threshold, + subscription.callback) + |> IntersectionObserver.observe(observed) + }) - (size == 0) - } + => Maybe::Nothing } - |> Array.compact() + } when { + size = + observers + |> Array.select( + ( + item : Tuple(Provider.Intersection.Subscription, IntersectionObserver) + ) { item[0] == subscription }) + |> Array.size() + + (size == 0) + } + |> Array.compact() - next { observers = Array.concat([currentObservers, newObservers]) } - } + next { observers = Array.concat([currentObservers, newObservers]) } } } diff --git a/core/source/Provider/Keydown.mint b/core/source/Provider/Keydown.mint index 5ef385159..6ab0c201a 100644 --- a/core/source/Provider/Keydown.mint +++ b/core/source/Provider/Keydown.mint @@ -18,10 +18,8 @@ provider Provider.Keydown : Provider.Keydown.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) - next { listener = Maybe::Nothing } - } + Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) + next { listener = Maybe::Nothing } } else { case (listener) { Maybe::Nothing => diff --git a/core/source/Provider/Keyup.mint b/core/source/Provider/Keyup.mint index dbd1bcf2a..ce266fda0 100644 --- a/core/source/Provider/Keyup.mint +++ b/core/source/Provider/Keyup.mint @@ -18,10 +18,8 @@ provider Provider.Keyup : Provider.Keyup.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) - next { listener = Maybe::Nothing } - } + Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) + next { listener = Maybe::Nothing } } else { case (listener) { Maybe::Nothing => diff --git a/core/source/Provider/MediaQuery.mint b/core/source/Provider/MediaQuery.mint index f9f2326c9..bc8807603 100644 --- a/core/source/Provider/MediaQuery.mint +++ b/core/source/Provider/MediaQuery.mint @@ -13,62 +13,58 @@ provider Provider.MediaQuery : Provider.MediaQuery.Subscription { state listeners : Map(String, Function(Void)) = Map.empty() fun update : Promise(Never, Void) { - try { - updatedListeners = - subscriptions - |> Array.reduce( - listeners, - ( - memo : Map(String, Function(Void)), - subscription : Provider.MediaQuery.Subscription - ) { - case (Map.get(subscription.query, listeners)) { - Maybe::Nothing => - Map.set( + updatedListeners = + subscriptions + |> Array.reduce( + listeners, + ( + memo : Map(String, Function(Void)), + subscription : Provider.MediaQuery.Subscription + ) { + case (Map.get(subscription.query, listeners)) { + Maybe::Nothing => + Map.set( + subscription.query, + Window.addMediaQueryListener( subscription.query, - Window.addMediaQueryListener( - subscription.query, - (active : Bool) { - for (item of subscriptions) { - subscription.changes(active) - } when { - item.query == subscription.query - } - }), - memo) + (active : Bool) { + for (item of subscriptions) { + subscription.changes(active) + } when { + item.query == subscription.query + } + }), + memo) - Maybe::Just => memo - } - }) + Maybe::Just => memo + } + }) - finalListeners = - updatedListeners - |> Map.reduce( - updatedListeners, - ( - memo : Map(String, Function(Void)), - query : String, - listener : Function(Void) - ) { - try { - subscription = - subscriptions - |> Array.find( - (item : Provider.MediaQuery.Subscription) { item.query == query }) + finalListeners = + updatedListeners + |> Map.reduce( + updatedListeners, + ( + memo : Map(String, Function(Void)), + query : String, + listener : Function(Void) + ) { + subscription = + subscriptions + |> Array.find( + (item : Provider.MediaQuery.Subscription) { item.query == query }) - case (subscription) { - Maybe::Just => memo + case (subscription) { + Maybe::Just => memo - Maybe::Nothing => - try { - listener() - Map.delete(query, memo) - } + Maybe::Nothing => + try { + listener() + Map.delete(query, memo) } - } - }) + } + }) - next { listeners = finalListeners } - } + next { listeners = finalListeners } } } diff --git a/core/source/Provider/Mouse.mint b/core/source/Provider/Mouse.mint index c1c9bbc89..cd2c4cee3 100644 --- a/core/source/Provider/Mouse.mint +++ b/core/source/Provider/Mouse.mint @@ -13,24 +13,22 @@ provider Provider.Mouse : Provider.Mouse.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map( - ( - methods : Tuple(Function(Void), Function(Void), Function(Void)) - ) { - try { - {clickListener, moveListener, upListener} = - methods + Maybe.map( + ( + methods : Tuple(Function(Void), Function(Void), Function(Void)) + ) { + try { + {clickListener, moveListener, upListener} = + methods - clickListener() - moveListener() - upListener() - } - }, - listeners) + clickListener() + moveListener() + upListener() + } + }, + listeners) - next { listeners = Maybe::Nothing } - } + next { listeners = Maybe::Nothing } } else { case (listeners) { Maybe::Nothing => diff --git a/core/source/Provider/Mutation.mint b/core/source/Provider/Mutation.mint index f550e7964..4c7f204eb 100644 --- a/core/source/Provider/Mutation.mint +++ b/core/source/Provider/Mutation.mint @@ -35,27 +35,25 @@ provider Provider.Mutation : Provider.Mutation.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { - try { - /* Unobserve all elements. */ - for (element of Array.compact(observedElements)) { - MutationObserver.unobserve(element, observer) - } + /* Unobserve all elements. */ + for (element of Array.compact(observedElements)) { + MutationObserver.unobserve(element, observer) + } - /* For each subscription observe the given elements. */ - for (subscription of subscriptions) { - case (subscription.element) { - Maybe::Just(element) => - try { - MutationObserver.observe(element, true, true, observer) - subscription.changes() - } + /* For each subscription observe the given elements. */ + for (subscription of subscriptions) { + case (subscription.element) { + Maybe::Just(element) => + try { + MutationObserver.observe(element, true, true, observer) + subscription.changes() + } - Maybe::Nothing => next { } - } + Maybe::Nothing => next { } } - - /* Update the observed elements array. */ - next { observedElements = Array.map(.element, subscriptions) } } + + /* Update the observed elements array. */ + next { observedElements = Array.map(.element, subscriptions) } } } diff --git a/core/source/Provider/OutsideClick.mint b/core/source/Provider/OutsideClick.mint index 109ffd1a6..350c68e35 100644 --- a/core/source/Provider/OutsideClick.mint +++ b/core/source/Provider/OutsideClick.mint @@ -12,17 +12,15 @@ provider Provider.OutsideClick : Provider.OutsideClick.Subscription { /* The event handler. */ fun handle (event : Html.Event) : Array(Promise(Never, Void)) { for (subscription of subscriptions) { - try { - inside = - subscription.elements - |> Array.compact() - |> Array.any((item : Dom.Element) { Dom.contains(event.target, item) }) + inside = + subscription.elements + |> Array.compact() + |> Array.any((item : Dom.Element) { Dom.contains(event.target, item) }) - if (inside) { - Promise.never() - } else { - subscription.clicks() - } + if (inside) { + Promise.never() + } else { + subscription.clicks() } } } @@ -30,10 +28,8 @@ provider Provider.OutsideClick : Provider.OutsideClick.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) - next { listener = Maybe::Nothing } - } + Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) + next { listener = Maybe::Nothing } } else { case (listener) { Maybe::Nothing => diff --git a/core/source/Provider/Resize.mint b/core/source/Provider/Resize.mint index 67f437274..d2f85ffd9 100644 --- a/core/source/Provider/Resize.mint +++ b/core/source/Provider/Resize.mint @@ -17,10 +17,8 @@ provider Provider.Resize : Provider.Resize.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) - next { listener = Maybe::Nothing } - } + Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) + next { listener = Maybe::Nothing } } else { case (listener) { Maybe::Nothing => diff --git a/core/source/Provider/Scroll.mint b/core/source/Provider/Scroll.mint index d822bd347..ea0254f04 100644 --- a/core/source/Provider/Scroll.mint +++ b/core/source/Provider/Scroll.mint @@ -17,10 +17,8 @@ provider Provider.Scroll : Provider.Scroll.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) - next { listener = Maybe::Nothing } - } + Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) + next { listener = Maybe::Nothing } } else { case (listener) { Maybe::Nothing => diff --git a/core/source/Provider/Shortcuts.mint b/core/source/Provider/Shortcuts.mint index e64e65d7f..d34265292 100644 --- a/core/source/Provider/Shortcuts.mint +++ b/core/source/Provider/Shortcuts.mint @@ -25,45 +25,39 @@ provider Provider.Shortcuts : Provider.Shortcuts.Subscription { /* Handles keypress events. */ fun handle (event : Html.Event) : Array(Array(Promise(Never, Void))) { - try { - control = - if (event.ctrlKey && event.keyCode != 17) { - Maybe::Just(17) - } else { - Maybe::Nothing - } + control = + if (event.ctrlKey && event.keyCode != 17) { + Maybe::Just(17) + } else { + Maybe::Nothing + } - shift = - if (event.shiftKey && event.keyCode != 16) { - Maybe::Just(16) - } else { - Maybe::Nothing - } + shift = + if (event.shiftKey && event.keyCode != 16) { + Maybe::Just(16) + } else { + Maybe::Nothing + } - combo = - [Maybe::Just(event.keyCode), control, shift] - |> Array.compact() - |> Array.sortBy((item : Number) { item }) + combo = + [Maybe::Just(event.keyCode), control, shift] + |> Array.compact() + |> Array.sortBy((item : Number) { item }) - focused = - `document.querySelector("*:focus")` + focused = + `document.querySelector("*:focus")` - for (subscription of subscriptions) { - for (item of subscription.shortcuts) { - try { - Html.Event.stopPropagation(event) - Html.Event.preventDefault(event) - item.action() - } - } when { - try { - sorted = - item.shortcut - |> Array.sortBy((item : Number) : Number { item }) + for (subscription of subscriptions) { + for (item of subscription.shortcuts) { + Html.Event.stopPropagation(event) + Html.Event.preventDefault(event) + item.action() + } when { + sorted = + item.shortcut + |> Array.sortBy((item : Number) : Number { item }) - (sorted == combo && item.condition()) && (!focused || item.bypassFocused) - } - } + (sorted == combo && item.condition()) && (!focused || item.bypassFocused) } } } @@ -71,10 +65,8 @@ provider Provider.Shortcuts : Provider.Shortcuts.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) - next { listener = Maybe::Nothing } - } + Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) + next { listener = Maybe::Nothing } } else { case (listener) { Maybe::Nothing => diff --git a/core/source/Provider/TabFocus.mint b/core/source/Provider/TabFocus.mint index 4140cbd47..ab6790b60 100644 --- a/core/source/Provider/TabFocus.mint +++ b/core/source/Provider/TabFocus.mint @@ -13,15 +13,13 @@ provider Providers.TabFocus : Provider.TabFocus.Subscription { /* The `keyUp` event handler. */ fun handleKeyUp (event : Html.Event) : Array(Promise(Never, Void)) { if (event.keyCode == Html.Event:TAB) { - try { - activeElement = - Dom.getActiveElement() + activeElement = + Dom.getActiveElement() - for (subscription of subscriptions) { - subscription.onTabIn() - } when { - subscription.element == activeElement - } + for (subscription of subscriptions) { + subscription.onTabIn() + } when { + subscription.element == activeElement } } else { [] @@ -31,15 +29,13 @@ provider Providers.TabFocus : Provider.TabFocus.Subscription { /* The `keyDown` event handler. */ fun handleKeyDown (event : Html.Event) : Array(Promise(Never, Void)) { if (event.keyCode == Html.Event:TAB) { - try { - target = - Maybe::Just(event.target) + target = + Maybe::Just(event.target) - for (subscription of subscriptions) { - subscription.onTabOut() - } when { - subscription.element == target - } + for (subscription of subscriptions) { + subscription.onTabOut() + } when { + subscription.element == target } } else { [] @@ -49,21 +45,17 @@ provider Providers.TabFocus : Provider.TabFocus.Subscription { /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map( - (methods : Tuple(Function(Void), Function(Void))) { - try { - {keyDownListener, keyUpListener} = - methods + Maybe.map( + (methods : Tuple(Function(Void), Function(Void))) { + {keyDownListener, keyUpListener} = + methods - keyDownListener() - keyUpListener() - } - }, - listeners) + keyDownListener() + keyUpListener() + }, + listeners) - next { listeners = Maybe::Nothing } - } + next { listeners = Maybe::Nothing } } else { case (listeners) { Maybe::Nothing => diff --git a/core/source/Provider/Tick.mint b/core/source/Provider/Tick.mint index bc2b06cda..fc81c3fc5 100644 --- a/core/source/Provider/Tick.mint +++ b/core/source/Provider/Tick.mint @@ -16,14 +16,12 @@ provider Provider.Tick : Provider.Tick.Subscription { /* Attaches the provider. */ fun update : Promise(Never, Void) { - sequence { - if (Array.isEmpty(subscriptions)) { - next { id = `clearInterval(#{id}) || -1` } - } else if (id == -1) { - next { id = `setInterval(#{process}, 1000)` } - } else { - next { } - } + if (Array.isEmpty(subscriptions)) { + next { id = `clearInterval(#{id}) || -1` } + } else if (id == -1) { + next { id = `setInterval(#{process}, 1000)` } + } else { + next { } } } } diff --git a/core/source/Provider/Url.mint b/core/source/Provider/Url.mint index 38068450d..b2bd82d12 100644 --- a/core/source/Provider/Url.mint +++ b/core/source/Provider/Url.mint @@ -10,23 +10,19 @@ provider Provider.Url : Provider.Url.Subscription { /* The event handler. */ fun handle (event : Html.Event) : Array(Promise(Never, Void)) { - try { - url = - Window.url() + url = + Window.url() - for (subscription of subscriptions) { - subscription.changes(url) - } + for (subscription of subscriptions) { + subscription.changes(url) } } /* Updates the provider. */ fun update : Promise(Never, Void) { if (Array.isEmpty(subscriptions)) { - try { - Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) - next { listener = Maybe::Nothing } - } + Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) + next { listener = Maybe::Nothing } } else { case (listener) { Maybe::Nothing => diff --git a/core/source/Provider/Websocket.mint b/core/source/Provider/Websocket.mint index 72e07642b..91269265b 100644 --- a/core/source/Provider/Websocket.mint +++ b/core/source/Provider/Websocket.mint @@ -51,62 +51,58 @@ provider Provider.WebSocket : WebSocket.Config { } fun update : Promise(Never, Void) { - try { - updatedConnections = - subscriptions - |> Array.reduce( - connections, - ( - memo : Map(String, WebSocket), - config : WebSocket.Config - ) { - case (Map.get(config.url, connections)) { - Maybe::Nothing => - Map.set( - config.url, - WebSocket.open( - { - onMessage = (message : String) { onMessage(config.url, message) }, - onOpen = (socket : WebSocket) { onOpen(config.url, socket) }, - onClose = () { onClose(config.url) }, - onError = () { onError(config.url) }, - reconnectOnClose = config.reconnectOnClose, - url = config.url - }), - memo) + updatedConnections = + subscriptions + |> Array.reduce( + connections, + ( + memo : Map(String, WebSocket), + config : WebSocket.Config + ) { + case (Map.get(config.url, connections)) { + Maybe::Nothing => + Map.set( + config.url, + WebSocket.open( + { + onMessage = (message : String) { onMessage(config.url, message) }, + onOpen = (socket : WebSocket) { onOpen(config.url, socket) }, + onClose = () { onClose(config.url) }, + onError = () { onError(config.url) }, + reconnectOnClose = config.reconnectOnClose, + url = config.url + }), + memo) - Maybe::Just => memo - } - }) + Maybe::Just => memo + } + }) - finalConnections = - updatedConnections - |> Map.reduce( - updatedConnections, - ( - memo : Map(String, WebSocket), - url : String, - socket : WebSocket - ) { - try { - subscription = - subscriptions - |> Array.find( - (config : WebSocket.Config) { config.url == url }) + finalConnections = + updatedConnections + |> Map.reduce( + updatedConnections, + ( + memo : Map(String, WebSocket), + url : String, + socket : WebSocket + ) { + subscription = + subscriptions + |> Array.find( + (config : WebSocket.Config) { config.url == url }) - case (subscription) { - Maybe::Just => memo + case (subscription) { + Maybe::Just => memo - Maybe::Nothing => - try { - WebSocket.closeWithoutReconnecting(socket) - Map.delete(url, memo) - } + Maybe::Nothing => + try { + WebSocket.closeWithoutReconnecting(socket) + Map.delete(url, memo) } - } - }) + } + }) - next { connections = finalConnections } - } + next { connections = finalConnections } } } diff --git a/core/source/Set.mint b/core/source/Set.mint index fba3a0f2e..d7664b0e9 100644 --- a/core/source/Set.mint +++ b/core/source/Set.mint @@ -23,12 +23,7 @@ module Set { |> Set.add("value")) == Set.fromArray(["value"]) */ fun fromArray (array : Array(a)) : Set(a) { - try { - unique = - Array.uniq(array) - - `Array.from(#{unique})` - } + `#{Array.uniq(array)}` } /* diff --git a/core/source/Test/Html.mint b/core/source/Test/Html.mint index 13964e987..e14457bfa 100644 --- a/core/source/Test/Html.mint +++ b/core/source/Test/Html.mint @@ -54,56 +54,28 @@ module Test.Html { fun assertTop (top : Number, context : Test.Context(Dom.Element)) : Test.Context(Dom.Element) { Test.Context.assertOf( top, - (element : Dom.Element) : Number { - try { - dimensions = - Dom.getDimensions(element) - - dimensions.top - } - }, + (element : Dom.Element) : Number { Dom.getDimensions(element).top }, context) } fun assertLeft (left : Number, context : Test.Context(Dom.Element)) : Test.Context(Dom.Element) { Test.Context.assertOf( left, - (element : Dom.Element) : Number { - try { - dimensions = - Dom.getDimensions(element) - - dimensions.left - } - }, + (element : Dom.Element) : Number { Dom.getDimensions(element).left }, context) } fun assertHeight (height : Number, context : Test.Context(Dom.Element)) : Test.Context(Dom.Element) { Test.Context.assertOf( height, - (element : Dom.Element) : Number { - try { - dimensions = - Dom.getDimensions(element) - - dimensions.height - } - }, + (element : Dom.Element) : Number { Dom.getDimensions(element).height }, context) } fun assertWidth (width : Number, context : Test.Context(Dom.Element)) : Test.Context(Dom.Element) { Test.Context.assertOf( width, - (element : Dom.Element) : Number { - try { - dimensions = - Dom.getDimensions(element) - - dimensions.width - } - }, + (element : Dom.Element) : Number { Dom.getDimensions(element).width }, context) } diff --git a/core/source/Test/Window.mint b/core/source/Test/Window.mint index 066f83fe1..7cfa72bab 100644 --- a/core/source/Test/Window.mint +++ b/core/source/Test/Window.mint @@ -4,10 +4,8 @@ module Test.Window { fun setScrollLeft (to : Number, context : Test.Context(a)) : Test.Context(a) { Test.Context.then( (subject : Dom.Element) : Promise(Never, a) { - try { - Window.setScrollLeft(100) - Promise.resolve(subject) - } + Window.setScrollLeft(100) + Promise.resolve(subject) }, context) } @@ -16,10 +14,8 @@ module Test.Window { fun setScrollTop (to : Number, context : Test.Context(a)) : Test.Context(a) { Test.Context.then( (subject : Dom.Element) : Promise(Never, a) { - try { - Window.setScrollTop(100) - Promise.resolve(subject) - } + Window.setScrollTop(100) + Promise.resolve(subject) }, context) } diff --git a/core/source/Window.mint b/core/source/Window.mint index 85395e1c7..f2e2c67d1 100644 --- a/core/source/Window.mint +++ b/core/source/Window.mint @@ -150,20 +150,18 @@ module Window { /* Returns true if the given url is the same as the current url of the page. */ fun isActiveURL (url : String) : Bool { - try { - window = - Window.url() - - current = - Url.parse(url) - - (window.hostname == current.hostname && - window.protocol == current.protocol && - window.origin == current.origin && - window.path == current.path && - window.host == current.host && - window.port == current.port) - } + window = + Window.url() + + current = + Url.parse(url) + + (window.hostname == current.hostname && + window.protocol == current.protocol && + window.origin == current.origin && + window.path == current.path && + window.host == current.host && + window.port == current.port) } /* diff --git a/spec/compilers/block_with_await b/spec/compilers/block_with_await new file mode 100644 index 000000000..2ed273394 --- /dev/null +++ b/spec/compilers/block_with_await @@ -0,0 +1,32 @@ +component Main { + fun promise : Promise(String) { + `` as Promise(String) + } + + fun promiseTest : Promise(String) { + await promise() + } + + fun render : String { + promiseTest() + + "Hello" + } +} +-------------------------------------------------------------------------------- +class A extends _C { + a() { + return; + } + + b() { + return await this.a(); + } + + render() { + this.b(); + return `Hello`; + } +}; + +A.displayName = "Main"; diff --git a/spec/compilers/inline_function_recursive b/spec/compilers/inline_function_recursive index eec7c85f7..b754b0deb 100644 --- a/spec/compilers/inline_function_recursive +++ b/spec/compilers/inline_function_recursive @@ -24,11 +24,11 @@ component Main { -------------------------------------------------------------------------------- const B = new(class extends _M { a(e) { - const b = (c, d) => { - return (_compare(c, 0) ? d : b(c - 1, d * c)) + const d = (b, c) => { + return (_compare(b, 0) ? c : d(b - 1, c * b)) }; - return b(e, 1); + return d(e, 1); } }); diff --git a/spec/compilers/inline_function_with_arguments b/spec/compilers/inline_function_with_arguments index 5337189b1..2c86a410b 100644 --- a/spec/compilers/inline_function_with_arguments +++ b/spec/compilers/inline_function_with_arguments @@ -17,11 +17,11 @@ component Main { -------------------------------------------------------------------------------- class A extends _C { a() { - const b = (c) => { - return c + const c = (b) => { + return b }; - return b(`Joe`); + return c(`Joe`); } render() { diff --git a/spec/compilers/inline_functions_recursive b/spec/compilers/inline_functions_recursive index 777e14379..1dfaa277f 100644 --- a/spec/compilers/inline_functions_recursive +++ b/spec/compilers/inline_functions_recursive @@ -34,15 +34,15 @@ component Main { -------------------------------------------------------------------------------- const B = new(class extends _M { a(h) { - const b = (c, d) => { - return (_compare(c, 0) ? d : e(c - 1, d * c)) + const e = (b, c) => { + return (_compare(b, 0) ? c : d(b - 1, c * b)) }; - const e = (f, g) => { - return (_compare(f, 0) ? g : b(f - 1, g * f)) + const d = (f, g) => { + return (_compare(f, 0) ? g : e(f - 1, g * f)) }; - return b(h, 1); + return e(h, 1); } }); diff --git a/spec/compilers/module_access b/spec/compilers/module_access index 64213d6d8..0af0ae745 100644 --- a/spec/compilers/module_access +++ b/spec/compilers/module_access @@ -22,15 +22,15 @@ const B = new(class extends _M { return `Hello`; } - b() { + a() { return B.c; } }); class A extends _C { render() { - const a = B.b(); - return a(); + const b = B.a(); + return b(); } }; diff --git a/spec/compilers/variable_module_function b/spec/compilers/variable_module_function index a0b020b39..1e6a267d1 100644 --- a/spec/compilers/variable_module_function +++ b/spec/compilers/variable_module_function @@ -22,15 +22,15 @@ const B = new(class extends _M { return `Hello`; } - b() { + a() { return B.c; } }); class A extends _C { render() { - const a = B.b(); - return a(); + const b = B.a(); + return b(); } }; diff --git a/spec/parsers/catch_spec.cr b/spec/parsers/catch_spec.cr index d49b75a3c..56352c718 100644 --- a/spec/parsers/catch_spec.cr +++ b/spec/parsers/catch_spec.cr @@ -14,10 +14,10 @@ describe "Catch" do expect_error "catch X ", Mint::Parser::CatchExpectedArrow expect_error "catch X =>", Mint::Parser::CatchExpectedVariable expect_error "catch X => ", Mint::Parser::CatchExpectedVariable - expect_error "catch X => a", Mint::Parser::CatchExpectedOpeningBracket - expect_error "catch X => a ", Mint::Parser::CatchExpectedOpeningBracket - expect_error "catch X => a {", Mint::Parser::CatchExpectedExpression - expect_error "catch X => a {a", Mint::Parser::CatchExpectedClosingBracket + expect_error "catch X => a", Mint::SyntaxError + expect_error "catch X => a ", Mint::SyntaxError + expect_error "catch X => a {", Mint::SyntaxError + expect_error "catch X => a {a", Mint::SyntaxError expect_ok "catch X => a { a }" end diff --git a/spec/parsers/for_spec.cr b/spec/parsers/for_spec.cr index 86e4dbf15..bb7959aae 100644 --- a/spec/parsers/for_spec.cr +++ b/spec/parsers/for_spec.cr @@ -13,9 +13,9 @@ describe "For Expression" do expect_error "for (a, b", Mint::Parser::ForExpectedOf expect_error "for (a, b of", Mint::Parser::ForExpectedSubject expect_error "for (a, b of a", Mint::Parser::ForExpectedClosingParentheses - expect_error "for (a, b of a)", Mint::Parser::ForExpectedOpeningBracket - expect_error "for (a, b of a) {", Mint::Parser::ForExpectedBody - expect_error "for (a, b of a) { x", Mint::Parser::ForExpectedClosingBracket + expect_error "for (a, b of a)", Mint::SyntaxError + expect_error "for (a, b of a) {", Mint::SyntaxError + expect_error "for (a, b of a) { x", Mint::SyntaxError expect_error "for (a, b of a) { x } when", Mint::Parser::ForConditionExpectedOpeningBracket expect_error "for (a, b of a) { x } when {", Mint::Parser::ForConditionExpectedBody expect_error "for (a, b of a) { x } when { x", Mint::Parser::ForConditionExpectedClosingBracket diff --git a/src/ast/catch.cr b/src/ast/catch.cr index 9cb84d588..e448befcc 100644 --- a/src/ast/catch.cr +++ b/src/ast/catch.cr @@ -1,11 +1,9 @@ module Mint class Ast class Catch < Node - getter variable, expression, type, head_comments, tail_comments + getter variable, expression, type - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @expression : Expression, + def initialize(@expression : Expression, @variable : Variable, @type : String, @input : Data, diff --git a/src/ast/catch_all.cr b/src/ast/catch_all.cr index 660ac4ef9..c09a72052 100644 --- a/src/ast/catch_all.cr +++ b/src/ast/catch_all.cr @@ -1,11 +1,9 @@ module Mint class Ast class CatchAll < Node - getter expression, head_comments, tail_comments + getter expression - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @expression : Expression, + def initialize(@expression : Expression, @input : Data, @from : Int32, @to : Int32) diff --git a/src/ast/for.cr b/src/ast/for.cr index 1bc602dd8..ae20c474b 100644 --- a/src/ast/for.cr +++ b/src/ast/for.cr @@ -1,11 +1,9 @@ module Mint class Ast class For < Node - getter head_comments, tail_comments, subject, body, arguments, condition + getter subject, body, arguments, condition - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @condition : ForCondition?, + def initialize(@condition : ForCondition?, @arguments : Array(Variable), @subject : Expression, @body : Expression, diff --git a/src/ast/for_condition.cr b/src/ast/for_condition.cr index 96090de79..1fdf9b5e7 100644 --- a/src/ast/for_condition.cr +++ b/src/ast/for_condition.cr @@ -1,11 +1,9 @@ module Mint class Ast class ForCondition < Node - getter condition, head_comments, tail_comments + getter condition - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @condition : Expression, + def initialize(@condition : Expression, @input : Data, @from : Int32, @to : Int32) diff --git a/src/ast/if.cr b/src/ast/if.cr index b52d45593..39e74a439 100644 --- a/src/ast/if.cr +++ b/src/ast/if.cr @@ -1,8 +1,6 @@ module Mint class Ast class If < Node - getter truthy_head_comments, truthy_tail_comments - getter falsy_head_comments, falsy_tail_comments getter condition, branches alias Branches = Tuple(Array(CssDefinition), Array(CssDefinition)) | @@ -10,11 +8,7 @@ module Mint Tuple(Array(CssDefinition), If) | Tuple(Node, Node) - def initialize(@truthy_head_comments : Array(Comment), - @truthy_tail_comments : Array(Comment), - @falsy_head_comments : Array(Comment), - @falsy_tail_comments : Array(Comment), - @branches : Branches, + def initialize(@branches : Branches, @condition : Node, @input : Data, @from : Int32, diff --git a/src/ast/statement.cr b/src/ast/statement.cr index 8549aa6b9..0e8b64421 100644 --- a/src/ast/statement.cr +++ b/src/ast/statement.cr @@ -8,11 +8,12 @@ module Mint None end - getter target, expression, parent + getter target, expression, parent, await - def initialize(@target : Node?, - @expression : Expression, + def initialize(@expression : Expression, @parent : Parent, + @target : Node?, + @await : Bool, @input : Data, @from : Int32, @to : Int32) diff --git a/src/compilers/block.cr b/src/compilers/block.cr index efd3d95d8..8608b74ed 100644 --- a/src/compilers/block.cr +++ b/src/compilers/block.cr @@ -1,6 +1,6 @@ module Mint class Compiler - def compile(node : Ast::Block, for_function = true) : String + def compile(node : Ast::Block, for_function = false) : String if checked.includes?(node) _compile(node, for_function) else @@ -8,7 +8,7 @@ module Mint end end - def _compile(node : Ast::Block, for_function = true) : String + def _compile(node : Ast::Block, for_function = false) : String if node.statements.size == 1 if for_function js.return(compile(node.statements.first)) diff --git a/src/compilers/statement.cr b/src/compilers/statement.cr index 83caf027f..a6c41a3bb 100644 --- a/src/compilers/statement.cr +++ b/src/compilers/statement.cr @@ -1,10 +1,13 @@ module Mint class Compiler def _compile(node : Ast::Statement) : String + right = compile node.expression + right = "await #{right}" if node.await + if node.parent == Ast::Statement::Parent::None && (target = node.target) - js.const(js.variable_of(target), compile node.expression) + js.const js.variable_of(target), right else - compile node.expression + right end end end diff --git a/src/formatters/catch.cr b/src/formatters/catch.cr index 409e2c677..8bd36e9a1 100644 --- a/src/formatters/catch.cr +++ b/src/formatters/catch.cr @@ -2,7 +2,7 @@ module Mint class Formatter def format(node : Ast::Catch) : String body = - list [node.expression] + node.head_comments + node.tail_comments + format node.expression variable = format node.variable diff --git a/src/formatters/catch_all.cr b/src/formatters/catch_all.cr index 82fd08cef..33209aea3 100644 --- a/src/formatters/catch_all.cr +++ b/src/formatters/catch_all.cr @@ -2,7 +2,7 @@ module Mint class Formatter def format(node : Ast::CatchAll) : String body = - list [node.expression] + node.head_comments + node.tail_comments + format node.expression "catch {\n#{indent(body)}\n}" end diff --git a/src/formatters/for.cr b/src/formatters/for.cr index 38e95f210..eac438f85 100644 --- a/src/formatters/for.cr +++ b/src/formatters/for.cr @@ -2,14 +2,14 @@ module Mint class Formatter def format(node : Ast::ForCondition) : String body = - list [node.condition] + node.head_comments + node.tail_comments + format node.condition " when {\n#{indent(body)}\n}" end def format(node : Ast::For) : String body = - list [node.body] + node.head_comments + node.tail_comments + format node.body subject = format node.subject diff --git a/src/formatters/if.cr b/src/formatters/if.cr index 9cc79e151..5a3bf3982 100644 --- a/src/formatters/if.cr +++ b/src/formatters/if.cr @@ -10,25 +10,23 @@ module Mint truthy = case truthy_item when Array(Ast::CssDefinition) - list truthy_item + node.truthy_head_comments + node.truthy_tail_comments + list truthy_item when Ast::Node - list [truthy_item] + node.truthy_head_comments + node.truthy_tail_comments + format truthy_item else "" end falsy = - if falsy_item.is_a?(Ast::If) && - node.falsy_head_comments.empty? && - node.falsy_tail_comments.empty? + if falsy_item.is_a?(Ast::If) " else #{format(falsy_item)}" else body = case falsy_item when Array(Ast::CssDefinition) - list falsy_item + node.falsy_head_comments + node.falsy_tail_comments + list falsy_item when Ast::Node - list [falsy_item] + node.falsy_head_comments + node.falsy_tail_comments + format falsy_item end " else {\n#{indent(body)}\n}" if body diff --git a/src/parsers/catch.cr b/src/parsers/catch.cr index fcfe01e17..5d456175d 100644 --- a/src/parsers/catch.cr +++ b/src/parsers/catch.cr @@ -1,8 +1,5 @@ module Mint class Parser - syntax_error CatchExpectedOpeningBracket - syntax_error CatchExpectedClosingBracket - syntax_error CatchExpectedExpression syntax_error CatchExpectedVariable syntax_error CatchExpectedArrow @@ -15,19 +12,16 @@ module Mint whitespace keyword! "=>", CatchExpectedArrow + whitespace variable = variable! CatchExpectedVariable + whitespace - head_comments, expression, tail_comments = block_with_comments( - opening_bracket: CatchExpectedOpeningBracket, - closing_bracket: CatchExpectedClosingBracket) do - expression! CatchExpectedExpression - end + expression = + code_block self << Ast::Catch.new( - expression: expression.as(Ast::Expression), - head_comments: head_comments, - tail_comments: tail_comments, + expression: expression, from: start_position, variable: variable, to: position, diff --git a/src/parsers/catch_all.cr b/src/parsers/catch_all.cr index 60a8f7c52..77c22909d 100644 --- a/src/parsers/catch_all.cr +++ b/src/parsers/catch_all.cr @@ -3,17 +3,10 @@ module Mint def catch_all : Ast::CatchAll? start do |start_position| next unless keyword "catch" - - head_comments, expression, tail_comments = block_with_comments( - opening_bracket: CatchExpectedOpeningBracket, - closing_bracket: CatchExpectedClosingBracket) do - expression! CatchExpectedExpression - end + whitespace self << Ast::CatchAll.new( - expression: expression.as(Ast::Expression), - head_comments: head_comments, - tail_comments: tail_comments, + expression: code_block, from: start_position, to: position, input: data) diff --git a/src/parsers/for.cr b/src/parsers/for.cr index e39a42e29..d5f85eebf 100644 --- a/src/parsers/for.cr +++ b/src/parsers/for.cr @@ -2,10 +2,7 @@ module Mint class Parser syntax_error ForExpectedOpeningParentheses syntax_error ForExpectedClosingParentheses - syntax_error ForExpectedOpeningBracket - syntax_error ForExpectedClosingBracket syntax_error ForExpectedSubject - syntax_error ForExpectedBody syntax_error ForExpectedOf def for_expression : Ast::For? @@ -30,22 +27,16 @@ module Mint whitespace char ')', ForExpectedClosingParentheses + whitespace - head_comments, body, tail_comments = - block_with_comments( - opening_bracket: ForExpectedOpeningBracket, - closing_bracket: ForExpectedClosingBracket - ) do - expression! ForExpectedBody - end + body = + code_block whitespace condition = for_condition whitespace self << Ast::For.new( - head_comments: head_comments, - tail_comments: tail_comments, condition: condition, arguments: arguments, from: start_position, diff --git a/src/parsers/for_condition.cr b/src/parsers/for_condition.cr index f7dc0d280..d9ded1eeb 100644 --- a/src/parsers/for_condition.cr +++ b/src/parsers/for_condition.cr @@ -7,19 +7,10 @@ module Mint def for_condition : Ast::ForCondition? start do |start_position| next unless keyword "when" - - head_comments, condition, tail_comments = - block_with_comments( - opening_bracket: ForConditionExpectedOpeningBracket, - closing_bracket: ForConditionExpectedClosingBracket - ) do - expression! ForConditionExpectedBody - end + whitespace self << Ast::ForCondition.new( - head_comments: head_comments, - tail_comments: tail_comments, - condition: condition, + condition: code_block, from: start_position, to: position, input: data) diff --git a/src/parsers/if.cr b/src/parsers/if.cr index 3283295d3..e1180d812 100644 --- a/src/parsers/if.cr +++ b/src/parsers/if.cr @@ -21,23 +21,18 @@ module Mint condition = expression! IfExpectedCondition whitespace char ')', IfExpectedClosingParentheses + whitespace - truthy_head_comments, truthy, truthy_tail_comments = - block_with_comments( - opening_bracket: IfExpectedTruthyOpeningBracket, - closing_bracket: IfExpectedTruthyClosingBracket - ) do - if for_css - many { css_definition } - else - expression! IfExpectedTruthyExpression - end + truthy = + if for_css + block(SyntaxError, SyntaxError) { many { css_definition } } + else + code_block end - falsy_head_comments = [] of Ast::Comment - falsy_tail_comments = [] of Ast::Comment - falsy = nil + raise IfExpectedTruthyExpression unless truthy + falsy = nil whitespace if (!for_css && !for_html) || keyword_ahead "else" @@ -45,27 +40,20 @@ module Mint whitespace unless falsy = if_expression(for_css: for_css, for_html: for_html) - falsy_head_comments, falsy, falsy_tail_comments = - block_with_comments( - opening_bracket: IfExpectedFalsyOpeningBracket, - closing_bracket: IfExpectedFalsyClosingBracket - ) do - if for_css - many { css_definition } - else - expression! IfExpectedFalsyExpression - end + falsy = + if for_css + block(SyntaxError, SyntaxError) { many { css_definition } } + else + code_block end + + raise IfExpectedFalsyExpression unless falsy end end self << Ast::If.new( - truthy_head_comments: truthy_head_comments, - truthy_tail_comments: truthy_tail_comments, - falsy_head_comments: falsy_head_comments, - falsy_tail_comments: falsy_tail_comments, - condition: condition, branches: {truthy, falsy}, + condition: condition, from: start_position, to: position, input: data) diff --git a/src/parsers/statement.cr b/src/parsers/statement.cr index b656b05bd..f9c447815 100644 --- a/src/parsers/statement.cr +++ b/src/parsers/statement.cr @@ -2,11 +2,16 @@ module Mint class Parser def statement(parent : Ast::Statement::Parent, require_name : Bool = false) : Ast::Statement? start do |start_position| + await = keyword "await" + whitespace if await + target = start do value = variable(track: false) || tuple_destructuring whitespace + next unless keyword "=" next if char == '=' # Don't parse == operation as statement. + whitespace value end @@ -17,10 +22,11 @@ module Mint next unless body self << Ast::Statement.new( - expression: body, from: start_position, + expression: body, target: target, parent: parent, + await: await, to: position, input: data) end diff --git a/src/type_checkers/block.cr b/src/type_checkers/block.cr index c69fd559e..003e89542 100644 --- a/src/type_checkers/block.cr +++ b/src/type_checkers/block.cr @@ -1,18 +1,29 @@ module Mint class TypeChecker def check(node : Ast::Block) : Checkable - scope node.statements.reject(Ast::Comment) do + statements = + node.statements.reject(Ast::Comment) + + async = + node + .statements + .select(Ast::Statement) + .any?(&.await) + + scope statements do resolve node.statements end last = - node - .statements - .reject(Ast::Comment) + statements .sort_by! { |item| resolve_order.index(item) || -1 } .last - cache[last] + if async + Type.new("Promise", [cache[last]] of Checkable) + else + cache[last] + end end end end diff --git a/src/type_checkers/statement.cr b/src/type_checkers/statement.cr index b8c84308f..29dc06bcc 100644 --- a/src/type_checkers/statement.cr +++ b/src/type_checkers/statement.cr @@ -4,7 +4,11 @@ module Mint type_error StatementNotTuple def check(node : Ast::Statement) : Checkable - type = resolve node.expression + type = + resolve node.expression + + type = + type.parameters.first if node.await && type.name == "Promise" _check_statement_target(node.target, node, type) From fe0d06dddcd37d9eaf35474beea486390ae5f54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Thu, 7 Oct 2021 16:55:40 +0200 Subject: [PATCH 08/20] Convert more blocks to new code blocks. --- spec/parsers/catch_spec.cr | 8 ++++---- spec/parsers/for_spec.cr | 6 +++--- src/parsers/catch.cr | 8 +++++++- src/parsers/catch_all.cr | 8 +++++++- src/parsers/code_block.cr | 18 ++++++++++-------- src/parsers/for.cr | 8 +++++++- src/parsers/for_condition.cr | 8 +++++++- src/parsers/function.cr | 7 ++++++- src/parsers/if.cr | 22 ++++++++++++++++++---- src/parsers/inline_function.cr | 7 ++++++- 10 files changed, 75 insertions(+), 25 deletions(-) diff --git a/spec/parsers/catch_spec.cr b/spec/parsers/catch_spec.cr index 56352c718..d49b75a3c 100644 --- a/spec/parsers/catch_spec.cr +++ b/spec/parsers/catch_spec.cr @@ -14,10 +14,10 @@ describe "Catch" do expect_error "catch X ", Mint::Parser::CatchExpectedArrow expect_error "catch X =>", Mint::Parser::CatchExpectedVariable expect_error "catch X => ", Mint::Parser::CatchExpectedVariable - expect_error "catch X => a", Mint::SyntaxError - expect_error "catch X => a ", Mint::SyntaxError - expect_error "catch X => a {", Mint::SyntaxError - expect_error "catch X => a {a", Mint::SyntaxError + expect_error "catch X => a", Mint::Parser::CatchExpectedOpeningBracket + expect_error "catch X => a ", Mint::Parser::CatchExpectedOpeningBracket + expect_error "catch X => a {", Mint::Parser::CatchExpectedExpression + expect_error "catch X => a {a", Mint::Parser::CatchExpectedClosingBracket expect_ok "catch X => a { a }" end diff --git a/spec/parsers/for_spec.cr b/spec/parsers/for_spec.cr index bb7959aae..86e4dbf15 100644 --- a/spec/parsers/for_spec.cr +++ b/spec/parsers/for_spec.cr @@ -13,9 +13,9 @@ describe "For Expression" do expect_error "for (a, b", Mint::Parser::ForExpectedOf expect_error "for (a, b of", Mint::Parser::ForExpectedSubject expect_error "for (a, b of a", Mint::Parser::ForExpectedClosingParentheses - expect_error "for (a, b of a)", Mint::SyntaxError - expect_error "for (a, b of a) {", Mint::SyntaxError - expect_error "for (a, b of a) { x", Mint::SyntaxError + expect_error "for (a, b of a)", Mint::Parser::ForExpectedOpeningBracket + expect_error "for (a, b of a) {", Mint::Parser::ForExpectedBody + expect_error "for (a, b of a) { x", Mint::Parser::ForExpectedClosingBracket expect_error "for (a, b of a) { x } when", Mint::Parser::ForConditionExpectedOpeningBracket expect_error "for (a, b of a) { x } when {", Mint::Parser::ForConditionExpectedBody expect_error "for (a, b of a) { x } when { x", Mint::Parser::ForConditionExpectedClosingBracket diff --git a/src/parsers/catch.cr b/src/parsers/catch.cr index 5d456175d..689c0392a 100644 --- a/src/parsers/catch.cr +++ b/src/parsers/catch.cr @@ -1,5 +1,8 @@ module Mint class Parser + syntax_error CatchExpectedOpeningBracket + syntax_error CatchExpectedClosingBracket + syntax_error CatchExpectedExpression syntax_error CatchExpectedVariable syntax_error CatchExpectedArrow @@ -18,7 +21,10 @@ module Mint whitespace expression = - code_block + code_block( + opening_bracket: CatchExpectedOpeningBracket, + closing_bracket: CatchExpectedClosingBracket, + statement_error: CatchExpectedExpression) self << Ast::Catch.new( expression: expression, diff --git a/src/parsers/catch_all.cr b/src/parsers/catch_all.cr index 77c22909d..c5b8e490e 100644 --- a/src/parsers/catch_all.cr +++ b/src/parsers/catch_all.cr @@ -5,8 +5,14 @@ module Mint next unless keyword "catch" whitespace + expression = + code_block( + opening_bracket: CatchExpectedOpeningBracket, + closing_bracket: CatchExpectedClosingBracket, + statement_error: CatchExpectedExpression) + self << Ast::CatchAll.new( - expression: code_block, + expression: expression, from: start_position, to: position, input: data) diff --git a/src/parsers/code_block.cr b/src/parsers/code_block.cr index 4e008533a..4a1419151 100644 --- a/src/parsers/code_block.cr +++ b/src/parsers/code_block.cr @@ -1,15 +1,17 @@ module Mint class Parser - def code_block : Ast::Block? + def code_block(opening_bracket : SyntaxError.class, + closing_bracket : SyntaxError.class, + statement_error : SyntaxError.class = SyntaxError) : Ast::Block? start do |start_position| - char '{', SyntaxError - whitespace - statements = - many { comment || statement(:none) } - - whitespace - char '}', SyntaxError + block( + opening_bracket: opening_bracket, + closing_bracket: closing_bracket) do + many { comment || statement(:none) }.tap do |items| + raise statement_error if items.select(Ast::Statement).none? + end + end self << Ast::Block.new( statements: statements, diff --git a/src/parsers/for.cr b/src/parsers/for.cr index d5f85eebf..52333d6bc 100644 --- a/src/parsers/for.cr +++ b/src/parsers/for.cr @@ -2,7 +2,10 @@ module Mint class Parser syntax_error ForExpectedOpeningParentheses syntax_error ForExpectedClosingParentheses + syntax_error ForExpectedOpeningBracket + syntax_error ForExpectedClosingBracket syntax_error ForExpectedSubject + syntax_error ForExpectedBody syntax_error ForExpectedOf def for_expression : Ast::For? @@ -30,7 +33,10 @@ module Mint whitespace body = - code_block + code_block( + opening_bracket: ForExpectedOpeningBracket, + closing_bracket: ForExpectedClosingBracket, + statement_error: ForExpectedBody) whitespace condition = for_condition diff --git a/src/parsers/for_condition.cr b/src/parsers/for_condition.cr index d9ded1eeb..2b48d7db8 100644 --- a/src/parsers/for_condition.cr +++ b/src/parsers/for_condition.cr @@ -9,8 +9,14 @@ module Mint next unless keyword "when" whitespace + condition = + code_block( + opening_bracket: ForConditionExpectedOpeningBracket, + closing_bracket: ForConditionExpectedClosingBracket, + statement_error: ForConditionExpectedBody) + self << Ast::ForCondition.new( - condition: code_block, + condition: condition, from: start_position, to: position, input: data) diff --git a/src/parsers/function.cr b/src/parsers/function.cr index 3e1df2141..55f97952f 100644 --- a/src/parsers/function.cr +++ b/src/parsers/function.cr @@ -38,13 +38,18 @@ module Mint item end + body = + code_block( + opening_bracket: SyntaxError, + closing_bracket: SyntaxError) + self << Ast::Function.new( arguments: arguments, from: start_position, comment: comment, - body: code_block, to: position, input: data, + body: body, name: name, type: type) end diff --git a/src/parsers/if.cr b/src/parsers/if.cr index e1180d812..bd3d16f31 100644 --- a/src/parsers/if.cr +++ b/src/parsers/if.cr @@ -25,9 +25,16 @@ module Mint truthy = if for_css - block(SyntaxError, SyntaxError) { many { css_definition } } + block( + opening_bracket: IfExpectedTruthyOpeningBracket, + closing_bracket: IfExpectedTruthyClosingBracket) do + many { css_definition } + end else - code_block + code_block( + opening_bracket: IfExpectedTruthyOpeningBracket, + closing_bracket: IfExpectedTruthyClosingBracket, + statement_error: IfExpectedTruthyExpression) end raise IfExpectedTruthyExpression unless truthy @@ -42,9 +49,16 @@ module Mint unless falsy = if_expression(for_css: for_css, for_html: for_html) falsy = if for_css - block(SyntaxError, SyntaxError) { many { css_definition } } + block( + opening_bracket: IfExpectedFalsyOpeningBracket, + closing_bracket: IfExpectedFalsyClosingBracket) do + many { css_definition } + end else - code_block + code_block( + opening_bracket: IfExpectedFalsyOpeningBracket, + closing_bracket: IfExpectedFalsyClosingBracket, + statement_error: IfExpectedFalsyExpression) end raise IfExpectedFalsyExpression unless falsy diff --git a/src/parsers/inline_function.cr b/src/parsers/inline_function.cr index cd719ed80..a93cbd9c4 100644 --- a/src/parsers/inline_function.cr +++ b/src/parsers/inline_function.cr @@ -29,12 +29,17 @@ module Mint item end + body = + code_block( + opening_bracket: SyntaxError, + closing_bracket: SyntaxError) + self << Ast::InlineFunction.new( arguments: arguments, from: start_position, - body: code_block, to: position, input: data, + body: body, type: type) end end From 2a5810ebeb6e9d7cc67c8b15e9ff10784d56c778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Thu, 7 Oct 2021 17:41:10 +0200 Subject: [PATCH 09/20] Update the last batch of code blocks to the new format. --- core/source/Provider/Intersection.mint | 4 +++- shard.lock | 6 +++--- spec/parsers/get_spec.cr | 2 +- src/ast/finally.cr | 6 ++---- src/ast/get.cr | 6 ++---- src/ast/route.cr | 6 ++---- src/ast/test.cr | 6 ++---- src/ast/then.cr | 6 ++---- src/compilers/get.cr | 2 +- src/formatters/finally.cr | 2 +- src/formatters/get.cr | 2 +- src/formatters/route.cr | 2 +- src/formatters/test.cr | 2 +- src/formatters/then.cr | 2 +- src/parsers/finally.cr | 13 +++++-------- src/parsers/get.cr | 13 +++++-------- src/parsers/route.cr | 14 ++++++-------- src/parsers/test.cr | 13 +++++-------- src/parsers/then.cr | 13 +++++-------- 19 files changed, 49 insertions(+), 71 deletions(-) diff --git a/core/source/Provider/Intersection.mint b/core/source/Provider/Intersection.mint index 8bc42865e..ca4264b2f 100644 --- a/core/source/Provider/Intersection.mint +++ b/core/source/Provider/Intersection.mint @@ -61,7 +61,9 @@ provider Provider.Intersection : Provider.Intersection.Subscription { |> Array.select( ( item : Tuple(Provider.Intersection.Subscription, IntersectionObserver) - ) { item[0] == subscription }) + ) { + item[0] == subscription + }) |> Array.size() (size == 0) diff --git a/shard.lock b/shard.lock index 85664c459..c50cb66b1 100644 --- a/shard.lock +++ b/shard.lock @@ -2,11 +2,11 @@ version: 2.0 shards: admiral: git: https://github.com/jwaldrip/admiral.cr.git - version: 1.11.4 + version: 1.11.5 ameba: git: https://github.com/crystal-ameba/ameba.git - version: 0.14.2 + version: 0.14.3 baked_file_system: git: https://github.com/schovi/baked_file_system.git @@ -30,7 +30,7 @@ shards: markd: git: https://github.com/icyleaf/markd.git - version: 0.4.0 + version: 0.4.1 radix: git: https://github.com/luislavena/radix.git diff --git a/spec/parsers/get_spec.cr b/spec/parsers/get_spec.cr index fad9f218f..81a0e89d1 100644 --- a/spec/parsers/get_spec.cr +++ b/spec/parsers/get_spec.cr @@ -16,7 +16,7 @@ describe "Component Get" do expect_error "get a : T ", Mint::Parser::GetExpectedOpeningBracket expect_error "get a : T {", Mint::Parser::GetExpectedExpression expect_error "get a : T { ", Mint::Parser::GetExpectedExpression - expect_error "get a : T { a .", Mint::Parser::GetExpectedClosingBracket + expect_error "get a : T { a ", Mint::Parser::GetExpectedClosingBracket expect_ok "get a { a}" expect_ok "get a : T { a}" diff --git a/src/ast/finally.cr b/src/ast/finally.cr index 88c4aa751..5beae5f76 100644 --- a/src/ast/finally.cr +++ b/src/ast/finally.cr @@ -1,11 +1,9 @@ module Mint class Ast class Finally < Node - getter expression, head_comments, tail_comments + getter expression - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @expression : Expression, + def initialize(@expression : Expression, @input : Data, @from : Int32, @to : Int32) diff --git a/src/ast/get.cr b/src/ast/get.cr index 8a50b03ae..f49b78d27 100644 --- a/src/ast/get.cr +++ b/src/ast/get.cr @@ -1,11 +1,9 @@ module Mint class Ast class Get < Node - getter name, body, type, comment, head_comments, tail_comments + getter name, body, type, comment - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @type : TypeOrVariable?, + def initialize(@type : TypeOrVariable?, @comment : Comment?, @body : Expression, @name : Variable, diff --git a/src/ast/route.cr b/src/ast/route.cr index 17f6adf6b..482446fde 100644 --- a/src/ast/route.cr +++ b/src/ast/route.cr @@ -1,11 +1,9 @@ module Mint class Ast class Route < Node - getter url, expression, arguments, head_comments, tail_comments + getter url, expression, arguments - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @arguments : Array(Argument), + def initialize(@arguments : Array(Argument), @expression : Expression, @input : Data, @from : Int32, diff --git a/src/ast/test.cr b/src/ast/test.cr index c0bc3eaea..bf678da91 100644 --- a/src/ast/test.cr +++ b/src/ast/test.cr @@ -1,11 +1,9 @@ module Mint class Ast class Test < Node - getter name, expression, head_comments, tail_comments + getter name, expression - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @expression : Expression, + def initialize(@expression : Expression, @name : StringLiteral, @input : Data, @from : Int32, diff --git a/src/ast/then.cr b/src/ast/then.cr index 74180dac2..b0b2380db 100644 --- a/src/ast/then.cr +++ b/src/ast/then.cr @@ -1,11 +1,9 @@ module Mint class Ast class Then < Node - getter expression, head_comments, tail_comments + getter expression - def initialize(@head_comments : Array(Comment), - @tail_comments : Array(Comment), - @expression : Expression, + def initialize(@expression : Expression, @input : Data, @from : Int32, @to : Int32) diff --git a/src/compilers/get.cr b/src/compilers/get.cr index b92f62620..6d8014a51 100644 --- a/src/compilers/get.cr +++ b/src/compilers/get.cr @@ -12,7 +12,7 @@ module Mint name = js.variable_of(node) - js.get(name, js.return(body)) + js.get(name, body) end end end diff --git a/src/formatters/finally.cr b/src/formatters/finally.cr index 8cdc0dd71..d77c5c623 100644 --- a/src/formatters/finally.cr +++ b/src/formatters/finally.cr @@ -2,7 +2,7 @@ module Mint class Formatter def format(node : Ast::Finally) : String body = - list [node.expression] + node.head_comments + node.tail_comments + format node.expression "finally {\n#{indent(body)}\n}" end diff --git a/src/formatters/get.cr b/src/formatters/get.cr index 278e52eeb..f9e94cada 100644 --- a/src/formatters/get.cr +++ b/src/formatters/get.cr @@ -10,7 +10,7 @@ module Mint end body = - list [node.body] + node.head_comments + node.tail_comments + format node.body comment = node.comment.try { |item| "#{format(item)}\n" } diff --git a/src/formatters/route.cr b/src/formatters/route.cr index d2f0bfda2..56ae36d46 100644 --- a/src/formatters/route.cr +++ b/src/formatters/route.cr @@ -2,7 +2,7 @@ module Mint class Formatter def format(node : Ast::Route) : String body = - list [node.expression] + node.head_comments + node.tail_comments + format node.expression args = format node.arguments, ", " diff --git a/src/formatters/test.cr b/src/formatters/test.cr index 9740944ac..6b5c3124f 100644 --- a/src/formatters/test.cr +++ b/src/formatters/test.cr @@ -2,7 +2,7 @@ module Mint class Formatter def format(node : Ast::Test) : String expression = - list [node.expression] + node.head_comments + node.tail_comments + format node.expression name = format node.name diff --git a/src/formatters/then.cr b/src/formatters/then.cr index bf1ee1d88..7481a0a8a 100644 --- a/src/formatters/then.cr +++ b/src/formatters/then.cr @@ -2,7 +2,7 @@ module Mint class Formatter def format(node : Ast::Then) : String body = - list [node.expression] + node.head_comments + node.tail_comments + format node.expression "then {\n#{indent(body)}\n}" end diff --git a/src/parsers/finally.cr b/src/parsers/finally.cr index f7f11fcc4..1b19e9521 100644 --- a/src/parsers/finally.cr +++ b/src/parsers/finally.cr @@ -10,17 +10,14 @@ module Mint next unless keyword "finally" - head_comments, expression, tail_comments = block_with_comments( + expression = code_block( opening_bracket: FinallyExpectedOpeningBracket, - closing_bracket: FinallyExpectedClosingBracket - ) do - expression! FinallyExpectedExpression - end + closing_bracket: FinallyExpectedClosingBracket, + statement_error: FinallyExpectedExpression, + ) self << Ast::Finally.new( - expression: expression.as(Ast::Expression), - head_comments: head_comments, - tail_comments: tail_comments, + expression: expression, from: start_position, to: position, input: data) diff --git a/src/parsers/get.cr b/src/parsers/get.cr index 2b8453540..54593ab7b 100644 --- a/src/parsers/get.cr +++ b/src/parsers/get.cr @@ -25,18 +25,15 @@ module Mint item end - head_comments, body, tail_comments = block_with_comments( - opening_bracket: GetExpectedOpeningBracket, - closing_bracket: GetExpectedClosingBracket - ) do - expression! GetExpectedExpression - end + body = + code_block( + opening_bracket: GetExpectedOpeningBracket, + closing_bracket: GetExpectedClosingBracket, + statement_error: GetExpectedExpression) whitespace self << Ast::Get.new( - head_comments: head_comments, - tail_comments: tail_comments, from: start_position, comment: comment, to: position, diff --git a/src/parsers/route.cr b/src/parsers/route.cr index e6a541d20..4552d0f02 100644 --- a/src/parsers/route.cr +++ b/src/parsers/route.cr @@ -26,18 +26,16 @@ module Mint arguments = list(terminator: ')', separator: ',') { argument } whitespace char ')', RouteExpectedClosingParentheses + whitespace end - head_comments, body, tail_comments = block_with_comments( - opening_bracket: RouteExpectedOpeningBracket, - closing_bracket: RouteExpectedClosingBracket - ) do - expression! RouteExpectedExpression - end + body = + code_block( + opening_bracket: RouteExpectedOpeningBracket, + closing_bracket: RouteExpectedClosingBracket, + statement_error: RouteExpectedExpression) self << Ast::Route.new( - head_comments: head_comments, - tail_comments: tail_comments, arguments: arguments, from: start_position, expression: body, diff --git a/src/parsers/test.cr b/src/parsers/test.cr index dac6f5c13..8765f569e 100644 --- a/src/parsers/test.cr +++ b/src/parsers/test.cr @@ -16,16 +16,13 @@ module Mint whitespace - head_comments, expression, tail_comments = block_with_comments( - opening_bracket: TestExpectedOpeningBracket, - closing_bracket: TestExpectedClosingBracket - ) do - expression! TestExpectedExpression - end + expression = + code_block( + opening_bracket: TestExpectedOpeningBracket, + closing_bracket: TestExpectedClosingBracket, + statement_error: TestExpectedExpression) self << Ast::Test.new( - head_comments: head_comments, - tail_comments: tail_comments, expression: expression, from: start_position, to: position, diff --git a/src/parsers/then.cr b/src/parsers/then.cr index f2236d276..796163f41 100644 --- a/src/parsers/then.cr +++ b/src/parsers/then.cr @@ -10,17 +10,14 @@ module Mint next unless keyword "then" - head_comments, expression, tail_comments = block_with_comments( - opening_bracket: ThenExpectedOpeningBracket, - closing_bracket: ThenExpectedClosingBracket - ) do - expression! ThenExpectedExpression - end + expression = + code_block( + opening_bracket: ThenExpectedOpeningBracket, + closing_bracket: ThenExpectedClosingBracket, + statement_error: ThenExpectedExpression) self << Ast::Then.new( expression: expression.as(Ast::Expression), - head_comments: head_comments, - tail_comments: tail_comments, from: start_position, to: position, input: data) From 599a6b6bbf8be7d98354ea60e37b618d73c9b4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Fri, 8 Oct 2021 08:59:02 +0200 Subject: [PATCH 10/20] Allow using block as an expression. --- core/source/Dom.mint | 11 ++-- core/source/File.mint | 50 +++++++++---------- core/source/Provider/ElementSize.mint | 9 ++-- core/source/Provider/Intersection.mint | 9 ++-- core/source/Provider/MediaQuery.mint | 9 ++-- core/source/Provider/Mouse.mint | 12 ++--- core/source/Provider/Mutation.mint | 9 ++-- core/source/Provider/Websocket.mint | 11 ++-- core/source/ResizeObserver.mint | 2 +- core/source/Validation.mint | 23 ++++----- spec/compilers/block_with_tuple_destructuring | 16 ++++++ src/compilers/statement.cr | 14 +++++- src/parsers/basic_expression.cr | 14 ++++-- 13 files changed, 107 insertions(+), 82 deletions(-) create mode 100644 spec/compilers/block_with_tuple_destructuring diff --git a/core/source/Dom.mint b/core/source/Dom.mint index 650c392fa..cff382fd6 100644 --- a/core/source/Dom.mint +++ b/core/source/Dom.mint @@ -212,13 +212,12 @@ module Dom { Returns if the given base element contains the given element (as a maybe). case (Dom.getElementBySelector("body")) { - Maybe::Just(body) => - try { - div = - Dom.getElementBySelector("div") + Maybe::Just(body) => { + div = + Dom.getElementBySelector("div") - Dom.contains(div, body) == true - } + Dom.contains(div, body) == true + } => false } diff --git a/core/source/File.mint b/core/source/File.mint index fd7ecd6ac..388bb6f85 100644 --- a/core/source/File.mint +++ b/core/source/File.mint @@ -45,8 +45,8 @@ module File { * The mime type can be restricted to the given one. * It might not resolve if the user cancels the dialog. - sequence { - files = + { + await files = File.selectMultiple("application/json") Debug.log(files) @@ -86,8 +86,8 @@ module File { * The mime type can be restricted to the given one. * It might not resolve if the user cancels the dialog. - sequence { - file = + { + await file = File.select("application/json") Debug.log(file) @@ -123,8 +123,8 @@ module File { /* Reads the contents of the given file as a Data URL. - sequence { - file = + { + await file = File.fromString("Some content...", "test.txt", "text/plain") url = @@ -150,8 +150,8 @@ module File { /* Reads the contents of the given file as a String. - sequence { - file = + { + await file = File.create("Some content...", "test.txt", "text/plain") url = @@ -177,28 +177,26 @@ module File { /* Prompts a save dialog for the given file. - sequence { - file = + { + await file = File.select(*) File.download(file) } */ - fun download (file : File) : Promise(Never, Void) { - sequence { - url = - Url.createObjectUrlFromFile(file) - - ` - (() => { - const anchor = document.createElement('a'); - anchor.download = #{file}.name; - anchor.href = #{url}; - anchor.click(); - })() - ` - - Url.revokeObjectUrl(url) - } + fun download (file : File) : Void { + url = + Url.createObjectUrlFromFile(file) + + ` + (() => { + const anchor = document.createElement('a'); + anchor.download = #{file}.name; + anchor.href = #{url}; + anchor.click(); + })() + ` + + Url.revokeObjectUrl(url) } } diff --git a/core/source/Provider/ElementSize.mint b/core/source/Provider/ElementSize.mint index 45003ebc8..308e79cad 100644 --- a/core/source/Provider/ElementSize.mint +++ b/core/source/Provider/ElementSize.mint @@ -33,11 +33,10 @@ provider Provider.ElementSize : Provider.ElementSize.Subscription { for (subscription of subscriptions) { case (subscription.element) { - Maybe::Just(element) => - try { - ResizeObserver.observe(element, observer) - void - } + Maybe::Just(element) => { + ResizeObserver.observe(element, observer) + void + } Maybe::Nothing => void } diff --git a/core/source/Provider/Intersection.mint b/core/source/Provider/Intersection.mint index ca4264b2f..5a368eefb 100644 --- a/core/source/Provider/Intersection.mint +++ b/core/source/Provider/Intersection.mint @@ -26,11 +26,10 @@ provider Provider.Intersection : Provider.Intersection.Subscription { Maybe::Just({subscription, observer}) } else { case (subscription.element) { - Maybe::Just(observed) => - try { - IntersectionObserver.unobserve(observed, observer) - Maybe::Nothing - } + Maybe::Just(observed) => { + IntersectionObserver.unobserve(observed, observer) + Maybe::Nothing + } => Maybe::Nothing } diff --git a/core/source/Provider/MediaQuery.mint b/core/source/Provider/MediaQuery.mint index bc8807603..63ddfe7f6 100644 --- a/core/source/Provider/MediaQuery.mint +++ b/core/source/Provider/MediaQuery.mint @@ -57,11 +57,10 @@ provider Provider.MediaQuery : Provider.MediaQuery.Subscription { case (subscription) { Maybe::Just => memo - Maybe::Nothing => - try { - listener() - Map.delete(query, memo) - } + Maybe::Nothing => { + listener() + Map.delete(query, memo) + } } }) diff --git a/core/source/Provider/Mouse.mint b/core/source/Provider/Mouse.mint index cd2c4cee3..4c70e9e7b 100644 --- a/core/source/Provider/Mouse.mint +++ b/core/source/Provider/Mouse.mint @@ -17,14 +17,12 @@ provider Provider.Mouse : Provider.Mouse.Subscription { ( methods : Tuple(Function(Void), Function(Void), Function(Void)) ) { - try { - {clickListener, moveListener, upListener} = - methods + {clickListener, moveListener, upListener} = + methods - clickListener() - moveListener() - upListener() - } + clickListener() + moveListener() + upListener() }, listeners) diff --git a/core/source/Provider/Mutation.mint b/core/source/Provider/Mutation.mint index 4c7f204eb..96a78b901 100644 --- a/core/source/Provider/Mutation.mint +++ b/core/source/Provider/Mutation.mint @@ -43,11 +43,10 @@ provider Provider.Mutation : Provider.Mutation.Subscription { /* For each subscription observe the given elements. */ for (subscription of subscriptions) { case (subscription.element) { - Maybe::Just(element) => - try { - MutationObserver.observe(element, true, true, observer) - subscription.changes() - } + Maybe::Just(element) => { + MutationObserver.observe(element, true, true, observer) + subscription.changes() + } Maybe::Nothing => next { } } diff --git a/core/source/Provider/Websocket.mint b/core/source/Provider/Websocket.mint index 91269265b..5156aa741 100644 --- a/core/source/Provider/Websocket.mint +++ b/core/source/Provider/Websocket.mint @@ -93,13 +93,12 @@ provider Provider.WebSocket : WebSocket.Config { (config : WebSocket.Config) { config.url == url }) case (subscription) { - Maybe::Just => memo + Maybe::Nothing => { + WebSocket.closeWithoutReconnecting(socket) + Map.delete(url, memo) + } - Maybe::Nothing => - try { - WebSocket.closeWithoutReconnecting(socket) - Map.delete(url, memo) - } + Maybe::Just => memo } }) diff --git a/core/source/ResizeObserver.mint b/core/source/ResizeObserver.mint index 557a6fdb7..05c954bae 100644 --- a/core/source/ResizeObserver.mint +++ b/core/source/ResizeObserver.mint @@ -22,7 +22,7 @@ module ResizeObserver { new ResizeObserver((entries) => { const values = entries.map((item) => { return #{ - try { + { dimensions = decode (`item.contentRect`) as Dom.Dimensions |> Result.withDefault(Dom.Dimensions.empty()) diff --git a/core/source/Validation.mint b/core/source/Validation.mint index dbcfc3d17..4d82f5c73 100644 --- a/core/source/Validation.mint +++ b/core/source/Validation.mint @@ -182,18 +182,17 @@ module Validation { item : Maybe(Tuple(String, String)) ) : Map(String, Array(String)) { case (item) { - Maybe::Just(error) => - try { - {key, message} = - error - - messages = - memo - |> Map.get(key) - |> Maybe.withDefault([]) - - Map.set(key, Array.push(message, messages), memo) - } + Maybe::Just(error) => { + {key, message} = + error + + messages = + memo + |> Map.get(key) + |> Maybe.withDefault([]) + + Map.set(key, Array.push(message, messages), memo) + } => memo } diff --git a/spec/compilers/block_with_tuple_destructuring b/spec/compilers/block_with_tuple_destructuring new file mode 100644 index 000000000..386d70b12 --- /dev/null +++ b/spec/compilers/block_with_tuple_destructuring @@ -0,0 +1,16 @@ +component Main { + fun render : String { + {a, b} = {"Some string...", "B"} + + a + ", other string..." + } +} +-------------------------------------------------------------------------------- +class A extends _C { + render() { + const [a,b] = [`Some string...`, `B`]; + return a + `, other string...`; + } +}; + +A.displayName = "Main"; diff --git a/src/compilers/statement.cr b/src/compilers/statement.cr index a6c41a3bb..eed7d441f 100644 --- a/src/compilers/statement.cr +++ b/src/compilers/statement.cr @@ -5,7 +5,19 @@ module Mint right = "await #{right}" if node.await if node.parent == Ast::Statement::Parent::None && (target = node.target) - js.const js.variable_of(target), right + case target + when Ast::Variable + js.const(js.variable_of(target), right) + when Ast::TupleDestructuring + variables = + target + .parameters + .join(',') { |param| js.variable_of(param) } + + "const [#{variables}] = #{right}" + else + right + end else right end diff --git a/src/parsers/basic_expression.cr b/src/parsers/basic_expression.cr index 97819b969..661bc09c0 100644 --- a/src/parsers/basic_expression.cr +++ b/src/parsers/basic_expression.cr @@ -15,7 +15,7 @@ module Mint unary_minus || array || record_update || - tuple_literal_or_record || + tuple_literal_or_record_or_block || html_element || html_expression || html_component || @@ -40,10 +40,18 @@ module Mint variable end - def tuple_literal_or_record : Ast::TupleLiteral | Ast::Record? + def tuple_literal_or_record_or_block : Ast::TupleLiteral | Ast::Record? tuple_literal rescue - record + begin + record + rescue error + begin + code_block(SyntaxError, SyntaxError) + rescue + raise error + end + end end def starts_with_uppercase From c04b8e9c58340cae2d4d03a4b982ca8e1b2530c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Fri, 8 Oct 2021 09:30:29 +0200 Subject: [PATCH 11/20] Remove references to `try` feature. --- core/tests/tests/Array.mint | 82 +++++++-------- core/tests/tests/Dom.mint | 30 +++--- core/tests/tests/Encoding.mint | 62 ++++++------ core/tests/tests/Html/DataTransfer.mint | 20 ++-- core/tests/tests/Http.mint | 10 +- core/tests/tests/Map.mint | 96 ++++++++---------- core/tests/tests/Math.mint | 8 +- core/tests/tests/Object/Encode.mint | 20 ++-- core/tests/tests/Promise.mint | 34 +++---- core/tests/tests/Storage/Local.mint | 118 +++++++++------------- core/tests/tests/Storage/Session.mint | 126 ++++++++++-------------- core/tests/tests/Url.mint | 22 +---- core/tests/tests/Window.mint | 31 ++---- src/type_checkers/variable.cr | 4 +- 14 files changed, 273 insertions(+), 390 deletions(-) diff --git a/core/tests/tests/Array.mint b/core/tests/tests/Array.mint index fd631c4c9..83cadbc9b 100644 --- a/core/tests/tests/Array.mint +++ b/core/tests/tests/Array.mint @@ -313,43 +313,37 @@ suite "Array.reduceRight" { suite "Array.flatMap" { test "maps over a nested array and flattens" { - try { - result = - [[3, 1], [2, 0], [5]] - |> Array.flatMap( - (n : Array(Number)) : Array(Number) { - [ - Array.max(n) - |> Maybe.withDefault(0) - ] - }) + result = + [[3, 1], [2, 0], [5]] + |> Array.flatMap( + (n : Array(Number)) : Array(Number) { + [ + Array.max(n) + |> Maybe.withDefault(0) + ] + }) - result == [3, 2, 5] - } + result == [3, 2, 5] } } suite "Array.take" { test "take n number of items" { - try { - result = - [1, 2, 3, 4, 5, 6, 7, 8] - |> Array.take(2) + result = + [1, 2, 3, 4, 5, 6, 7, 8] + |> Array.take(2) - result == [1, 2] - } + result == [1, 2] } } suite "Array.drop" { test "drop n number of items" { - try { - result = - [1, 2, 3, 4, 5, 6, 7, 8] - |> Array.drop(2) + result = + [1, 2, 3, 4, 5, 6, 7, 8] + |> Array.drop(2) - result == [3, 4, 5, 6, 7, 8] - } + result == [3, 4, 5, 6, 7, 8] } } @@ -365,34 +359,30 @@ suite "Array.dropRight" { suite "Array.groupsOf" { test "group into items of specified size" { - try { - result = - [1, 2, 3, 4, 5, 6, 7, 8] - |> Array.groupsOf(2) + result = + [1, 2, 3, 4, 5, 6, 7, 8] + |> Array.groupsOf(2) - (result == [ - [1, 2], - [3, 4], - [5, 6], - [7, 8] - ]) - } + (result == [ + [1, 2], + [3, 4], + [5, 6], + [7, 8] + ]) } } suite "Array.groupsOfFromEnd" { test "group into items of specified size" { - try { - result = - Array.groupsOfFromEnd(2, [1, 2, 3, 4, 5, 6, 7]) - - (result == [ - [1], - [2, 3], - [4, 5], - [6, 7] - ]) - } + result = + Array.groupsOfFromEnd(2, [1, 2, 3, 4, 5, 6, 7]) + + (result == [ + [1], + [2, 3], + [4, 5], + [6, 7] + ]) } } diff --git a/core/tests/tests/Dom.mint b/core/tests/tests/Dom.mint index 72f61e3f4..5a5dcc9b2 100644 --- a/core/tests/tests/Dom.mint +++ b/core/tests/tests/Dom.mint @@ -1,11 +1,9 @@ suite "Dom.createElement" { test "returns a Dom element" { - try { - element = - Dom.createElement("div") + element = + Dom.createElement("div") - `#{element}.tagName === "DIV"` - } + `#{element}.tagName === "DIV"` } } @@ -53,24 +51,20 @@ suite "Dom.getElementBySelector" { suite "Dom.getDimensions" { test "returns dimensions" { - try { - dimensions = - Dom.createElement("div") - |> Dom.getDimensions() + dimensions = + Dom.createElement("div") + |> Dom.getDimensions() - Dom.Dimensions.empty() == dimensions - } + Dom.Dimensions.empty() == dimensions } test "returns actual dimensions" { - try { - dimensions = - Dom.getElementById("root") - |> Maybe.withLazyDefault(() { Dom.createElement("div") }) - |> Dom.getDimensions() + dimensions = + Dom.getElementById("root") + |> Maybe.withLazyDefault(() { Dom.createElement("div") }) + |> Dom.getDimensions() - dimensions.width != 0 - } + dimensions.width != 0 } } diff --git a/core/tests/tests/Encoding.mint b/core/tests/tests/Encoding.mint index 8cd09e0d2..212332158 100644 --- a/core/tests/tests/Encoding.mint +++ b/core/tests/tests/Encoding.mint @@ -43,46 +43,40 @@ suite "Encode" { } test "it encodes Map(String, a) as object" { - try { - map = - Map.empty() - |> Map.set("key", "value") - |> Map.set("key2", "value2") - - encoded = - encode map - - ` - typeof #{encoded} == "object" && - #{encoded}.key === "value" && - #{encoded}.key2 === "value2" - ` - } + map = + Map.empty() + |> Map.set("key", "value") + |> Map.set("key2", "value2") + + encoded = + encode map + + ` + typeof #{encoded} == "object" && + #{encoded}.key === "value" && + #{encoded}.key2 === "value2" + ` } test "it encodes Array(a) as array" { - try { - encoded = - encode ["Hello"] + encoded = + encode ["Hello"] - `Array.isArray(#{encoded}) && #{encoded}[0] === "Hello"` - } + `Array.isArray(#{encoded}) && #{encoded}[0] === "Hello"` } test "it encodes a record (with nested fields)" { - try { - encoded = - encode { - field = "Mapped Field", - nested = { field = "Field" } - } - - ` - typeof #{encoded} == "object" && - #{encoded}.mapped_field === "Mapped Field" && - typeof #{encoded}.nested === "object" && - #{encoded}.nested.field === "Field" - ` - } + encoded = + encode { + field = "Mapped Field", + nested = { field = "Field" } + } + + ` + typeof #{encoded} == "object" && + #{encoded}.mapped_field === "Mapped Field" && + typeof #{encoded}.nested === "object" && + #{encoded}.nested.field === "Field" + ` } } diff --git a/core/tests/tests/Html/DataTransfer.mint b/core/tests/tests/Html/DataTransfer.mint index f3933d776..452f9d312 100644 --- a/core/tests/tests/Html/DataTransfer.mint +++ b/core/tests/tests/Html/DataTransfer.mint @@ -48,24 +48,20 @@ suite "Html.DataTransfer.getFiles" { suite "Html.DataTransfer.setData && Html.DataTransfer.getData" { test "it returns the value" { - try { - value = - `new DataTransfer()` - |> Html.DataTransfer.setData("text/plain", "Hello!") - |> Html.DataTransfer.getData("text/plain") + value = + `new DataTransfer()` as Html.DataTransfer + |> Html.DataTransfer.setData("text/plain", "Hello!") + |> Html.DataTransfer.getData("text/plain") - value == "Hello!" - } + value == "Hello!" } } suite "Html.DataTransfer.setDragImage" { test "it returns the value" { - try { - data = - `new DataTransfer()` as Html.DataTransfer + data = + `new DataTransfer()` as Html.DataTransfer - Html.DataTransfer.setDragImage(Dom.createElement("div"), 0, 0, data) == data - } + Html.DataTransfer.setDragImage(Dom.createElement("div"), 0, 0, data) == data } } diff --git a/core/tests/tests/Http.mint b/core/tests/tests/Http.mint index 7c5333846..74b12c97c 100644 --- a/core/tests/tests/Http.mint +++ b/core/tests/tests/Http.mint @@ -234,13 +234,11 @@ suite "Http.hasHeader" { suite "Http.sendWithId" { test "sends the request with the given ID" { - try { - response = - Http.get("/blah") - |> Http.sendWithId("A") + response = + Http.get("/blah") + |> Http.sendWithId("A") - `#{Http.requests()}["A"] != undefined` - } + `#{Http.requests()}["A"] != undefined` } } diff --git a/core/tests/tests/Map.mint b/core/tests/tests/Map.mint index dd5cbdf7c..80c1947e9 100644 --- a/core/tests/tests/Map.mint +++ b/core/tests/tests/Map.mint @@ -7,47 +7,41 @@ suite "Map with enums" { } test "Equality" { - try { - map1 = - Map.empty() - |> Map.set(Maybe::Just("a"), "x") + map1 = + Map.empty() + |> Map.set(Maybe::Just("a"), "x") - map2 = - Map.empty() - |> Map.set(Maybe::Just("a"), "x") + map2 = + Map.empty() + |> Map.set(Maybe::Just("a"), "x") - map1 == map2 - } + map1 == map2 } } suite "Map equality" { test "maps which are not equal returns false" { - try { - map1 = - Map.empty() - |> Map.set("a", "x") + map1 = + Map.empty() + |> Map.set("a", "x") - map2 = - Map.empty() - |> Map.set("a", "b") + map2 = + Map.empty() + |> Map.set("a", "b") - (map1 != map2) - } + map1 != map2 } test "maps which are equal returns true" { - try { - map1 = - Map.empty() - |> Map.set("a", "b") + map1 = + Map.empty() + |> Map.set("a", "b") - map2 = - Map.empty() - |> Map.set("a", "b") + map2 = + Map.empty() + |> Map.set("a", "b") - map1 == map2 - } + map1 == map2 } } @@ -85,35 +79,31 @@ suite "Map.get" { suite "Map.merge" { test "it merges two maps together" { - try { - a = - Map.empty() - |> Map.set("a", "b") - - b = - Map.empty() - |> Map.set("x", "y") - - (Map.merge(a, b) - |> Map.get("x") - |> Maybe.withDefault("")) == "y" - } + a = + Map.empty() + |> Map.set("a", "b") + + b = + Map.empty() + |> Map.set("x", "y") + + (Map.merge(a, b) + |> Map.get("x") + |> Maybe.withDefault("")) == "y" } test "send map has precedence" { - try { - a = - Map.empty() - |> Map.set("a", "b") - - b = - Map.empty() - |> Map.set("a", "y") - - (Map.merge(a, b) - |> Map.get("a") - |> Maybe.withDefault("")) == "y" - } + a = + Map.empty() + |> Map.set("a", "b") + + b = + Map.empty() + |> Map.set("a", "y") + + (Map.merge(a, b) + |> Map.get("a") + |> Maybe.withDefault("")) == "y" } } diff --git a/core/tests/tests/Math.mint b/core/tests/tests/Math.mint index debbd9a6c..ba9829226 100644 --- a/core/tests/tests/Math.mint +++ b/core/tests/tests/Math.mint @@ -88,11 +88,9 @@ suite "Math.truncate" { suite "Math.random" { test "it returns a pseudo-random number in the range 0 to less than 1" { - try { - n = - Math.random() + n = + Math.random() - n >= 0.0 && n < 1.0 - } + n >= 0.0 && n < 1.0 } } diff --git a/core/tests/tests/Object/Encode.mint b/core/tests/tests/Object/Encode.mint index d2ba6c5c1..51a91c715 100644 --- a/core/tests/tests/Object/Encode.mint +++ b/core/tests/tests/Object/Encode.mint @@ -24,26 +24,22 @@ suite "Object.Encode.time" { suite "Object.Encode.field" { test "encodes a key and vlaue to a field" { - try { - object = - Object.Encode.field("test", `"a"`) + object = + Object.Encode.field("test", `"a"`) - `#{object}.name == "test" && #{object}.value == "a"` - } + `#{object}.name == "test" && #{object}.value == "a"` } } suite "Object.Encode.object" { test "encodes an array of fields to an object" { - try { - encodedField = - Object.Encode.field("test", `"a"`) + encodedField = + Object.Encode.field("test", `"a"`) - encodedObject = - Object.Encode.object([encodedField]) + encodedObject = + Object.Encode.object([encodedField]) - `#{encodedObject}.test == "a"` - } + `#{encodedObject}.test == "a"` } } diff --git a/core/tests/tests/Promise.mint b/core/tests/tests/Promise.mint index cdc3ebde1..d6efd1a0e 100644 --- a/core/tests/tests/Promise.mint +++ b/core/tests/tests/Promise.mint @@ -41,24 +41,22 @@ component Test.Promise2 { state result : String = "" fun componentDidMount : Promise(Never, Void) { - try { - {resolve, reject, promise} = - Promise.create() - - sequence { - next - { - resolve = resolve, - reject = reject - } - - newResult = - promise - - next { result = newResult } - } catch { - next { result = "rejected" } - } + {resolve, reject, promise} = + Promise.create() + + sequence { + next + { + resolve = resolve, + reject = reject + } + + newResult = + promise + + next { result = newResult } + } catch { + next { result = "rejected" } } } diff --git a/core/tests/tests/Storage/Local.mint b/core/tests/tests/Storage/Local.mint index 6f3eb6a99..647cb81e4 100644 --- a/core/tests/tests/Storage/Local.mint +++ b/core/tests/tests/Storage/Local.mint @@ -5,125 +5,101 @@ suite "Storage.Local.set" { } test "sets the given value at the given key" { - try { - Storage.Local.set("test", "test") + Storage.Local.set("test", "test") - value = - Storage.Local.get("test") - - value == "test" - } catch Storage.Error => error { - false + case (Storage.Local.get("test")) { + Result::Ok(value) => value == "test" + Result::Err => false } } test "it returns error if over the qouta" { - try { - result = - Storage.Local.set("test", String.repeat(10000000, "test")) - |> Result.withError(Storage.Error::Unknown) + result = + Storage.Local.set("test", String.repeat(10000000, "test")) + |> Result.withError(Storage.Error::Unknown) - result == Storage.Error::QuotaExceeded - } + result == Storage.Error::QuotaExceeded } } suite "Storage.Local.get" { test "it returns the value if exists" { - try { - Storage.Local.set("test", "test") + Storage.Local.set("test", "test") - value = - Storage.Local.get("test") - - value == "test" - } catch Storage.Error => error { - false + case (Storage.Local.get("test")) { + Result::Ok(value) => value == "test" + Result::Err => false } } test "it returns nothing if the key does not exists" { - try { - value = - Storage.Local.get("test") - - false - } catch Storage.Error => error { - true + case (Storage.Local.get("test")) { + Result::Ok(value) => false + Result::Err => true } } } suite "Storage.Local.clear" { test "it clears all items" { - try { - Storage.Local.set("test", "test") + Storage.Local.set("test", "test") - initialSize = - Storage.Local.size() + initialSize = + Storage.Local.size() + |> Result.withDefault(-1) - Storage.Local.clear() + Storage.Local.clear() - afterSize = - Storage.Local.size() + afterSize = + Storage.Local.size() + |> Result.withDefault(-1) - (initialSize == 1 && afterSize == 0) - } catch Storage.Error => error { - false - } + (initialSize == 1 && afterSize == 0) } } suite "Storage.Local.remove" { test "it removes the item with the specified key" { - try { - Storage.Local.set("test", "test") + Storage.Local.set("test", "test") - initialSize = - Storage.Local.size() + initialSize = + Storage.Local.size() + |> Result.withDefault(-1) - Storage.Local.remove("test") + Storage.Local.remove("test") - afterSize = - Storage.Local.size() + afterSize = + Storage.Local.size() + |> Result.withDefault(-1) - (initialSize == 1 && afterSize == 0) - } catch Storage.Error => error { - false - } + (initialSize == 1 && afterSize == 0) } } suite "Storage.Local.size" { test "it returns the number of elements in the storage" { - try { - Storage.Local.set("a", "0") - Storage.Local.set("b", "1") - Storage.Local.set("c", "2") + Storage.Local.set("a", "0") + Storage.Local.set("b", "1") + Storage.Local.set("c", "2") - size = - Storage.Local.size() + size = + Storage.Local.size() + |> Result.withDefault(0) - size == 3 - } catch Storage.Error => error { - false - } + size == 3 } } suite "Storage.Local.keys" { test "it returns the keys of elements in the storage" { - try { - Storage.Local.set("c", "2") - Storage.Local.set("a", "0") - Storage.Local.set("b", "1") + Storage.Local.set("c", "2") + Storage.Local.set("a", "0") + Storage.Local.set("b", "1") - keys = - Storage.Local.keys() + keys = + Storage.Local.keys() + |> Result.withDefault([]) - String.join("", keys) == "abc" - } catch Storage.Error => error { - false - } + String.join("", keys) == "abc" } } diff --git a/core/tests/tests/Storage/Session.mint b/core/tests/tests/Storage/Session.mint index 8cfc60f9a..a0435d80b 100644 --- a/core/tests/tests/Storage/Session.mint +++ b/core/tests/tests/Storage/Session.mint @@ -5,125 +5,103 @@ suite "Storage.Session.set" { } test "sets the given value at the given key" { - try { - Storage.Session.set("test", "test") + Storage.Session.set("test", "test") - value = - Storage.Session.get("test") + value = + Storage.Session.get("test") + |> Result.withDefault("") - value == "test" - } catch Storage.Error => error { - false - } + value == "test" } test "it returns error if over the qouta" { - try { - result = - Storage.Session.set("test", String.repeat(10000000, "test")) - |> Result.withError(Storage.Error::Unknown) + result = + Storage.Session.set("test", String.repeat(10000000, "test")) + |> Result.withError(Storage.Error::Unknown) - result == Storage.Error::QuotaExceeded - } + result == Storage.Error::QuotaExceeded } } suite "Storage.Session.get" { test "it returns the value if exists" { - try { - Storage.Session.set("test", "test") + Storage.Session.set("test", "test") - value = - Storage.Session.get("test") + value = + Storage.Session.get("test") + |> Result.withDefault("") - value == "test" - } catch Storage.Error => error { - false - } + value == "test" } test "it returns nothing if the key does not exists" { - try { - value = - Storage.Session.get("test") - - false - } catch Storage.Error => error { - true + case (Storage.Session.get("test")) { + Result::Ok(value) => false + Result::Err => true } } } suite "Storage.Session.clear" { test "it clears all items" { - try { - Storage.Session.set("test", "test") + Storage.Session.set("test", "test") - initialSize = - Storage.Session.size() + initialSize = + Storage.Session.size() + |> Result.withDefault(-1) - Storage.Session.clear() + Storage.Session.clear() - afterSize = - Storage.Session.size() + afterSize = + Storage.Session.size() + |> Result.withDefault(-1) - (initialSize == 1 && afterSize == 0) - } catch Storage.Error => error { - false - } + (initialSize == 1 && afterSize == 0) } } suite "Storage.Session.remove" { test "it removes the item with the specified key" { - try { - Storage.Session.set("test", "test") + Storage.Session.set("test", "test") - initialSize = - Storage.Session.size() + initialSize = + Storage.Session.size() + |> Result.withDefault(-1) - Storage.Session.remove("test") + Storage.Session.remove("test") - afterSize = - Storage.Session.size() + afterSize = + Storage.Session.size() + |> Result.withDefault(-1) - (initialSize == 1 && afterSize == 0) - } catch Storage.Error => error { - false - } + (initialSize == 1 && afterSize == 0) } } suite "Storage.Session.size" { - test "it returns the number of elements in the storage" { - try { - Storage.Session.set("a", "0") - Storage.Session.set("b", "1") - Storage.Session.set("c", "2") - - size = - Storage.Session.size() - - size == 3 - } catch Storage.Error => error { - false - } +test "it returns the number of elements in the storage" { + Storage.Session.set("a", "0") + Storage.Session.set("b", "1") + Storage.Session.set("c", "2") + + size = + Storage.Session.size() + |> Result.withDefault(-1) + + size == 3 } } suite "Storage.Session.keys" { test "it returns the keys of elements in the storage" { - try { - Storage.Session.set("c", "2") - Storage.Session.set("a", "0") - Storage.Session.set("b", "1") + Storage.Session.set("c", "2") + Storage.Session.set("a", "0") + Storage.Session.set("b", "1") - keys = - Storage.Session.keys() + keys = + Storage.Session.keys() + |> Result.withDefault([]) - String.join("", keys) == "abc" - } catch Storage.Error => error { - false - } + String.join("", keys) == "abc" } } diff --git a/core/tests/tests/Url.mint b/core/tests/tests/Url.mint index b9e3d53a4..c62e39138 100644 --- a/core/tests/tests/Url.mint +++ b/core/tests/tests/Url.mint @@ -1,20 +1,10 @@ suite "Url.parse" { test "parses an url" { - try { - url = - Url.parse("http://www.google.com") - - url.host == "www.google.com" - } + Url.parse("http://www.google.com").host == "www.google.com" } test "parses an url" { - try { - url = - Url.parse("") - - url.path == "/" - } + Url.parse("").path == "/" } } @@ -33,11 +23,9 @@ suite "Url.createObjectUrlFromString" { suite "Url.revokeObjectUrl" { test "it revokes the given url" { - try { - Url.createObjectUrlFromString("Content", "text/html") - |> Url.revokeObjectUrl() + Url.createObjectUrlFromString("Content", "text/html") + |> Url.revokeObjectUrl() - true - } + true } } diff --git a/core/tests/tests/Window.mint b/core/tests/tests/Window.mint index 1929529b9..bdbdf128e 100644 --- a/core/tests/tests/Window.mint +++ b/core/tests/tests/Window.mint @@ -33,14 +33,12 @@ component ScrollTest { suite "Window.navigate" { test "it navigates to the given url with push state" { - try { - url = - Window.url() + url = + Window.url() - Window.navigate("/blah") + Window.navigate("/blah") - Window.href() == "http://127.0.0.1:#{url.port}/blah" - } + Window.href() == "http://127.0.0.1:#{url.port}/blah" } } @@ -52,33 +50,20 @@ suite "Window.title" { suite "Window.setTitle" { test "sets the windows title" { - try { - Window.setTitle("Test") - - Window.title() == "Test" - } + Window.setTitle("Test") + Window.title() == "Test" } } suite "Window.url" { test "returns the current url" { - try { - url = - Window.url() - - url.hostname == "127.0.0.1" - } + Window.url().hostname == "127.0.0.1" } } suite "Window.href" { test "returns the current url as string" { - try { - url = - Window.url() - - Window.href() == "http://127.0.0.1:#{url.port}/" - } + Window.href() == "http://127.0.0.1:#{Window.url().port}/" } } diff --git a/src/type_checkers/variable.cr b/src/type_checkers/variable.cr index 81059ad8a..6fd57f7d8 100644 --- a/src/type_checkers/variable.cr +++ b/src/type_checkers/variable.cr @@ -34,7 +34,9 @@ module Mint when Ast::Statement type = resolve value - if value.parent.try? + if value.parent.none? + type + elsif value.parent.try? if type.name == "Result" && type.parameters.size == 2 type.parameters[1] else From f8c4f86525d63bbcd588b55481928e4815335950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Fri, 8 Oct 2021 10:13:04 +0200 Subject: [PATCH 12/20] Remove try language feature. --- spec/compilers/argument | 12 +- spec/compilers/array_access | 16 +- spec/compilers/array_literal | 12 +- spec/compilers/bool_literal_false | 12 +- spec/compilers/bool_literal_true | 12 +- spec/compilers/case | 12 +- spec/compilers/case_with_enum_destructuring | 12 +- spec/compilers/catch | 12 +- spec/compilers/decode | 26 +-- spec/compilers/decoder | 26 +-- spec/compilers/directives/documentation | 12 +- spec/compilers/directives/format | 20 +- spec/compilers/encode | 12 +- spec/compilers/enum | 20 +- spec/compilers/finally | 12 +- spec/compilers/function | 12 +- spec/compilers/function_call_simple | 12 +- spec/compilers/function_call_with_arguments | 12 +- spec/compilers/if | 12 +- spec/compilers/inline_function_recursive | 12 +- spec/compilers/inline_function_with_arguments | 12 +- spec/compilers/inline_functions_recursive | 12 +- spec/compilers/member_access | 36 ++-- spec/compilers/module_access_subscriptions | 12 +- spec/compilers/next_call | 12 +- spec/compilers/number_literal_negative | 12 +- spec/compilers/number_literal_simple | 12 +- spec/compilers/number_literal_with_decimal | 12 +- spec/compilers/operation_chanined | 12 +- spec/compilers/operation_or | 12 +- spec/compilers/operation_simple | 12 +- spec/compilers/parallel_simple | 12 +- spec/compilers/parallel_with_catch | 12 +- spec/compilers/parallel_with_catch_all | 12 +- spec/compilers/parenthesized_expression | 12 +- spec/compilers/record | 12 +- spec/compilers/record_constructor | 18 +- spec/compilers/record_constructor_partial | 24 +-- spec/compilers/record_field | 12 +- spec/compilers/record_update | 12 +- spec/compilers/regexp_literal | 12 +- spec/compilers/sequence_simple | 12 +- spec/compilers/sequence_using_argument | 12 +- spec/compilers/sequence_with_argument | 12 +- spec/compilers/sequence_with_catch | 12 +- spec/compilers/sequence_with_finally | 12 +- spec/compilers/sequence_with_result_and_catch | 12 +- .../sequence_with_result_and_catch_all | 12 +- .../sequence_with_statement_reordering | 12 +- spec/compilers/statement | 14 +- spec/compilers/try | 17 -- spec/compilers/try_with_catch_all | 47 ----- spec/compilers/try_with_catches | 45 ----- .../try_with_catches_and_return_result | 81 -------- spec/compilers/try_with_statement | 21 -- spec/compilers/try_with_statement_reordering | 25 --- spec/compilers/tuple_literal | 12 +- spec/compilers/unary_minus | 12 +- spec/compilers/void | 12 +- spec/formatters/directives/documentation | 16 +- spec/formatters/directives/format | 18 +- spec/formatters/record_constructor | 16 +- .../record_constructor_with_new_line | 22 +-- spec/formatters/regexp_literal | 12 +- spec/formatters/statement | 16 +- spec/formatters/try | 13 -- spec/formatters/try_with_catch | 30 --- spec/formatters/try_with_catch_all | 35 ---- spec/formatters/try_with_comments | 16 -- spec/formatters/try_with_statement | 16 -- spec/parsers/case_spec.cr | 2 +- spec/parsers/statement_spec.cr | 2 +- spec/parsers/try_spec.cr | 18 -- spec/recursion_spec.cr | 12 +- spec/type_checking/array_access | 24 +-- spec/type_checking/array_literal | 18 +- spec/type_checking/bool_literal_false | 12 +- spec/type_checking/bool_literal_true | 12 +- spec/type_checking/case_type_unification | 12 +- spec/type_checking/catch | 35 ---- spec/type_checking/decode | 26 +-- spec/type_checking/directives/documentation | 12 +- spec/type_checking/directives/format | 12 +- spec/type_checking/finally | 12 +- spec/type_checking/function | 18 +- spec/type_checking/function_call | 71 +------ spec/type_checking/get | 12 +- .../type_checking/module_access_subscriptions | 6 +- spec/type_checking/module_call | 6 +- spec/type_checking/next_call | 12 +- spec/type_checking/record_constructor | 42 ++-- spec/type_checking/record_update | 24 +-- spec/type_checking/recursive | 18 +- spec/type_checking/sequence_with_catch | 36 ++-- spec/type_checking/statement | 12 +- spec/type_checking/store_call_with_next | 6 +- spec/type_checking/string_literal | 12 +- spec/type_checking/try | 11 -- spec/type_checking/try_with_catch | 180 ------------------ spec/type_checking/try_with_statement | 12 -- spec/type_checking/type_normalize | 6 +- spec/type_checking/unary_minus | 12 +- src/ast.cr | 1 - src/ast/try.cr | 16 -- src/compilers/test.cr | 2 +- src/compilers/try.cr | 99 ---------- src/formatter.cr | 15 -- src/formatters/try.cr | 17 -- src/messages/try_catch_type_mismatch.cr | 11 -- src/messages/try_catched_all.cr | 9 - src/messages/try_catches_nothing.cr | 11 -- src/messages/try_did_not_catch.cr | 16 -- src/messages/try_expected_closing_bracket.cr | 15 -- src/messages/try_expected_opening_bracket.cr | 15 -- src/messages/try_expected_statement.cr | 13 -- src/parsers/basic_expression.cr | 1 - src/parsers/html_body.cr | 1 - src/parsers/try.cr | 53 ------ src/type_checker.cr | 1 - src/type_checkers/try.cr | 105 ---------- src/type_checkers/variable.cr | 6 - 121 files changed, 422 insertions(+), 1864 deletions(-) delete mode 100644 spec/compilers/try delete mode 100644 spec/compilers/try_with_catch_all delete mode 100644 spec/compilers/try_with_catches delete mode 100644 spec/compilers/try_with_catches_and_return_result delete mode 100644 spec/compilers/try_with_statement delete mode 100644 spec/compilers/try_with_statement_reordering delete mode 100644 spec/formatters/try delete mode 100644 spec/formatters/try_with_catch delete mode 100644 spec/formatters/try_with_catch_all delete mode 100644 spec/formatters/try_with_comments delete mode 100644 spec/formatters/try_with_statement delete mode 100644 spec/parsers/try_spec.cr delete mode 100644 spec/type_checking/catch delete mode 100644 spec/type_checking/try delete mode 100644 spec/type_checking/try_with_catch delete mode 100644 spec/type_checking/try_with_statement delete mode 100644 src/ast/try.cr delete mode 100644 src/compilers/try.cr delete mode 100644 src/formatters/try.cr delete mode 100644 src/messages/try_catch_type_mismatch.cr delete mode 100644 src/messages/try_catched_all.cr delete mode 100644 src/messages/try_catches_nothing.cr delete mode 100644 src/messages/try_did_not_catch.cr delete mode 100644 src/messages/try_expected_closing_bracket.cr delete mode 100644 src/messages/try_expected_opening_bracket.cr delete mode 100644 src/messages/try_expected_statement.cr delete mode 100644 src/parsers/try.cr delete mode 100644 src/type_checkers/try.cr diff --git a/spec/compilers/argument b/spec/compilers/argument index 949f1df38..a0312a8fa 100644 --- a/spec/compilers/argument +++ b/spec/compilers/argument @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test("", 0) + test("", 0) - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(``, 0); - return ``; - })(); + this.a(``, 0); + return ``; } }; diff --git a/spec/compilers/array_access b/spec/compilers/array_access index 5c426d600..21d5398b7 100644 --- a/spec/compilers/array_access +++ b/spec/compilers/array_access @@ -12,13 +12,11 @@ component Main { } fun render : String { - try { - test() + test() - test1() + test1() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -32,11 +30,9 @@ class A extends _C { } render() { - return (() => { - this.a(); - this.b(); - return ``; - })(); + this.a(); + this.b(); + return ``; } }; diff --git a/spec/compilers/array_literal b/spec/compilers/array_literal index a59ad55ae..7cddcb840 100644 --- a/spec/compilers/array_literal +++ b/spec/compilers/array_literal @@ -8,11 +8,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -22,10 +20,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/bool_literal_false b/spec/compilers/bool_literal_false index 41514d240..aaa5753ab 100644 --- a/spec/compilers/bool_literal_false +++ b/spec/compilers/bool_literal_false @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/bool_literal_true b/spec/compilers/bool_literal_true index 2d768d8e5..90eaee8ea 100644 --- a/spec/compilers/bool_literal_true +++ b/spec/compilers/bool_literal_true @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/case b/spec/compilers/case index 5cb2788cb..29adeaa94 100644 --- a/spec/compilers/case +++ b/spec/compilers/case @@ -8,11 +8,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -32,10 +30,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/case_with_enum_destructuring b/spec/compilers/case_with_enum_destructuring index 7b1d644ca..b63d24ad2 100644 --- a/spec/compilers/case_with_enum_destructuring +++ b/spec/compilers/case_with_enum_destructuring @@ -20,11 +20,9 @@ component Main { } fun render : String { - try { - test(C::D(A::B(""))) + test(C::D(A::B(""))) - "" - } + "" } } -------------------------------------------------------------------------------- @@ -74,10 +72,8 @@ class A extends _C { } render() { - return (() => { - this.a(new D(new C(``))); - return ``; - })(); + this.a(new D(new C(``))); + return ``; } }; diff --git a/spec/compilers/catch b/spec/compilers/catch index f88f65b0e..f6d61fc1b 100644 --- a/spec/compilers/catch +++ b/spec/compilers/catch @@ -17,11 +17,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -60,10 +58,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/decode b/spec/compilers/decode index 91da9c6f6..b1ec8e605 100644 --- a/spec/compilers/decode +++ b/spec/compilers/decode @@ -13,13 +13,9 @@ component Main { } fun render : String { - try { - x(``) + x(``) - "" - } catch { - "" - } + "" } } -------------------------------------------------------------------------------- @@ -48,22 +44,8 @@ class C extends _C { } render() { - return (() => { - let _catch_all = () => { - return `` - } - - let _0 = this.a(); - - if (_0 instanceof Err) { - let _error = _0._0; - return _catch_all(); - }; - - _0._0; - - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/decoder b/spec/compilers/decoder index a68dc4c0b..f1f8d1be8 100644 --- a/spec/compilers/decoder +++ b/spec/compilers/decoder @@ -18,13 +18,9 @@ component Main { } fun render : String { - try { - x(``) + x(``) - "" - } catch { - "" - } + "" } } -------------------------------------------------------------------------------- @@ -76,22 +72,8 @@ class C extends _C { } render() { - return (() => { - let _catch_all = () => { - return `` - } - - let _0 = this.a(); - - if (_0 instanceof Err) { - let _error = _0._0; - return _catch_all(); - }; - - _0._0; - - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/directives/documentation b/spec/compilers/directives/documentation index 577507275..70372e814 100644 --- a/spec/compilers/directives/documentation +++ b/spec/compilers/directives/documentation @@ -1,19 +1,15 @@ component Main { fun render : String { - try { - @documentation(Main) + @documentation(Main) - "Hello There" - } + "Hello There" } } -------------------------------------------------------------------------------- class A extends _C { render() { - return (() => { - {"description":null,"name":"Main","connects":[],"computed-properties":[],"properties":[],"functions":[{"type":"String","description":null,"name":"render","source":"fun render : String {\n try {\n @documentation(Main)\n\n \"Hello There\"\n }\n}","arguments":[]}],"providers":[],"states":[]}; - return `Hello There`; - })(); + {"description":null,"name":"Main","connects":[],"computed-properties":[],"properties":[],"functions":[{"type":"String","description":null,"name":"render","source":"fun render : String {\n @documentation(Main)\n\n \"Hello There\"\n}","arguments":[]}],"providers":[],"states":[]}; + return `Hello There`; } }; diff --git a/spec/compilers/directives/format b/spec/compilers/directives/format index 59c313d95..70b380fda 100644 --- a/spec/compilers/directives/format +++ b/spec/compilers/directives/format @@ -1,24 +1,20 @@ component Main { fun render : String { - try { - {result, formatted} = - @format { - "HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloH" \ - "Bello" - } + {result, formatted} = + @format { + "HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloH" \ + "Bello" + } - result + formatted - } + result + formatted } } -------------------------------------------------------------------------------- class A extends _C { render() { - return (() => { - const [a,b] = [`HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHBello`, `"HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloH" \\ + const [a,b] = [`HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHBello`, `"HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloH" \\ "Bello"`]; - return a + b; - })(); + return a + b; } }; diff --git a/spec/compilers/encode b/spec/compilers/encode index 4bd309bce..6db2ec2b5 100644 --- a/spec/compilers/encode +++ b/spec/compilers/encode @@ -9,11 +9,9 @@ component Main { } fun render : String { - try { - encode() + encode() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -37,10 +35,8 @@ class B extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/enum b/spec/compilers/enum index 951d4bbcb..09094fe99 100644 --- a/spec/compilers/enum +++ b/spec/compilers/enum @@ -24,13 +24,11 @@ component Main { } fun render : String { - try { - a() - b() - c() + a() + b() + c() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -95,12 +93,10 @@ class A extends _C { } render() { - return (() => { - this.a(); - this.b(); - this.c(); - return ``; - })(); + this.a(); + this.b(); + this.c(); + return ``; } }; diff --git a/spec/compilers/finally b/spec/compilers/finally index b272f8cd2..e6d7e0094 100644 --- a/spec/compilers/finally +++ b/spec/compilers/finally @@ -8,11 +8,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -37,10 +35,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/function b/spec/compilers/function index 3eed54510..34982465d 100644 --- a/spec/compilers/function +++ b/spec/compilers/function @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/function_call_simple b/spec/compilers/function_call_simple index 5fe94d8ad..169d5042c 100644 --- a/spec/compilers/function_call_simple +++ b/spec/compilers/function_call_simple @@ -8,11 +8,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -26,10 +24,8 @@ class A extends _C { } render() { - return (() => { - this.b(); - return ``; - })(); + this.b(); + return ``; } }; diff --git a/spec/compilers/function_call_with_arguments b/spec/compilers/function_call_with_arguments index b79c08886..d5df1b509 100644 --- a/spec/compilers/function_call_with_arguments +++ b/spec/compilers/function_call_with_arguments @@ -8,11 +8,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -26,10 +24,8 @@ class A extends _C { } render() { - return (() => { - this.d(); - return ``; - })(); + this.d(); + return ``; } }; diff --git a/spec/compilers/if b/spec/compilers/if index c76cee97e..7b89c3f0e 100644 --- a/spec/compilers/if +++ b/spec/compilers/if @@ -8,11 +8,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -22,10 +20,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/inline_function_recursive b/spec/compilers/inline_function_recursive index b754b0deb..96bda8803 100644 --- a/spec/compilers/inline_function_recursive +++ b/spec/compilers/inline_function_recursive @@ -14,11 +14,9 @@ module Test { component Main { fun render : String { - try { - Test.factorial(3) + Test.factorial(3) - "" - } + "" } } -------------------------------------------------------------------------------- @@ -34,10 +32,8 @@ const B = new(class extends _M { class A extends _C { render() { - return (() => { - B.a(3); - return ``; - })(); + B.a(3); + return ``; } }; diff --git a/spec/compilers/inline_function_with_arguments b/spec/compilers/inline_function_with_arguments index 2c86a410b..71918e0f0 100644 --- a/spec/compilers/inline_function_with_arguments +++ b/spec/compilers/inline_function_with_arguments @@ -7,11 +7,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -25,10 +23,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/inline_functions_recursive b/spec/compilers/inline_functions_recursive index 1dfaa277f..ea79175ad 100644 --- a/spec/compilers/inline_functions_recursive +++ b/spec/compilers/inline_functions_recursive @@ -24,11 +24,9 @@ module Test { component Main { fun render : String { - try { - Test.a(3) + Test.a(3) - "" - } + "" } } -------------------------------------------------------------------------------- @@ -48,10 +46,8 @@ const B = new(class extends _M { class A extends _C { render() { - return (() => { - B.a(3); - return ``; - })(); + B.a(3); + return ``; } }; diff --git a/spec/compilers/member_access b/spec/compilers/member_access index 02fbe23b7..e26c823fb 100644 --- a/spec/compilers/member_access +++ b/spec/compilers/member_access @@ -10,19 +10,17 @@ module Array { component Main { fun render : String { - try { - [ - { - name = "Joe" - }, - { - name = "Doe" - } - ] - |> Array.map(.name) + [ + { + name = "Joe" + }, + { + name = "Doe" + } + ] + |> Array.map(.name) - "asd" - } + "asd" } } -------------------------------------------------------------------------------- @@ -41,15 +39,13 @@ const C = new(class extends _M { class B extends _C { render() { - return (() => { - ((..._) => C.a(((_) => _.name), ..._))([new A({ - name: `Joe` - }), new A({ - name: `Doe` - })]); + ((..._) => C.a(((_) => _.name), ..._))([new A({ + name: `Joe` + }), new A({ + name: `Doe` + })]); - return `asd`; - })(); + return `asd`; } }; diff --git a/spec/compilers/module_access_subscriptions b/spec/compilers/module_access_subscriptions index 92527ee6a..46f5b3475 100644 --- a/spec/compilers/module_access_subscriptions +++ b/spec/compilers/module_access_subscriptions @@ -14,10 +14,8 @@ component Main { } fun render : String { - try { - Test.subscriptions - Test.print("a") - } + Test.subscriptions + Test.print("a") } } -------------------------------------------------------------------------------- @@ -65,10 +63,8 @@ class C extends _C { } render() { - return (() => { - B._subscriptions; - return B.a(`a`); - })(); + B._subscriptions; + return B.a(`a`); } }; diff --git a/spec/compilers/next_call b/spec/compilers/next_call index a379ef4a0..efc19a8bb 100644 --- a/spec/compilers/next_call +++ b/spec/compilers/next_call @@ -11,11 +11,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -47,10 +45,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/number_literal_negative b/spec/compilers/number_literal_negative index bd71d40fc..61b98a1fc 100644 --- a/spec/compilers/number_literal_negative +++ b/spec/compilers/number_literal_negative @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/number_literal_simple b/spec/compilers/number_literal_simple index 11f280eb4..c61a5fd10 100644 --- a/spec/compilers/number_literal_simple +++ b/spec/compilers/number_literal_simple @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/number_literal_with_decimal b/spec/compilers/number_literal_with_decimal index c3a3f7294..0ccab029d 100644 --- a/spec/compilers/number_literal_with_decimal +++ b/spec/compilers/number_literal_with_decimal @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/operation_chanined b/spec/compilers/operation_chanined index 16bb9d1d4..7e031848b 100644 --- a/spec/compilers/operation_chanined +++ b/spec/compilers/operation_chanined @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/operation_or b/spec/compilers/operation_or index cb8781316..fedbbf242 100644 --- a/spec/compilers/operation_or +++ b/spec/compilers/operation_or @@ -9,11 +9,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -38,10 +36,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/operation_simple b/spec/compilers/operation_simple index f01fcd5be..80e1db303 100644 --- a/spec/compilers/operation_simple +++ b/spec/compilers/operation_simple @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/parallel_simple b/spec/compilers/parallel_simple index 62facb8c2..7ed417289 100644 --- a/spec/compilers/parallel_simple +++ b/spec/compilers/parallel_simple @@ -9,11 +9,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -48,10 +46,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/parallel_with_catch b/spec/compilers/parallel_with_catch index 88bf6064a..0e6f776cc 100644 --- a/spec/compilers/parallel_with_catch +++ b/spec/compilers/parallel_with_catch @@ -25,11 +25,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -92,10 +90,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/parallel_with_catch_all b/spec/compilers/parallel_with_catch_all index 5444ef661..a1c8987a2 100644 --- a/spec/compilers/parallel_with_catch_all +++ b/spec/compilers/parallel_with_catch_all @@ -23,11 +23,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -71,10 +69,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/parenthesized_expression b/spec/compilers/parenthesized_expression index 204643c13..13eab0cdb 100644 --- a/spec/compilers/parenthesized_expression +++ b/spec/compilers/parenthesized_expression @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/record b/spec/compilers/record index 8698ba847..130871d82 100644 --- a/spec/compilers/record +++ b/spec/compilers/record @@ -12,11 +12,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -40,10 +38,8 @@ class B extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/record_constructor b/spec/compilers/record_constructor index 0c47fa89f..48c13a390 100644 --- a/spec/compilers/record_constructor +++ b/spec/compilers/record_constructor @@ -5,11 +5,9 @@ record Test { component Main { fun render : Html { - try { - Test("A", 0) + Test("A", 0) -
- } +
} } -------------------------------------------------------------------------------- @@ -26,14 +24,12 @@ const A = _R({ class B extends _C { render() { - return (() => { - new A({ - a: `A`, - b: 0 - }); + new A({ + a: `A`, + b: 0 + }); - return _h("div", {}); - })(); + return _h("div", {}); } }; diff --git a/spec/compilers/record_constructor_partial b/spec/compilers/record_constructor_partial index 98a7eaff2..522625b9e 100644 --- a/spec/compilers/record_constructor_partial +++ b/spec/compilers/record_constructor_partial @@ -6,11 +6,9 @@ record Test { component Main { fun render : Html { - try { - Test("A") + Test("A") -
- } +
} } -------------------------------------------------------------------------------- @@ -31,17 +29,15 @@ const A = _R({ class B extends _C { render() { - return (() => { - (_0, _1) => { - return new A({ - a: `A`, - b: _0, - c: _1 - }) - }; + (_0, _1) => { + return new A({ + a: `A`, + b: _0, + c: _1 + }) + }; - return _h("div", {}); - })(); + return _h("div", {}); } }; diff --git a/spec/compilers/record_field b/spec/compilers/record_field index 8698ba847..130871d82 100644 --- a/spec/compilers/record_field +++ b/spec/compilers/record_field @@ -12,11 +12,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -40,10 +38,8 @@ class B extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/record_update b/spec/compilers/record_update index 219214609..2f5a59ee0 100644 --- a/spec/compilers/record_update +++ b/spec/compilers/record_update @@ -10,11 +10,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -47,10 +45,8 @@ class B extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/regexp_literal b/spec/compilers/regexp_literal index 3c651a651..9dbcf0521 100644 --- a/spec/compilers/regexp_literal +++ b/spec/compilers/regexp_literal @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - regexp() + regexp() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/sequence_simple b/spec/compilers/sequence_simple index a7cab4958..b395fd294 100644 --- a/spec/compilers/sequence_simple +++ b/spec/compilers/sequence_simple @@ -6,11 +6,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -33,10 +31,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/sequence_using_argument b/spec/compilers/sequence_using_argument index 01695f4bf..075809e2b 100644 --- a/spec/compilers/sequence_using_argument +++ b/spec/compilers/sequence_using_argument @@ -9,11 +9,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -54,10 +52,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/sequence_with_argument b/spec/compilers/sequence_with_argument index 3f19e418a..87a5ef06c 100644 --- a/spec/compilers/sequence_with_argument +++ b/spec/compilers/sequence_with_argument @@ -7,11 +7,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -35,10 +33,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/sequence_with_catch b/spec/compilers/sequence_with_catch index 3bccf7092..5ee6ac366 100644 --- a/spec/compilers/sequence_with_catch +++ b/spec/compilers/sequence_with_catch @@ -25,11 +25,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -88,10 +86,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/sequence_with_finally b/spec/compilers/sequence_with_finally index 8d6ed4a7a..4e8f73a79 100644 --- a/spec/compilers/sequence_with_finally +++ b/spec/compilers/sequence_with_finally @@ -8,11 +8,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -37,10 +35,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/sequence_with_result_and_catch b/spec/compilers/sequence_with_result_and_catch index 02194c1b0..78dac198a 100644 --- a/spec/compilers/sequence_with_result_and_catch +++ b/spec/compilers/sequence_with_result_and_catch @@ -16,11 +16,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -61,10 +59,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/sequence_with_result_and_catch_all b/spec/compilers/sequence_with_result_and_catch_all index 233df4e1c..508aad5e8 100644 --- a/spec/compilers/sequence_with_result_and_catch_all +++ b/spec/compilers/sequence_with_result_and_catch_all @@ -16,11 +16,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -56,10 +54,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/sequence_with_statement_reordering b/spec/compilers/sequence_with_statement_reordering index 0b0210391..4702c2df3 100644 --- a/spec/compilers/sequence_with_statement_reordering +++ b/spec/compilers/sequence_with_statement_reordering @@ -10,11 +10,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -39,10 +37,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return _h("div", {}); - })(); + this.a(); + return _h("div", {}); } }; diff --git a/spec/compilers/statement b/spec/compilers/statement index 446ad039f..819986735 100644 --- a/spec/compilers/statement +++ b/spec/compilers/statement @@ -1,20 +1,16 @@ component Main { fun render : String { - try { - x = - "hello" + x = + "hello" - x - } + x } } -------------------------------------------------------------------------------- class A extends _C { render() { - return (() => { - let a = `hello`; - return a; - })(); + const a = `hello`; + return a; } }; diff --git a/spec/compilers/try b/spec/compilers/try deleted file mode 100644 index c5ef95f26..000000000 --- a/spec/compilers/try +++ /dev/null @@ -1,17 +0,0 @@ -component Main { - fun render : String { - try { - "hello" - } - } -} --------------------------------------------------------------------------------- -class A extends _C { - render() { - return (() => { - return `hello`; - })(); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/try_with_catch_all b/spec/compilers/try_with_catch_all deleted file mode 100644 index 6f0d5a2fa..000000000 --- a/spec/compilers/try_with_catch_all +++ /dev/null @@ -1,47 +0,0 @@ -module Result { - fun error (input : a) : Result(a, b) { - `new Err(#{input})` - } -} - -component Main { - fun render : String { - try { - x = - Result.error("Blah") - - "Hello" - } catch { - "Blah" - } - } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - a(c) { - return (new Err(c)); - } -}); - -class A extends _C { - render() { - return (() => { - let _catch_all = () => { - return `Blah` - } - - let _0 = B.a(`Blah`); - - if (_0 instanceof Err) { - let _error = _0._0; - return _catch_all(); - }; - - let b = _0._0; - - return `Hello`; - })(); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/try_with_catches b/spec/compilers/try_with_catches deleted file mode 100644 index bff60d01d..000000000 --- a/spec/compilers/try_with_catches +++ /dev/null @@ -1,45 +0,0 @@ -module Result { - fun error (input : a) : Result(a, b) { - `new Err(#{input})` - } -} - -component Main { - fun render : String { - try { - x = - Result.error("Blah") - - x - } catch String => error { - error - } - } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - a(d) { - return (new Err(d)); - } -}); - -class A extends _C { - render() { - return (() => { - let _0 = B.a(`Blah`); - - if (_0 instanceof Err) { - let _error = _0._0; - - let b = _error; - return b; - }; - - let c = _0._0; - - return c; - })(); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/try_with_catches_and_return_result b/spec/compilers/try_with_catches_and_return_result deleted file mode 100644 index 498ece340..000000000 --- a/spec/compilers/try_with_catches_and_return_result +++ /dev/null @@ -1,81 +0,0 @@ -enum Result(error, value) { - Err(error) - Ok(value) -} - -component Main { - fun test : Result(String, value) { - try { - x = - Result::Err("Hello") - - Result::Ok(x) - } catch String => error { - Result::Err(error) - } - } - - fun render : String { - try { - x = test() - - "success" - } catch String => error { - "error" - } - } -} --------------------------------------------------------------------------------- -class B extends _E { - constructor(_0) { - super(); - this._0 = _0; - this.length = 1; - } -}; - -class C extends _E { - constructor(_0) { - super(); - this._0 = _0; - this.length = 1; - } -}; - -class A extends _C { - a() { - return (() => { - let _0 = new B(`Hello`); - - if (_0 instanceof Err) { - let _error = _0._0; - - let b = _error; - return new B(b); - }; - - let c = _0._0; - - return new C(c); - })(); - } - - render() { - return (() => { - let _0 = this.a(); - - if (_0 instanceof Err) { - let _error = _0._0; - - let d = _error; - return `error`; - }; - - let e = _0._0; - - return `success`; - })(); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/try_with_statement b/spec/compilers/try_with_statement deleted file mode 100644 index 446ad039f..000000000 --- a/spec/compilers/try_with_statement +++ /dev/null @@ -1,21 +0,0 @@ -component Main { - fun render : String { - try { - x = - "hello" - - x - } - } -} --------------------------------------------------------------------------------- -class A extends _C { - render() { - return (() => { - let a = `hello`; - return a; - })(); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/try_with_statement_reordering b/spec/compilers/try_with_statement_reordering deleted file mode 100644 index bde54073b..000000000 --- a/spec/compilers/try_with_statement_reordering +++ /dev/null @@ -1,25 +0,0 @@ -component Main { - fun render : String { - try { - c = - x - - x = - "hello" - - c - } - } -} --------------------------------------------------------------------------------- -class A extends _C { - render() { - return (() => { - let a = `hello`; - let b = a; - return b; - })(); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/tuple_literal b/spec/compilers/tuple_literal index f7912a29e..926dbeb60 100644 --- a/spec/compilers/tuple_literal +++ b/spec/compilers/tuple_literal @@ -8,11 +8,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -22,10 +20,8 @@ class A extends _C { } render() { - return (() => { - this.a(); - return ``; - })(); + this.a(); + return ``; } }; diff --git a/spec/compilers/unary_minus b/spec/compilers/unary_minus index f678248c0..cbfa24597 100644 --- a/spec/compilers/unary_minus +++ b/spec/compilers/unary_minus @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - -test() + -test() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - -(this.a()); - return ``; - })(); + -(this.a()); + return ``; } }; diff --git a/spec/compilers/void b/spec/compilers/void index 5b318e585..02d944ced 100644 --- a/spec/compilers/void +++ b/spec/compilers/void @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - x = test + x = test - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ class A extends _C { } render() { - return (() => { - let b = this.a; - return ``; - })(); + const b = this.a; + return ``; } }; diff --git a/spec/formatters/directives/documentation b/spec/formatters/directives/documentation index 13e8bfa60..ece7a9f14 100644 --- a/spec/formatters/directives/documentation +++ b/spec/formatters/directives/documentation @@ -1,21 +1,17 @@ component Main { fun render : String { - try { - @documentation( - Main - ) + @documentation( + Main +) - "Hello There" - } + "Hello There" } } -------------------------------------------------------------------------------- component Main { fun render : String { - try { - @documentation(Main) + @documentation(Main) - "Hello There" - } + "Hello There" } } diff --git a/spec/formatters/directives/format b/spec/formatters/directives/format index 48903fdef..b9731a0d0 100644 --- a/spec/formatters/directives/format +++ b/spec/formatters/directives/format @@ -1,21 +1,17 @@ component Main { fun render : String { - try { - {result, formatted} = @format{"Hello"} - result + formatted - } + {result, formatted} = @format{"Hello"} + result + formatted } } -------------------------------------------------------------------------------- component Main { fun render : String { - try { - {result, formatted} = - @format { - "Hello" - } + {result, formatted} = + @format { + "Hello" + } - result + formatted - } + result + formatted } } diff --git a/spec/formatters/record_constructor b/spec/formatters/record_constructor index 3b29dd465..37698fbe1 100644 --- a/spec/formatters/record_constructor +++ b/spec/formatters/record_constructor @@ -5,12 +5,10 @@ record Test { component Main { fun render : String { - try { - item = - Test("Joe",32) + item = + Test("Joe",32) - item.name - } + item.name } } -------------------------------------------------------------------------------- @@ -21,11 +19,9 @@ record Test { component Main { fun render : String { - try { - item = - Test("Joe", 32) + item = + Test("Joe", 32) - item.name - } + item.name } } diff --git a/spec/formatters/record_constructor_with_new_line b/spec/formatters/record_constructor_with_new_line index 061d1c427..48eb086ab 100644 --- a/spec/formatters/record_constructor_with_new_line +++ b/spec/formatters/record_constructor_with_new_line @@ -5,13 +5,11 @@ record Test { component Main { fun render : String { - try { - item = - Test("Joe", - 32) + item = + Test("Joe", + 32) - item.name - } + item.name } } -------------------------------------------------------------------------------- @@ -22,13 +20,11 @@ record Test { component Main { fun render : String { - try { - item = - Test( - "Joe", - 32) + item = + Test( + "Joe", + 32) - item.name - } + item.name } } diff --git a/spec/formatters/regexp_literal b/spec/formatters/regexp_literal index 8448a7d02..a14bfe889 100644 --- a/spec/formatters/regexp_literal +++ b/spec/formatters/regexp_literal @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - regexp() + regexp() - "" - } + "" } } -------------------------------------------------------------------------------- @@ -18,10 +16,8 @@ component Main { } fun render : String { - try { - regexp() + regexp() - "" - } + "" } } diff --git a/spec/formatters/statement b/spec/formatters/statement index 8dbaa3554..369251993 100644 --- a/spec/formatters/statement +++ b/spec/formatters/statement @@ -1,20 +1,18 @@ module A { fun test : Bool { - try {x="hello"y=truez=false} + x="hello"y=truez=false } } -------------------------------------------------------------------------------- module A { fun test : Bool { - try { - x = - "hello" + x = + "hello" - y = - true + y = + true - z = - false - } + z = + false } } diff --git a/spec/formatters/try b/spec/formatters/try deleted file mode 100644 index 6a29f14d1..000000000 --- a/spec/formatters/try +++ /dev/null @@ -1,13 +0,0 @@ -module A { - fun test : String { - try {"hello"} - } -} --------------------------------------------------------------------------------- -module A { - fun test : String { - try { - "hello" - } - } -} diff --git a/spec/formatters/try_with_catch b/spec/formatters/try_with_catch deleted file mode 100644 index 8752b44f7..000000000 --- a/spec/formatters/try_with_catch +++ /dev/null @@ -1,30 +0,0 @@ -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -module A { - fun test : String { - try {x=Result.error("hello")x}catch String => a {"blah"} - } -} --------------------------------------------------------------------------------- -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -module A { - fun test : String { - try { - x = - Result.error("hello") - - x - } catch String => a { - "blah" - } - } -} diff --git a/spec/formatters/try_with_catch_all b/spec/formatters/try_with_catch_all deleted file mode 100644 index 5b6b4550a..000000000 --- a/spec/formatters/try_with_catch_all +++ /dev/null @@ -1,35 +0,0 @@ -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -module A { - fun test : String { - try {x=Result.error("hello") y=Result.error(0)y}catch String => a {"blah"}catch{"X"} - } -} --------------------------------------------------------------------------------- -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -module A { - fun test : String { - try { - x = - Result.error("hello") - - y = - Result.error(0) - - y - } catch String => a { - "blah" - } catch { - "X" - } - } -} diff --git a/spec/formatters/try_with_comments b/spec/formatters/try_with_comments deleted file mode 100644 index c1da28de2..000000000 --- a/spec/formatters/try_with_comments +++ /dev/null @@ -1,16 +0,0 @@ -module A { - fun test : String { - try {/*A*/"hello"/*B*/} - } -} --------------------------------------------------------------------------------- -module A { - fun test : String { - try { - /* A */ - "hello" - - /* B */ - } - } -} diff --git a/spec/formatters/try_with_statement b/spec/formatters/try_with_statement deleted file mode 100644 index e5c8d754f..000000000 --- a/spec/formatters/try_with_statement +++ /dev/null @@ -1,16 +0,0 @@ -module A { - fun test : String { - try {x="hello"x} - } -} --------------------------------------------------------------------------------- -module A { - fun test : String { - try { - x = - "hello" - - x - } - } -} diff --git a/spec/parsers/case_spec.cr b/spec/parsers/case_spec.cr index e97cbeda5..ea00b25b6 100644 --- a/spec/parsers/case_spec.cr +++ b/spec/parsers/case_spec.cr @@ -20,5 +20,5 @@ describe "Case Expression" do expect_ok "case (a) { a => b }" expect_ok "case (a) { a => b b => a }" expect_ok "case (a) { a => T.blah()b => a }" - expect_ok "case (a) { [] => try { a } [head, ...tail] => { try { a } } }" + expect_ok "case (a) { [] => a [head, ...tail] => a }" end diff --git a/spec/parsers/statement_spec.cr b/spec/parsers/statement_spec.cr index 9f3d29cc1..6e72fd785 100644 --- a/spec/parsers/statement_spec.cr +++ b/spec/parsers/statement_spec.cr @@ -1,7 +1,7 @@ require "../spec_helper" describe "Statement" do - subject statement(:try) + subject statement(:none) expect_ignore "" expect_ignore "??" diff --git a/spec/parsers/try_spec.cr b/spec/parsers/try_spec.cr deleted file mode 100644 index e0b1e98a0..000000000 --- a/spec/parsers/try_spec.cr +++ /dev/null @@ -1,18 +0,0 @@ -require "../spec_helper" - -describe "Try" do - subject try_expression - - expect_ignore "" - expect_ignore "asd" - expect_ignore "??" - expect_ignore "tr" - - expect_error "try ", Mint::Parser::TryExpectedOpeningBracket - expect_error "try {", Mint::Parser::TryExpectedStatement - expect_error "try {}", Mint::Parser::TryExpectedStatement - expect_error "try { a", Mint::Parser::TryExpectedClosingBracket - - expect_ok "try {a}" - expect_ok "try { a }" -end diff --git a/spec/recursion_spec.cr b/spec/recursion_spec.cr index 3ee7be93d..3a984a7ee 100644 --- a/spec/recursion_spec.cr +++ b/spec/recursion_spec.cr @@ -21,11 +21,9 @@ describe "variable" do } fun render : Html { - try { - test() + test() -
- } +
} } @@ -58,11 +56,9 @@ describe "function" do } fun render : Html { - try { - test() + test() -
- } +
} } MINT diff --git a/spec/type_checking/array_access b/spec/type_checking/array_access index b0363cb00..73ff14cfa 100644 --- a/spec/type_checking/array_access +++ b/spec/type_checking/array_access @@ -22,11 +22,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } ---------------------------------------------------------ArrayAccessInvalidTuple @@ -36,11 +34,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------------------------- @@ -50,11 +46,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } ---------------------------------------------------------ArrayAccessInvalidTuple @@ -64,10 +58,8 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } diff --git a/spec/type_checking/array_literal b/spec/type_checking/array_literal index 2b06c31dd..6981706b6 100644 --- a/spec/type_checking/array_literal +++ b/spec/type_checking/array_literal @@ -8,11 +8,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -----------------------------------------------------------------ArrayNotMatches @@ -26,11 +24,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } ------------------------------------------------------ArrayNotMatchesDefinedType @@ -43,10 +39,8 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } diff --git a/spec/type_checking/bool_literal_false b/spec/type_checking/bool_literal_false index c618f4eda..9f27d775c 100644 --- a/spec/type_checking/bool_literal_false +++ b/spec/type_checking/bool_literal_false @@ -4,11 +4,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } ------------------------------------------------------------FunctionTypeMismatch @@ -18,10 +16,8 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } diff --git a/spec/type_checking/bool_literal_true b/spec/type_checking/bool_literal_true index 0b9eef741..9aae5b127 100644 --- a/spec/type_checking/bool_literal_true +++ b/spec/type_checking/bool_literal_true @@ -4,11 +4,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } ------------------------------------------------------------FunctionTypeMismatch @@ -18,10 +16,8 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } diff --git a/spec/type_checking/case_type_unification b/spec/type_checking/case_type_unification index 023b1ff9f..ec52cc781 100644 --- a/spec/type_checking/case_type_unification +++ b/spec/type_checking/case_type_unification @@ -12,11 +12,9 @@ component Main { } fun render : String { - try { - testCase() + testCase() - "" - } + "" } } ------------------------------------------------------------FunctionTypeMismatch @@ -34,10 +32,8 @@ component Main { } fun render : String { - try { - testCase() + testCase() - "" - } + "" } } diff --git a/spec/type_checking/catch b/spec/type_checking/catch deleted file mode 100644 index afd7c0bdb..000000000 --- a/spec/type_checking/catch +++ /dev/null @@ -1,35 +0,0 @@ -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -component Main { - fun render : String { - try { - x = - Result.error("Blah") - - x - } catch String => error { - error - } - } -} -------------------------------------------------------------------TryDidNotCatch -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -component Main { - fun render : String { - try { - x = - Result.error("Blah") - - x - } - } -} diff --git a/spec/type_checking/decode b/spec/type_checking/decode index 3c3b87a32..f1526211e 100644 --- a/spec/type_checking/decode +++ b/spec/type_checking/decode @@ -4,13 +4,9 @@ record X { component Main { fun render : Html { - try { - decode (`{}`) as X + decode (`{}`) as X -
- } catch { -
- } +
} } ------------------------------------------------------------DecodeExpectedObject @@ -20,11 +16,9 @@ record X { component Main { fun render : Html { - try { - decode "" as X + decode "" as X -
- } +
} } ---------------------------------------------------------------DecodeComplexType @@ -34,11 +28,9 @@ record X { component Main { fun render : Html { - try { - decode (`{}`) as X + decode (`{}`) as X -
- } +
} } ---------------------------------------------------------------DecodeComplexType @@ -48,10 +40,8 @@ record X { component Main { fun render : Html { - try { - decode (`{}`) as X + decode (`{}`) as X -
- } +
} } diff --git a/spec/type_checking/directives/documentation b/spec/type_checking/directives/documentation index 03c7351b5..b8e8262cf 100644 --- a/spec/type_checking/directives/documentation +++ b/spec/type_checking/directives/documentation @@ -1,19 +1,15 @@ component Main { fun render : String { - try { - @documentation(Main) + @documentation(Main) - "Hello There" - } + "Hello There" } } --------------------------------------------DocumentationDirectiveEntityNotFound component Main { fun render : String { - try { - @documentation(X) + @documentation(X) - "Hello There" - } + "Hello There" } } diff --git a/spec/type_checking/directives/format b/spec/type_checking/directives/format index 4e2d7ca7c..0e5fffabc 100644 --- a/spec/type_checking/directives/format +++ b/spec/type_checking/directives/format @@ -1,12 +1,10 @@ component Main { fun render : String { - try { - {result, formatted} = - @format { - "Hello" - } + {result, formatted} = + @format { + "Hello" + } - result + formatted - } + result + formatted } } diff --git a/spec/type_checking/finally b/spec/type_checking/finally index 553307ed0..61eee50af 100644 --- a/spec/type_checking/finally +++ b/spec/type_checking/finally @@ -8,11 +8,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -----------------------------------------------------------OperationTypeMismatch @@ -26,10 +24,8 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } diff --git a/spec/type_checking/function b/spec/type_checking/function index b2f89ca6d..cdf761dcd 100644 --- a/spec/type_checking/function +++ b/spec/type_checking/function @@ -4,11 +4,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } ------------------------------------------------------------FunctionTypeMismatch @@ -18,11 +16,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } --------------------------------------------------------FunctionArgumentConflict @@ -32,10 +28,8 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } diff --git a/spec/type_checking/function_call b/spec/type_checking/function_call index 0c08a60eb..356683d24 100644 --- a/spec/type_checking/function_call +++ b/spec/type_checking/function_call @@ -18,11 +18,9 @@ component Main { } fun render : Html { - try { - b() + b() -
- } +
} } ----------------------------------------------------------------CallNotAFunction @@ -34,11 +32,9 @@ component Main { } fun render : Html { - try { - b() + b() -
- } +
} } --------------------------------------------------------CallArgumentTypeMismatch @@ -52,11 +48,9 @@ component Main { } fun render : Html { - try { - b() + b() -
- } +
} } --------------------------------------------------------CallArgumentSizeMismatch @@ -70,57 +64,8 @@ component Main { } fun render : Html { - try { - b() - -
- } - } -} --------------------------------------------------------------------------------- -module Maybe { - fun nothing : Maybe(a) { - `` - } - - fun just (value : a) : Maybe(a) { - `` - } - - fun withDefault (value : a, maybe : Maybe(a)) : a { - `` - } - - fun toResult (error : b, maybe : Maybe(a)) : Result(b, a) { - `` - } -} - -record Nested { - x : String -} - -record Test { - name : String, - nested : Nested -} + b() -store X { - state test : Maybe(Test) = Maybe.nothing() -} - -component Main { - connect X exposing { test } - - fun render : String { - try { - resolved = - test - |> Maybe.toResult("Blah") - - resolved.nested.x - } catch String => error { - error - } +
} } diff --git a/spec/type_checking/get b/spec/type_checking/get index db3bae19e..496a7df8a 100644 --- a/spec/type_checking/get +++ b/spec/type_checking/get @@ -4,11 +4,9 @@ component Main { } fun render : Html { - try { - test + test -
- } +
} } -----------------------------------------------------------------GetTypeMismatch @@ -18,10 +16,8 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } diff --git a/spec/type_checking/module_access_subscriptions b/spec/type_checking/module_access_subscriptions index 70ba57b59..282ab770b 100644 --- a/spec/type_checking/module_access_subscriptions +++ b/spec/type_checking/module_access_subscriptions @@ -13,9 +13,7 @@ component Main { } fun render : String { - try { - Test.subscriptions - Test.print("a") - } + Test.subscriptions + Test.print("a") } } diff --git a/spec/type_checking/module_call b/spec/type_checking/module_call index 82a9f7854..ebae37480 100644 --- a/spec/type_checking/module_call +++ b/spec/type_checking/module_call @@ -67,11 +67,9 @@ module Test { component Main { fun render : String { - try { - z = Test.b() + z = Test.b() - z(true) - } + z(true) } } --------------------------------------------------------CallArgumentTypeMismatch diff --git a/spec/type_checking/next_call b/spec/type_checking/next_call index ea69c2578..eb159fc7b 100644 --- a/spec/type_checking/next_call +++ b/spec/type_checking/next_call @@ -33,11 +33,9 @@ component Main { state name : String = "Joe" fun render : Html { - try { - next { name = 30 } + next { name = 30 } -
- } +
} } -----------------------------------------------------------NextCallStateNotFound @@ -45,10 +43,8 @@ component Main { state name : String = "Joe" fun render : Html { - try { - next { age = 30 } + next { age = 30 } -
- } +
} } diff --git a/spec/type_checking/record_constructor b/spec/type_checking/record_constructor index a8070881c..b489a24b6 100644 --- a/spec/type_checking/record_constructor +++ b/spec/type_checking/record_constructor @@ -5,21 +5,17 @@ record Test { component Main { fun render : String { - try { - item = Test("Joe", 32) + item = Test("Joe", 32) - item.name - } + item.name } } -------------------------------------------------RecordConstructorNotFoundRecord component Main { fun render : String { - try { - item = Test("Joe") + item = Test("Joe") - item.name - } + item.name } } -------------------------------------------RecordConstructorArgumentTypeMismatch @@ -30,11 +26,9 @@ record Test { component Main { fun render : String { - try { - item = Test(32, "Joe") + item = Test(32, "Joe") - item.name - } + item.name } } -------------------------------------------RecordConstructorArgumentSizeMismatch @@ -45,11 +39,9 @@ record Test { component Main { fun render : String { - try { - item = Test(32, "Joe", "Third") + item = Test(32, "Joe", "Third") - item.name - } + item.name } } -------------------------------------------------------------------------------- @@ -61,17 +53,15 @@ record User { component Main { fun render : String { - try { - partial = - User("John Doe", 32) - - partial(true) == { - name = "John Doe", - active = true, - age = 32 - } + partial = + User("John Doe", 32) - "" + partial(true) == { + name = "John Doe", + active = true, + age = 32 } + + "" } } diff --git a/spec/type_checking/record_update b/spec/type_checking/record_update index 828d9e576..74fa17f77 100644 --- a/spec/type_checking/record_update +++ b/spec/type_checking/record_update @@ -18,11 +18,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } ---------------------------------------------------RecordUpdateNotUpdatingRecord @@ -42,11 +40,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } --------------------------------------------------------RecordUpdateTypeMismatch @@ -70,11 +66,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } ---------------------------------------------------------RecordUpdateNotFoundKey @@ -98,11 +92,9 @@ component Main { } fun render : String { - try { - test() + test() - "" - } + "" } } diff --git a/spec/type_checking/recursive b/spec/type_checking/recursive index 30947b4b2..b20c1cac4 100644 --- a/spec/type_checking/recursive +++ b/spec/type_checking/recursive @@ -82,17 +82,15 @@ module Test { -------------------------------------------------------------------------------- module Test { fun factorial (n : Number) : Number { - try { - helper = - (n : Number, acc : Number) : Number { - if (n == 0) { - acc - } else { - helper(n - 1, acc * n) - } + helper = + (n : Number, acc : Number) : Number { + if (n == 0) { + acc + } else { + helper(n - 1, acc * n) } + } - helper(n, 1) - } + helper(n, 1) } } diff --git a/spec/type_checking/sequence_with_catch b/spec/type_checking/sequence_with_catch index 5b308d15c..bb9cc09c2 100644 --- a/spec/type_checking/sequence_with_catch +++ b/spec/type_checking/sequence_with_catch @@ -22,11 +22,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------------SequenceDidNotCatch @@ -50,11 +48,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } ----------------------------------------------------------SequenceCatchesNothing @@ -68,11 +64,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } -------------------------------------------------------SequenceCatchTypeMismatch @@ -95,11 +89,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } @@ -123,11 +115,9 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } --------------------------------------------------------------SequenceCatchedAll @@ -152,10 +142,8 @@ component Main { } fun render : Html { - try { - test() + test() -
- } +
} } diff --git a/spec/type_checking/statement b/spec/type_checking/statement index 335591993..7ad27bee8 100644 --- a/spec/type_checking/statement +++ b/spec/type_checking/statement @@ -1,23 +1,17 @@ component Main { fun render : String { - try { - x = "hello" - } + x = "hello" } } ---------------------------------------------------------------StatementNotTuple component Main { fun render : String { - try { - {x, y, z} = "hello" - } + {x, y, z} = "hello" } } ----------------------------------------------------------StatementTupleMismatch component Main { fun render : String { - try { - {x, y, z} = {"hello", "a"} - } + {x, y, z} = {"hello", "a"} } } diff --git a/spec/type_checking/store_call_with_next b/spec/type_checking/store_call_with_next index bd62e68e2..7d081b2e1 100644 --- a/spec/type_checking/store_call_with_next +++ b/spec/type_checking/store_call_with_next @@ -6,10 +6,8 @@ store Test { component Main { fun render : Html { - try { - Test.set() -
- } + Test.set() +
} } diff --git a/spec/type_checking/string_literal b/spec/type_checking/string_literal index 355dc2b75..ec1746c14 100644 --- a/spec/type_checking/string_literal +++ b/spec/type_checking/string_literal @@ -6,20 +6,16 @@ component Main { -------------------------------------------------------------------------------- component Main { fun render : String { - try { - name = 0 + name = 0 - "Hello There #{name}!" - } + "Hello There #{name}!" } } ------------------------------------------StringLiteralInterpolationTypeMismatch component Main { fun render : String { - try { - name = {} + name = {} - "Hello There #{name}!" - } + "Hello There #{name}!" } } diff --git a/spec/type_checking/try b/spec/type_checking/try deleted file mode 100644 index 2647b41e1..000000000 --- a/spec/type_checking/try +++ /dev/null @@ -1,11 +0,0 @@ -component Main { - fun test : String { - try { - "hello" - } - } - - fun render : String { - "" - } -} diff --git a/spec/type_checking/try_with_catch b/spec/type_checking/try_with_catch deleted file mode 100644 index 6ff51b14e..000000000 --- a/spec/type_checking/try_with_catch +++ /dev/null @@ -1,180 +0,0 @@ -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -component Main { - fun test : String { - try { - x = - Result.error("Blah") - - x - } catch String => error { - error - } - } - - fun render : String { - try { - test() - - "" - } - } -} ----------------------------------------------------------------TryCatchesNothing -component Main { - fun test : String { - try { - x = - "" - } catch String => error { - "" - } - } - - fun render : String { - try { - test() - - "" - } - } -} -------------------------------------------------------------------TryDidNotCatch -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -component Main { - fun test : String { - try { - x = - Result.error("Blah") - - x - } - } - - fun render : String { - try { - test() - - "" - } - } -} -------------------------------------------------------------TryCatchTypeMismatch -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -component Main { - fun test : String { - try { - x = - Result.error("Blah") - - "test" - } catch String => error { - true - } - } - - fun render : String { - try { - test() - - "" - } - } -} --------------------------------------------------------------------TryCatchedAll -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -component Main { - fun test : String { - try { - x = - Result.error("Blah") - - "test" - } catch String => error { - "X" - } catch { - "Y" - } - } - - fun render : String { - try { - test() - - "" - } - } -} -------------------------------------------------------------TryCatchTypeMismatch -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -component Main { - fun test : String { - try { - x = - Result.error("Blah") - - "test" - } catch { - true - } - } - - fun render : String { - try { - test() - - "" - } - } -} -------------------------------------------------------------FunctionTypeMismatch -module Result { - fun error (input : a) : Result(a, b) { - `new Err(input)` - } -} - -component Main { - fun test : String { - try { - x = - Result.error("Blah") - - x - } catch String => error { - false - } - } - - fun render : String { - try { - test() - - "" - } - } -} diff --git a/spec/type_checking/try_with_statement b/spec/type_checking/try_with_statement deleted file mode 100644 index 81b329661..000000000 --- a/spec/type_checking/try_with_statement +++ /dev/null @@ -1,12 +0,0 @@ -component Main { - fun test : String { - try { - x = "hello" - x - } - } - - fun render : String { - "" - } -} diff --git a/spec/type_checking/type_normalize b/spec/type_checking/type_normalize index 1c1db0254..052453797 100644 --- a/spec/type_checking/type_normalize +++ b/spec/type_checking/type_normalize @@ -26,10 +26,8 @@ module Test { } fun test4 : String { - try { - test1() * test2() * test3() + test1() * test2() * test3() - "" - } + "" } } diff --git a/spec/type_checking/unary_minus b/spec/type_checking/unary_minus index 29d72ece3..5d2535cef 100644 --- a/spec/type_checking/unary_minus +++ b/spec/type_checking/unary_minus @@ -1,19 +1,15 @@ component Main { fun render : String { - try { - -(10) + -(10) - "" - } + "" } } -------------------------------------------------------------UnaryMinusNotNumber component Main { fun render : String { - try { - -"ASD" + -"ASD" - "" - } + "" } } diff --git a/src/ast.cr b/src/ast.cr index d84fe0404..012bdf60b 100644 --- a/src/ast.cr +++ b/src/ast.cr @@ -28,7 +28,6 @@ module Mint Route | Void | Case | - Try | If | Js diff --git a/src/ast/try.cr b/src/ast/try.cr deleted file mode 100644 index e9c6e9c40..000000000 --- a/src/ast/try.cr +++ /dev/null @@ -1,16 +0,0 @@ -module Mint - class Ast - class Try < Node - getter statements, catches, comments, catch_all - - def initialize(@statements : Array(Statement), - @comments : Array(Comment), - @catches : Array(Catch), - @catch_all : CatchAll?, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/compilers/test.cr b/src/compilers/test.cr index dcc3da74e..3f3d1845d 100644 --- a/src/compilers/test.cr +++ b/src/compilers/test.cr @@ -49,7 +49,7 @@ module Mint case raw_expression when Ast::Operation _compile_operation_test(raw_expression) - when Ast::Try, Ast::Sequence + when Ast::Sequence _compile(raw_expression) do |statement, _index, is_last| if is_last exp = diff --git a/src/compilers/try.cr b/src/compilers/try.cr deleted file mode 100644 index 492b5fae5..000000000 --- a/src/compilers/try.cr +++ /dev/null @@ -1,99 +0,0 @@ -module Mint - class Compiler - protected def prefix(_node : Ast::Try, statement : Ast::Statement, value : String) - case target = statement.target - when Ast::Variable - js.let(js.variable_of(target), value) - when Ast::TupleDestructuring - variables = - target - .parameters - .join(',') { |param| js.variable_of(param) } - - "const [#{variables}] = #{value}" - else - value - end - end - - def _compile(node : Ast::Try) : String - _compile(node) { |statement| compile(statement) } - end - - def _compile(node : Ast::Try, & : Ast::Statement, Int32, Bool -> String) : String - catch_all = - node.catch_all.try do |catch| - js.let("_catch_all", js.arrow_function(%w[], "return #{compile(catch.expression)}")) + "\n\n" - end - - statements = node.statements - statements_size = statements.size - - body = - statements - .sort_by { |item| resolve_order.index(item) || -1 } - .map_with_index do |statement, index| - is_last = - (index + 1) == statements_size - - inner_prefix = ->(value : String) { - if is_last - "return #{value}" - else - prefix(node, statement, value) - end - } - - expression = - yield statement, index, is_last - - type = types[statement]? - - catches = - case type - when TypeChecker::Type - if type.name == "Result" && type.parameters[0] && !is_last - catched = - node.catches.map do |catch| - if catch.type == type.parameters[0].name - catch_body = - compile catch.expression - - variable = - js.variable_of(catch) - - js.statements([ - js.let(variable, "_error"), - "return #{catch_body}", - ]) - end - end - - if catched.empty? - "return _catch_all()" - else - js.statements(catched.compact) - end - end - end - - if catches && !catches.empty? - js.statements([ - js.let("_#{index}", expression), - js.if("_#{index} instanceof Err") do - js.statements([ - js.let("_error", "_#{index}._0"), - catches, - ]) - end, - inner_prefix.call("_#{index}._0"), - ]) - else - inner_prefix.call(expression) - end - end - - js.iif("#{catch_all}#{js.statements(body)}") - end - end -end diff --git a/src/formatter.cr b/src/formatter.cr index 6d682e5ad..9772d59a4 100644 --- a/src/formatter.cr +++ b/src/formatter.cr @@ -21,21 +21,6 @@ module Mint # Helpers for formatting things # -------------------------------------------------------------------------- - def format(node : Ast::Expression, - head_comment : Ast::Comment?, - tail_comment : Ast::Comment?) - head = - head_comment.try { |item| "#{format item}\n" } - - tail = - tail_comment.try { |item| "\n#{format item}" } - - body = - format node - - "#{head}#{body}#{tail}" - end - def format(nodes : Array(Ast::Node | String), separator : String) : String format(nodes).join(separator) end diff --git a/src/formatters/try.cr b/src/formatters/try.cr deleted file mode 100644 index 095b024d0..000000000 --- a/src/formatters/try.cr +++ /dev/null @@ -1,17 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::Try) : String - statements = - list node.statements + node.comments - - catches = - format node.catches - - node.catch_all.try do |catch| - catches.push format(catch) - end - - "try {\n#{indent(statements)}\n} #{catches.join(' ')}".strip - end - end -end diff --git a/src/messages/try_catch_type_mismatch.cr b/src/messages/try_catch_type_mismatch.cr deleted file mode 100644 index cfb8c5b28..000000000 --- a/src/messages/try_catch_type_mismatch.cr +++ /dev/null @@ -1,11 +0,0 @@ -message TryCatchTypeMismatch do - title "Type Error" - - block do - text "One of the catches does not match the trys return type." - end - - was_expecting_type expected, got - - snippet node -end diff --git a/src/messages/try_catched_all.cr b/src/messages/try_catched_all.cr deleted file mode 100644 index 4e279aece..000000000 --- a/src/messages/try_catched_all.cr +++ /dev/null @@ -1,9 +0,0 @@ -message TryCatchedAll do - title "Type Error" - - block do - text "All possible errors have been catched." - end - - snippet node, "There is a general catch which now can be safely removed:" -end diff --git a/src/messages/try_catches_nothing.cr b/src/messages/try_catches_nothing.cr deleted file mode 100644 index 6f451f602..000000000 --- a/src/messages/try_catches_nothing.cr +++ /dev/null @@ -1,11 +0,0 @@ -message TryCatchesNothing do - title "Type Error" - - block do - text "There are no statements that can result (as an error) in this type:" - end - - type got - - snippet node, "There is a catch for this type, which now can be removed:" -end diff --git a/src/messages/try_did_not_catch.cr b/src/messages/try_did_not_catch.cr deleted file mode 100644 index 6a7cd3a8a..000000000 --- a/src/messages/try_did_not_catch.cr +++ /dev/null @@ -1,16 +0,0 @@ -message TryDidNotCatch do - title "Type Error" - - block do - text "I am checking if all the possible errors are handled in" - bold "a try expression." - end - - block do - text "I found that these types are not handled:" - end - - type_list remaining - - snippet node -end diff --git a/src/messages/try_expected_closing_bracket.cr b/src/messages/try_expected_closing_bracket.cr deleted file mode 100644 index 01d93681d..000000000 --- a/src/messages/try_expected_closing_bracket.cr +++ /dev/null @@ -1,15 +0,0 @@ -message TryExpectedClosingBracket do - title "Syntax Error" - - block do - text "The" - bold "statements" - text "in a" - bold "try expression" - text "must be enclosed by brackets." - end - - was_looking_for "closing bracket", got, "}" - - snippet node -end diff --git a/src/messages/try_expected_opening_bracket.cr b/src/messages/try_expected_opening_bracket.cr deleted file mode 100644 index 0c82fdd67..000000000 --- a/src/messages/try_expected_opening_bracket.cr +++ /dev/null @@ -1,15 +0,0 @@ -message TryExpectedOpeningBracket do - title "Syntax Error" - - block do - text "The" - bold "statements" - text "in a" - bold "try expression" - text "must be enclosed by brackets." - end - - was_looking_for "opening bracket", got, "{" - - snippet node -end diff --git a/src/messages/try_expected_statement.cr b/src/messages/try_expected_statement.cr deleted file mode 100644 index 6e708978e..000000000 --- a/src/messages/try_expected_statement.cr +++ /dev/null @@ -1,13 +0,0 @@ -message TryExpectedStatement do - title "Syntax Error" - - block do - text "I was looking for at least one" - bold "statement" - text "for a try expression but found" - code got - text "instead." - end - - snippet node -end diff --git a/src/parsers/basic_expression.cr b/src/parsers/basic_expression.cr index 661bc09c0..de2939f36 100644 --- a/src/parsers/basic_expression.cr +++ b/src/parsers/basic_expression.cr @@ -30,7 +30,6 @@ module Mint next_call || sequence || parallel || - try_expression || case_expression || parenthesized_expression_or_inline_function || starts_with_uppercase || diff --git a/src/parsers/html_body.cr b/src/parsers/html_body.cr index 4fce0fb1b..83694474d 100644 --- a/src/parsers/html_body.cr +++ b/src/parsers/html_body.cr @@ -10,7 +10,6 @@ module Mint array || if_expression(for_html: true) || for_expression || - try_expression || case_expression || comment end diff --git a/src/parsers/try.cr b/src/parsers/try.cr deleted file mode 100644 index 2f3d2c73a..000000000 --- a/src/parsers/try.cr +++ /dev/null @@ -1,53 +0,0 @@ -module Mint - class Parser - syntax_error TryExpectedOpeningBracket - syntax_error TryExpectedClosingBracket - syntax_error TryExpectedStatement - - def try_expression : Ast::Try? - start do |start_position| - next unless keyword "try" - next unless whitespace? - whitespace - - body = block( - opening_bracket: TryExpectedOpeningBracket, - closing_bracket: TryExpectedClosingBracket - ) do - items = many { statement(:try) || comment } - - raise TryExpectedStatement if items.none?(Ast::Statement) - - items - end - - whitespace - catches = many { catch } - - whitespace - catch_all = self.catch_all - - statements = [] of Ast::Statement - comments = [] of Ast::Comment - - body.each do |item| - case item - when Ast::Statement - statements << item - when Ast::Comment - comments << item - end - end - - self << Ast::Try.new( - statements: statements, - catch_all: catch_all, - from: start_position, - comments: comments, - catches: catches, - to: position, - input: data) - end - end - end -end diff --git a/src/type_checker.cr b/src/type_checker.cr index 6f6b3c66d..dd81dff14 100644 --- a/src/type_checker.cr +++ b/src/type_checker.cr @@ -68,7 +68,6 @@ module Mint x = case i when Ast::Component then i.name when Ast::Function then i.name.value - when Ast::Try then "" when Ast::Call then "" else i diff --git a/src/type_checkers/try.cr b/src/type_checkers/try.cr deleted file mode 100644 index 8e6706319..000000000 --- a/src/type_checkers/try.cr +++ /dev/null @@ -1,105 +0,0 @@ -module Mint - class TypeChecker - type_error TryCatchTypeMismatch - type_error TryCatchesNothing - type_error TryDidNotCatch - type_error TryCatchedAll - - def check(node : Ast::Try) : Checkable - to_catch = [] of Checkable - - statements = node.statements - statements_size = statements.size - - # Resolve the types of the statements - types = scope statements do - statements.map_with_index do |statement, index| - new_type = resolve statement - - if index == (statements_size - 1) - # The last statement is not unwrapped so a Result can be returned directly - new_type - else - # If the statement has a name and it's a Result - if new_type.name == "Result" - type = - case - when new_type.parameters[0].name[0].ascii_lowercase? - # If the error type is a variable it can't be caught - # but it is still unwrapped - new_type.parameters[1] - when new_type.parameters.size == 2 - # If the error is not Never then that type needs to be catched - unless new_type.parameters[0].name == "Never" - to_catch << new_type.parameters[0] - end - new_type.parameters[1] - end - end - - type || new_type - end - end - end - - # Start reducing the catches using the last type - final_type = node.catches.reduce(types.last) do |type, catch| - catch_type = resolve_type(Type.new(catch.type)) - - # If the type does not need to be catched - raise TryCatchesNothing, { - "got" => catch_type, - "node" => catch, - } if to_catch.none? { |item| Comparer.compare(catch_type, item) } - - check_variable catch.variable - - checked_type = scope({catch.variable.value, catch_type, catch}) do - return_type = - resolve catch - - result_type = - Comparer.compare(return_type, type) - - # If the type does not match catch - raise TryCatchTypeMismatch, { - "got" => return_type, - "node" => catch, - "expected" => type, - } unless result_type - - result_type - end - - to_catch - .reject! { |item| Comparer.compare(catch_type, item) } - - checked_type - end - - catch_all_type = - node.catch_all.try do |catch| - raise TryCatchedAll, { - "node" => catch, - } if to_catch.empty? - - type = resolve catch.expression - - raise TryCatchTypeMismatch, { - "expected" => final_type, - "node" => catch, - "got" => type, - } unless Comparer.compare(type, final_type) - - type - end - - raise TryDidNotCatch, { - "remaining" => to_catch.uniq(&.to_s), - "node" => node, - } if !to_catch.empty? && catch_all_type.nil? - - final_type - end - end -end diff --git a/src/type_checkers/variable.cr b/src/type_checkers/variable.cr index 6fd57f7d8..deba61012 100644 --- a/src/type_checkers/variable.cr +++ b/src/type_checkers/variable.cr @@ -36,12 +36,6 @@ module Mint if value.parent.none? type - elsif value.parent.try? - if type.name == "Result" && type.parameters.size == 2 - type.parameters[1] - else - type - end else if type.name.in?("Result", "Promise") && type.parameters.size == 2 type.parameters[1] From 4ec874a4beb647736cf84c565aff93a0b787cd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Fri, 8 Oct 2021 11:24:03 +0200 Subject: [PATCH 13/20] Move formatting of brackets of the code block into it's formatter. --- core/source/Provider/ElementSize.mint | 9 +++++---- core/source/Provider/Intersection.mint | 9 +++++---- core/source/Provider/MediaQuery.mint | 9 +++++---- core/source/Provider/Mutation.mint | 9 +++++---- core/source/Provider/Websocket.mint | 9 +++++---- core/source/Validation.mint | 23 ++++++++++++----------- core/tests/tests/Storage/Session.mint | 2 +- src/ast/inline_function.cr | 2 +- src/formatters/block.cr | 11 +++++++++-- src/formatters/catch.cr | 2 +- src/formatters/catch_all.cr | 2 +- src/formatters/finally.cr | 2 +- src/formatters/for.cr | 4 ++-- src/formatters/function.cr | 2 +- src/formatters/get.cr | 2 +- src/formatters/if.cr | 8 ++++---- src/formatters/inline_function.cr | 10 ++-------- src/formatters/route.cr | 2 +- src/formatters/test.cr | 2 +- src/formatters/then.cr | 2 +- 20 files changed, 64 insertions(+), 57 deletions(-) diff --git a/core/source/Provider/ElementSize.mint b/core/source/Provider/ElementSize.mint index 308e79cad..f31598422 100644 --- a/core/source/Provider/ElementSize.mint +++ b/core/source/Provider/ElementSize.mint @@ -33,10 +33,11 @@ provider Provider.ElementSize : Provider.ElementSize.Subscription { for (subscription of subscriptions) { case (subscription.element) { - Maybe::Just(element) => { - ResizeObserver.observe(element, observer) - void - } + Maybe::Just(element) => + { + ResizeObserver.observe(element, observer) + void + } Maybe::Nothing => void } diff --git a/core/source/Provider/Intersection.mint b/core/source/Provider/Intersection.mint index 5a368eefb..2d0321da2 100644 --- a/core/source/Provider/Intersection.mint +++ b/core/source/Provider/Intersection.mint @@ -26,10 +26,11 @@ provider Provider.Intersection : Provider.Intersection.Subscription { Maybe::Just({subscription, observer}) } else { case (subscription.element) { - Maybe::Just(observed) => { - IntersectionObserver.unobserve(observed, observer) - Maybe::Nothing - } + Maybe::Just(observed) => + { + IntersectionObserver.unobserve(observed, observer) + Maybe::Nothing + } => Maybe::Nothing } diff --git a/core/source/Provider/MediaQuery.mint b/core/source/Provider/MediaQuery.mint index 63ddfe7f6..be8f23ccc 100644 --- a/core/source/Provider/MediaQuery.mint +++ b/core/source/Provider/MediaQuery.mint @@ -57,10 +57,11 @@ provider Provider.MediaQuery : Provider.MediaQuery.Subscription { case (subscription) { Maybe::Just => memo - Maybe::Nothing => { - listener() - Map.delete(query, memo) - } + Maybe::Nothing => + { + listener() + Map.delete(query, memo) + } } }) diff --git a/core/source/Provider/Mutation.mint b/core/source/Provider/Mutation.mint index 96a78b901..c3577fa93 100644 --- a/core/source/Provider/Mutation.mint +++ b/core/source/Provider/Mutation.mint @@ -43,10 +43,11 @@ provider Provider.Mutation : Provider.Mutation.Subscription { /* For each subscription observe the given elements. */ for (subscription of subscriptions) { case (subscription.element) { - Maybe::Just(element) => { - MutationObserver.observe(element, true, true, observer) - subscription.changes() - } + Maybe::Just(element) => + { + MutationObserver.observe(element, true, true, observer) + subscription.changes() + } Maybe::Nothing => next { } } diff --git a/core/source/Provider/Websocket.mint b/core/source/Provider/Websocket.mint index 5156aa741..c80afeefe 100644 --- a/core/source/Provider/Websocket.mint +++ b/core/source/Provider/Websocket.mint @@ -93,10 +93,11 @@ provider Provider.WebSocket : WebSocket.Config { (config : WebSocket.Config) { config.url == url }) case (subscription) { - Maybe::Nothing => { - WebSocket.closeWithoutReconnecting(socket) - Map.delete(url, memo) - } + Maybe::Nothing => + { + WebSocket.closeWithoutReconnecting(socket) + Map.delete(url, memo) + } Maybe::Just => memo } diff --git a/core/source/Validation.mint b/core/source/Validation.mint index 4d82f5c73..b174a8999 100644 --- a/core/source/Validation.mint +++ b/core/source/Validation.mint @@ -182,17 +182,18 @@ module Validation { item : Maybe(Tuple(String, String)) ) : Map(String, Array(String)) { case (item) { - Maybe::Just(error) => { - {key, message} = - error - - messages = - memo - |> Map.get(key) - |> Maybe.withDefault([]) - - Map.set(key, Array.push(message, messages), memo) - } + Maybe::Just(error) => + { + {key, message} = + error + + messages = + memo + |> Map.get(key) + |> Maybe.withDefault([]) + + Map.set(key, Array.push(message, messages), memo) + } => memo } diff --git a/core/tests/tests/Storage/Session.mint b/core/tests/tests/Storage/Session.mint index a0435d80b..f88682e4b 100644 --- a/core/tests/tests/Storage/Session.mint +++ b/core/tests/tests/Storage/Session.mint @@ -79,7 +79,7 @@ suite "Storage.Session.remove" { } suite "Storage.Session.size" { -test "it returns the number of elements in the storage" { + test "it returns the number of elements in the storage" { Storage.Session.set("a", "0") Storage.Session.set("b", "1") Storage.Session.set("c", "2") diff --git a/src/ast/inline_function.cr b/src/ast/inline_function.cr index 2e5aa844e..4846a36f4 100644 --- a/src/ast/inline_function.cr +++ b/src/ast/inline_function.cr @@ -5,7 +5,7 @@ module Mint def initialize(@arguments : Array(Argument), @type : TypeOrVariable?, - @body : Expression, + @body : Block, @input : Data, @from : Int32, @to : Int32) diff --git a/src/formatters/block.cr b/src/formatters/block.cr index c7035d35e..cd5077cfb 100644 --- a/src/formatters/block.cr +++ b/src/formatters/block.cr @@ -1,7 +1,14 @@ module Mint class Formatter - def format(node : Ast::Block) : String - list node.statements + def format(node : Ast::Block, inline = false) : String + body = + list node.statements + + if !inline || replace_skipped(body).includes?('\n') || node.new_line? + "{\n#{indent(body)}\n}" + else + "{ #{body} }" + end end end end diff --git a/src/formatters/catch.cr b/src/formatters/catch.cr index 8bd36e9a1..0ac8e3c26 100644 --- a/src/formatters/catch.cr +++ b/src/formatters/catch.cr @@ -10,7 +10,7 @@ module Mint type = format node.type - "catch #{type} => #{variable} {\n#{indent(body)}\n}" + "catch #{type} => #{variable} #{body}" end end end diff --git a/src/formatters/catch_all.cr b/src/formatters/catch_all.cr index 33209aea3..832c966c6 100644 --- a/src/formatters/catch_all.cr +++ b/src/formatters/catch_all.cr @@ -4,7 +4,7 @@ module Mint body = format node.expression - "catch {\n#{indent(body)}\n}" + "catch #{body}" end end end diff --git a/src/formatters/finally.cr b/src/formatters/finally.cr index d77c5c623..260ab3f53 100644 --- a/src/formatters/finally.cr +++ b/src/formatters/finally.cr @@ -4,7 +4,7 @@ module Mint body = format node.expression - "finally {\n#{indent(body)}\n}" + "finally #{body}" end end end diff --git a/src/formatters/for.cr b/src/formatters/for.cr index eac438f85..4d6100344 100644 --- a/src/formatters/for.cr +++ b/src/formatters/for.cr @@ -4,7 +4,7 @@ module Mint body = format node.condition - " when {\n#{indent(body)}\n}" + " when #{body}" end def format(node : Ast::For) : String @@ -20,7 +20,7 @@ module Mint condition = format node.condition - "for (#{arguments} of #{subject}) {\n#{indent(body)}\n}#{condition}" + "for (#{arguments} of #{subject}) #{body}#{condition}" end end end diff --git a/src/formatters/function.cr b/src/formatters/function.cr index b39129a5a..7aeedca1e 100644 --- a/src/formatters/function.cr +++ b/src/formatters/function.cr @@ -21,7 +21,7 @@ module Mint head = ["fun", name, arguments, type].compact!.join(' ') - "#{comment}#{head} {\n#{indent(body)}\n}" + "#{comment}#{head} #{body}" end end end diff --git a/src/formatters/get.cr b/src/formatters/get.cr index f9e94cada..6640dfd40 100644 --- a/src/formatters/get.cr +++ b/src/formatters/get.cr @@ -15,7 +15,7 @@ module Mint comment = node.comment.try { |item| "#{format(item)}\n" } - "#{comment}get #{name}#{type} {\n#{indent(body)}\n}" + "#{comment}get #{name}#{type} #{body}" end end end diff --git a/src/formatters/if.cr b/src/formatters/if.cr index 5a3bf3982..4c7695603 100644 --- a/src/formatters/if.cr +++ b/src/formatters/if.cr @@ -10,7 +10,7 @@ module Mint truthy = case truthy_item when Array(Ast::CssDefinition) - list truthy_item + "{\n#{indent(list(truthy_item))}\n}" when Ast::Node format truthy_item else @@ -24,12 +24,12 @@ module Mint body = case falsy_item when Array(Ast::CssDefinition) - list falsy_item + "{\n#{indent(list(falsy_item))}\n}" when Ast::Node format falsy_item end - " else {\n#{indent(body)}\n}" if body + " else #{body}" if body end condition = @@ -42,7 +42,7 @@ module Mint condition end - "if (#{condition}) {\n#{indent(truthy)}\n}#{falsy}" + "if (#{condition}) #{truthy}#{falsy}" end end end diff --git a/src/formatters/inline_function.cr b/src/formatters/inline_function.cr index c48b8a7e1..e9b93d121 100644 --- a/src/formatters/inline_function.cr +++ b/src/formatters/inline_function.cr @@ -2,7 +2,7 @@ module Mint class Formatter def format(node : Ast::InlineFunction) : String body = - format node.body + format node.body, true value = format node.arguments @@ -19,13 +19,7 @@ module Mint " : #{format(item)}" end - if replace_skipped(body).includes?('\n') || - replace_skipped(arguments).includes?('\n') || - node.new_line? - "(#{arguments})#{type} {\n#{indent(body)}\n}" - else - "(#{arguments})#{type} { #{body} }" - end + "(#{arguments})#{type} #{body}" end end end diff --git a/src/formatters/route.cr b/src/formatters/route.cr index 56ae36d46..9efdd1b37 100644 --- a/src/formatters/route.cr +++ b/src/formatters/route.cr @@ -14,7 +14,7 @@ module Mint " (#{args})" end - "#{node.url}#{arguments} {\n#{indent(body)}\n}" + "#{node.url}#{arguments} #{body}" end end end diff --git a/src/formatters/test.cr b/src/formatters/test.cr index 6b5c3124f..8eb5ff415 100644 --- a/src/formatters/test.cr +++ b/src/formatters/test.cr @@ -7,7 +7,7 @@ module Mint name = format node.name - "test #{name} {\n#{indent(expression)}\n}" + "test #{name} #{expression}" end end end diff --git a/src/formatters/then.cr b/src/formatters/then.cr index 7481a0a8a..f86ae32ce 100644 --- a/src/formatters/then.cr +++ b/src/formatters/then.cr @@ -4,7 +4,7 @@ module Mint body = format node.expression - "then {\n#{indent(body)}\n}" + "then #{body}" end end end From 3d24594f0b90ebb4409939622b17120a7017cbf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Fri, 8 Oct 2021 12:14:03 +0200 Subject: [PATCH 14/20] Replace promises with only one parameter in core. --- core/source/Clipboard.mint | 2 +- core/source/Dom.mint | 27 +++++----- core/source/File.mint | 16 +++--- core/source/Http.mint | 42 ++++++++------- core/source/Promise.mint | 29 ++++------- core/source/Provider/AnimationFrame.mint | 6 +-- core/source/Provider/ElementSize.mint | 6 +-- core/source/Provider/Intersection.mint | 4 +- core/source/Provider/Keydown.mint | 6 +-- core/source/Provider/Keyup.mint | 6 +-- core/source/Provider/MediaQuery.mint | 4 +- core/source/Provider/Mouse.mint | 8 +-- core/source/Provider/Mutation.mint | 6 +-- core/source/Provider/OutsideClick.mint | 6 +-- core/source/Provider/Resize.mint | 6 +-- core/source/Provider/Scroll.mint | 6 +-- core/source/Provider/Shortcuts.mint | 6 +-- core/source/Provider/TabFocus.mint | 10 ++-- core/source/Provider/Tick.mint | 6 +-- core/source/Provider/Url.mint | 6 +-- core/source/Provider/Websocket.mint | 66 +++++++++++------------- core/source/Test/Context.mint | 8 +-- core/source/Test/Window.mint | 4 +- core/source/Timer.mint | 4 +- core/source/WebSocket.mint | 14 ++--- core/source/Window.mint | 28 +++++----- core/tests/tests/Dom.mint | 9 ++-- core/tests/tests/Promise.mint | 66 ++++-------------------- spec/compilers/next_call | 2 +- spec/compilers/sequence_using_argument | 2 +- spec/formatters/next_call | 4 +- spec/formatters/next_call_multiline | 4 +- spec/type_checking/next_call | 4 +- spec/type_checking/store | 2 +- spec/type_checking/store_call_with_next | 2 +- src/message.cr | 4 +- src/type_checkers/next_call.cr | 2 +- 37 files changed, 186 insertions(+), 247 deletions(-) diff --git a/core/source/Clipboard.mint b/core/source/Clipboard.mint index fbda6e51f..102f8129e 100644 --- a/core/source/Clipboard.mint +++ b/core/source/Clipboard.mint @@ -1,7 +1,7 @@ /* This module has functions for manipulating the clipboard. */ module Clipboard { /* Sets the clipboards content to the given value. */ - fun set (value : String) : Promise(Never, Void) { + fun set (value : String) : Promise(Void) { ` (() => { // Create a textarea element diff --git a/core/source/Dom.mint b/core/source/Dom.mint index cff382fd6..ce4d8cf3f 100644 --- a/core/source/Dom.mint +++ b/core/source/Dom.mint @@ -152,18 +152,15 @@ module Dom { |> Dom.focus |> Dom.getElementById() */ - fun focus (maybeElement : Maybe(Dom.Element)) : Promise(Never, Void) { + fun focus (maybeElement : Maybe(Dom.Element)) : Promise(Void) { case (maybeElement) { Maybe::Just(element) => - sequence { + { focusWhenVisible(element) - - Promise.never() - } catch { - Promise.never() + Promise.resolve(void) } - Maybe::Nothing => Promise.never() + Maybe::Nothing => Promise.resolve(void) } } @@ -174,14 +171,14 @@ module Dom { |> Dom.getElementById |> Dom.focusWhenVisible() */ - fun focusWhenVisible (element : Dom.Element) : Promise(String, Void) { + fun focusWhenVisible (element : Dom.Element) : Promise(Result(String, Void)) { ` - new Promise((resolve, reject) => { + new Promise((resolve) => { let counter = 0 let focus = () => { if (counter > 15) { - reject('Could not focus the element in 150ms. Is it visible?') + resolve(#{Result::Err("Could not focus the element in 150ms. Is it visible?")}) } #{element}.focus() @@ -190,7 +187,7 @@ module Dom { counter++ setTimeout(focus, 10) } else { - resolve(#{void}) + resolve(#{Result::Ok(void)}) } } @@ -379,7 +376,7 @@ module Dom { Dom.blurActiveElement() */ - fun blurActiveElement : Promise(Never, Void) { + fun blurActiveElement : Promise(Void) { `document.activeElement && document.activeElement.blur()` } @@ -449,7 +446,7 @@ module Dom { } /* Focuses the first focusable descendant of the given element. */ - fun focusFirst (element : Dom.Element) : Promise(Never, Void) { + fun focusFirst (element : Dom.Element) : Promise(Void) { element |> getFocusableElements |> Array.first @@ -461,7 +458,7 @@ module Dom { Dom.smoothScrollTo(element, 10, 10) */ - fun smoothScrollTo (element : Dom.Element, left : Number, top : Number) : Promise(Never, Void) { + fun smoothScrollTo (element : Dom.Element, left : Number, top : Number) : Promise(Void) { `#{element}.scrollTo({ behavior: 'smooth', left: #{left}, @@ -474,7 +471,7 @@ module Dom { Dom.scrollTo(element, 10, 10) */ - fun scrollTo (element : Dom.Element, left : Number, top : Number) : Promise(Never, Void) { + fun scrollTo (element : Dom.Element, left : Number, top : Number) : Promise(Void) { `#{element}.scrollTo({ left: #{left}, top: #{top} diff --git a/core/source/File.mint b/core/source/File.mint index 388bb6f85..9ed9fcc6a 100644 --- a/core/source/File.mint +++ b/core/source/File.mint @@ -52,7 +52,7 @@ module File { Debug.log(files) } */ - fun selectMultiple (accept : String) : Promise(Never, Array(File)) { + fun selectMultiple (accept : String) : Promise(Array(File)) { ` (() => { let input = document.createElement('input') @@ -69,7 +69,7 @@ module File { document.body.appendChild(input) - return new Promise((resolve, reject) => { + return new Promise((resolve) => { input.addEventListener('change', () => { resolve(Array.from(input.files)) }) @@ -93,7 +93,7 @@ module File { Debug.log(file) } */ - fun select (accept : String) : Promise(Never, File) { + fun select (accept : String) : Promise(File) { ` (() => { let input = document.createElement('input') @@ -109,7 +109,7 @@ module File { document.body.appendChild(input) - return new Promise((resolve, reject) => { + return new Promise((resolve) => { input.addEventListener('change', () => { resolve(input.files[0]) }) @@ -133,11 +133,11 @@ module File { url == "data:text/plain;...." } */ - fun readAsDataURL (file : File) : Promise(Never, String) { + fun readAsDataURL (file : File) : Promise(String) { ` (() => { let reader = new FileReader(); - return new Promise((resolve, reject) => { + return new Promise((resolve) => { reader.addEventListener('load', (event) => { resolve(reader.result) }) @@ -160,11 +160,11 @@ module File { url == "Some content..." } */ - fun readAsString (file : File) : Promise(Never, String) { + fun readAsString (file : File) : Promise(String) { ` (() => { let reader = new FileReader(); - return new Promise((resolve, reject) => { + return new Promise((resolve) => { reader.addEventListener('load', (event) => { resolve(reader.result) }) diff --git a/core/source/Http.mint b/core/source/Http.mint index 3c0399273..62de0011e 100644 --- a/core/source/Http.mint +++ b/core/source/Http.mint @@ -45,15 +45,17 @@ enum Http.Error { Module for sending HTTP requests. ``` -sequence { - response = - "https://httpbin.org/get" - |> Http.get() - |> Http.send() +await request = + "https://httpbin.org/get" + |> Http.get() + |> Http.send() + +case (request) { + Result::Ok(response) => + Debug.log(response) - Debug.log(response) -} catch Http.ErrorResponse => error { - Debug.log(error) + Result::Err(error) => + Debug.log(error) } ``` */ @@ -275,7 +277,7 @@ module Http { |> Http.get() |> Http.send() */ - fun send (request : Http.Request) : Promise(Http.ErrorResponse, Http.Response) { + fun send (request : Http.Request) : Promise(Result(Http.ErrorResponse, Http.Response)) { sendWithId(Uid.generate(), request) } @@ -286,7 +288,7 @@ module Http { |> Http.get() |> Http.sendWithId("my-request") */ - fun sendWithId (uid : String, request : Http.Request) : Promise(Http.ErrorResponse, Http.Response) { + fun sendWithId (uid : String, request : Http.Request) : Promise(Result(Http.ErrorResponse, Http.Response)) { ` new Promise((resolve, reject) => { if (!this._requests) { this._requests = {} } @@ -302,11 +304,11 @@ module Http { } catch (error) { delete this._requests[#{uid}] - reject(#{{ + resolve(#{Result::Err({ type = Http.Error::BadUrl, status = `xhr.status`, url = request.url - }}) + })}) } #{request.headers}.forEach((item) => { @@ -316,40 +318,40 @@ module Http { xhr.addEventListener('error', (event) => { delete this._requests[#{uid}] - reject(#{{ + resolve(#{Result::Err({ type = Http.Error::NetworkError, status = `xhr.status`, url = request.url - }}) + })}) }) xhr.addEventListener('timeout', (event) => { delete this._requests[#{uid}] - reject(#{{ + resolve(#{Result::Err({ type = Http.Error::Timeout, status = `xhr.status`, url = request.url - }}) + })}) }) xhr.addEventListener('load', (event) => { delete this._requests[#{uid}] - resolve(#{{ + resolve(#{Result::Ok({ body = `xhr.responseText`, status = `xhr.status` - }}) + })}) }) xhr.addEventListener('abort', (event) => { delete this._requests[#{uid}] - reject(#{{ + resolve(#{Result::Err({ type = Http.Error::Aborted, status = `xhr.status`, url = request.url - }}) + })}) }) xhr.send(#{request.body}) diff --git a/core/source/Promise.mint b/core/source/Promise.mint index 6a256a543..30fb1c0c4 100644 --- a/core/source/Promise.mint +++ b/core/source/Promise.mint @@ -1,7 +1,7 @@ /* Utility functions for working with promises. */ module Promise { /* Returns a resolved promise with `Void` which never fails. */ - fun never : Promise(Never, Void) { + fun never : Promise(Void) { resolve(void) } @@ -9,7 +9,7 @@ module Promise { Returns a resolved promise with `Void` which never fails with one argument which is ignored. */ - fun never1 (param1 : a) : Promise(Never, Void) { + fun never1 (param1 : a) : Promise(Void) { Promise.resolve(void) } @@ -17,7 +17,7 @@ module Promise { Returns a resolved promise with `Void` which never fails with two arguments which are ignored. */ - fun never2 (param1 : a, param2 : b) : Promise(Never, Void) { + fun never2 (param1 : a, param2 : b) : Promise(Void) { Promise.resolve(void) } @@ -25,38 +25,29 @@ module Promise { Returns a resolved promise with `Void` which never fails with three arguments which are ignored. */ - fun never3 (param1 : a, param2 : b, param3 : c) : Promise(Never, Void) { + fun never3 (param1 : a, param2 : b, param3 : c) : Promise(Void) { Promise.resolve(void) } - /* Creates an already rejected `Promise` */ - fun reject (input : a) : Promise(a, b) { - `Promise.reject(#{input})` - } - /* Creates an already resolved `Promise` */ - fun resolve (input : a) : Promise(b, a) { + fun resolve (input : a) : Promise(a) { `Promise.resolve(#{input})` } /* - Create a promise with manual resolve / reject. + Create a promise with manual resolve. - {resolve, reject, promise} = Promise.create() + {resolve, promise} = Promise.create() */ - fun create : Tuple(Function(value, Void), Function(error, Void), Promise(error, value)) { + fun create : Tuple(Function(value, Void), Promise(value)) { ` (() => { - let resolve, reject; + let resolve; - const promise = new Promise((a, b) => { - resolve = a - reject = b - }) + const promise = new Promise((a) => { resolve = a }) return [ (value) => resolve(value), - (error) => reject(error), promise ] })() diff --git a/core/source/Provider/AnimationFrame.mint b/core/source/Provider/AnimationFrame.mint index 86ba16498..e12d4720f 100644 --- a/core/source/Provider/AnimationFrame.mint +++ b/core/source/Provider/AnimationFrame.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.AnimationFrame` */ record Provider.AnimationFrame.Subscription { - frames : Function(Number, Promise(Never, Void)) + frames : Function(Number, Promise(Void)) } /* A provider for the `requestAnimationFrame` API. */ @@ -9,7 +9,7 @@ provider Provider.AnimationFrame : Provider.AnimationFrame.Subscription { state id : Number = -1 /* Call the subscribers. */ - fun process (timestamp : Number) : Promise(Never, Void) { + fun process (timestamp : Number) : Promise(Void) { for (subscription of subscriptions) { subscription.frames(timestamp) } @@ -18,7 +18,7 @@ provider Provider.AnimationFrame : Provider.AnimationFrame.Subscription { } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { next { id = AnimationFrame.cancel(id) } } else if (id == -1) { diff --git a/core/source/Provider/ElementSize.mint b/core/source/Provider/ElementSize.mint index f31598422..01007ebe0 100644 --- a/core/source/Provider/ElementSize.mint +++ b/core/source/Provider/ElementSize.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.ElementSize` */ record Provider.ElementSize.Subscription { - changes : Function(Dom.Dimensions, Promise(Never, Void)), + changes : Function(Dom.Dimensions, Promise(Void)), element : Maybe(Dom.Element) } @@ -13,7 +13,7 @@ provider Provider.ElementSize : Provider.ElementSize.Subscription { state observer = ResizeObserver.new(notify) /* Notifies all subscribers when there are changes. */ - fun notify (entries : Array(ResizeObserver.Entry)) : Array(Array(Promise(Never, Void))) { + fun notify (entries : Array(ResizeObserver.Entry)) : Array(Array(Promise(Void))) { for (entry of entries) { for (subscription of subscriptions) { if (subscription.element == Maybe::Just(entry.target)) { @@ -26,7 +26,7 @@ provider Provider.ElementSize : Provider.ElementSize.Subscription { } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { for (element of Array.compact(observedElements)) { ResizeObserver.unobserve(element, observer) } diff --git a/core/source/Provider/Intersection.mint b/core/source/Provider/Intersection.mint index 2d0321da2..1e1a60c1b 100644 --- a/core/source/Provider/Intersection.mint +++ b/core/source/Provider/Intersection.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.Intersection` */ record Provider.Intersection.Subscription { - callback : Function(Number, Promise(Never, Void)), + callback : Function(Number, Promise(Void)), element : Maybe(Dom.Element), rootMargin : String, threshold : Number @@ -12,7 +12,7 @@ provider Provider.Intersection : Provider.Intersection.Subscription { state observers : Array(Tuple(Provider.Intersection.Subscription, IntersectionObserver)) = [] /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { /* Gather all of the current observers, and remove ones that are no longer present. diff --git a/core/source/Provider/Keydown.mint b/core/source/Provider/Keydown.mint index 6ab0c201a..479c46ba2 100644 --- a/core/source/Provider/Keydown.mint +++ b/core/source/Provider/Keydown.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.Keydown` */ record Provider.Keydown.Subscription { - keydowns : Function(Html.Event, Promise(Never, Void)) + keydowns : Function(Html.Event, Promise(Void)) } /* A provider for global key down events. */ @@ -9,14 +9,14 @@ provider Provider.Keydown : Provider.Keydown.Subscription { state listener : Maybe(Function(Void)) = Maybe::Nothing /* The event handler. */ - fun handle (event : Html.Event) : Array(Promise(Never, Void)) { + fun handle (event : Html.Event) : Array(Promise(Void)) { for (subscription of subscriptions) { subscription.keydowns(event) } } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) next { listener = Maybe::Nothing } diff --git a/core/source/Provider/Keyup.mint b/core/source/Provider/Keyup.mint index ce266fda0..91e18cf5d 100644 --- a/core/source/Provider/Keyup.mint +++ b/core/source/Provider/Keyup.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.Keyup` */ record Provider.Keyup.Subscription { - keyups : Function(Html.Event, Promise(Never, Void)) + keyups : Function(Html.Event, Promise(Void)) } /* A provider for global key up events. */ @@ -9,14 +9,14 @@ provider Provider.Keyup : Provider.Keyup.Subscription { state listener : Maybe(Function(Void)) = Maybe::Nothing /* The event handler. */ - fun handle (event : Html.Event) : Array(Promise(Never, Void)) { + fun handle (event : Html.Event) : Array(Promise(Void)) { for (subscription of subscriptions) { subscription.keyups(event) } } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) next { listener = Maybe::Nothing } diff --git a/core/source/Provider/MediaQuery.mint b/core/source/Provider/MediaQuery.mint index be8f23ccc..0a7f2be4f 100644 --- a/core/source/Provider/MediaQuery.mint +++ b/core/source/Provider/MediaQuery.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.MediaQuery` */ record Provider.MediaQuery.Subscription { - changes : Function(Bool, Promise(Never, Void)), + changes : Function(Bool, Promise(Void)), query : String } @@ -12,7 +12,7 @@ provider Provider.MediaQuery : Provider.MediaQuery.Subscription { /* The map of the listeners. */ state listeners : Map(String, Function(Void)) = Map.empty() - fun update : Promise(Never, Void) { + fun update : Promise(Void) { updatedListeners = subscriptions |> Array.reduce( diff --git a/core/source/Provider/Mouse.mint b/core/source/Provider/Mouse.mint index 4c70e9e7b..822b1c561 100644 --- a/core/source/Provider/Mouse.mint +++ b/core/source/Provider/Mouse.mint @@ -1,8 +1,8 @@ /* Represents a subscription for `Provider.Mouse` */ record Provider.Mouse.Subscription { - clicks : Function(Html.Event, Promise(Never, Void)), - moves : Function(Html.Event, Promise(Never, Void)), - ups : Function(Html.Event, Promise(Never, Void)) + clicks : Function(Html.Event, Promise(Void)), + moves : Function(Html.Event, Promise(Void)), + ups : Function(Html.Event, Promise(Void)) } /* A provider for global mouse events. */ @@ -11,7 +11,7 @@ provider Provider.Mouse : Provider.Mouse.Subscription { state listeners : Maybe(Tuple(Function(Void), Function(Void), Function(Void))) = Maybe::Nothing /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map( ( diff --git a/core/source/Provider/Mutation.mint b/core/source/Provider/Mutation.mint index c3577fa93..c9bc36d09 100644 --- a/core/source/Provider/Mutation.mint +++ b/core/source/Provider/Mutation.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.Mutation` */ record Provider.Mutation.Subscription { - changes : Function(Promise(Never, Void)), + changes : Function(Promise(Void)), element : Maybe(Dom.Element) } @@ -16,7 +16,7 @@ provider Provider.Mutation : Provider.Mutation.Subscription { state observer = MutationObserver.new(notify) /* Notifies the subscribers when changes occur. */ - fun notify (entries : Array(MutationObserver.Entry)) : Array(Array(Promise(Never, Void))) { + fun notify (entries : Array(MutationObserver.Entry)) : Array(Array(Promise(Void))) { for (entry of entries) { for (subscription of subscriptions) { case (subscription.element) { @@ -34,7 +34,7 @@ provider Provider.Mutation : Provider.Mutation.Subscription { } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { /* Unobserve all elements. */ for (element of Array.compact(observedElements)) { MutationObserver.unobserve(element, observer) diff --git a/core/source/Provider/OutsideClick.mint b/core/source/Provider/OutsideClick.mint index 350c68e35..f4f78486d 100644 --- a/core/source/Provider/OutsideClick.mint +++ b/core/source/Provider/OutsideClick.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.OutsideClick` */ record Provider.OutsideClick.Subscription { - clicks : Function(Promise(Never, Void)), + clicks : Function(Promise(Void)), elements : Array(Maybe(Dom.Element)) } @@ -10,7 +10,7 @@ provider Provider.OutsideClick : Provider.OutsideClick.Subscription { state listener : Maybe(Function(Void)) = Maybe::Nothing /* The event handler. */ - fun handle (event : Html.Event) : Array(Promise(Never, Void)) { + fun handle (event : Html.Event) : Array(Promise(Void)) { for (subscription of subscriptions) { inside = subscription.elements @@ -26,7 +26,7 @@ provider Provider.OutsideClick : Provider.OutsideClick.Subscription { } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) next { listener = Maybe::Nothing } diff --git a/core/source/Provider/Resize.mint b/core/source/Provider/Resize.mint index d2f85ffd9..5580b3742 100644 --- a/core/source/Provider/Resize.mint +++ b/core/source/Provider/Resize.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.Resize` */ record Provider.Resize.Subscription { - resizes : Function(Html.Event, Promise(Never, Void)) + resizes : Function(Html.Event, Promise(Void)) } /* A provider for handling changes of the viewport. */ @@ -8,14 +8,14 @@ provider Provider.Resize : Provider.Resize.Subscription { /* The listener unsubscribe function. */ state listener : Maybe(Function(Void)) = Maybe::Nothing - fun handle (event : Html.Event) : Array(Promise(Never, Void)) { + fun handle (event : Html.Event) : Array(Promise(Void)) { for (subscription of subscriptions) { subscription.resizes(event) } } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) next { listener = Maybe::Nothing } diff --git a/core/source/Provider/Scroll.mint b/core/source/Provider/Scroll.mint index ea0254f04..44fea85d1 100644 --- a/core/source/Provider/Scroll.mint +++ b/core/source/Provider/Scroll.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.Scroll` */ record Provider.Scroll.Subscription { - scrolls : Function(Html.Event, Promise(Never, Void)) + scrolls : Function(Html.Event, Promise(Void)) } /* A provider for global scroll events. */ @@ -8,14 +8,14 @@ provider Provider.Scroll : Provider.Scroll.Subscription { /* The listener unsubscribe function. */ state listener : Maybe(Function(Void)) = Maybe::Nothing - fun handle (event : Html.Event) : Array(Promise(Never, Void)) { + fun handle (event : Html.Event) : Array(Promise(Void)) { for (subscription of subscriptions) { subscription.scrolls(event) } } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) next { listener = Maybe::Nothing } diff --git a/core/source/Provider/Shortcuts.mint b/core/source/Provider/Shortcuts.mint index d34265292..27df795e2 100644 --- a/core/source/Provider/Shortcuts.mint +++ b/core/source/Provider/Shortcuts.mint @@ -7,7 +7,7 @@ Represents a shortcut: - **bypassFocused** - whether or not trigger the action if something is in focus */ record Provider.Shortcuts.Shortcut { - action : Function(Promise(Never, Void)), + action : Function(Promise(Void)), condition : Function(Bool), shortcut : Array(Number), bypassFocused : Bool @@ -24,7 +24,7 @@ provider Provider.Shortcuts : Provider.Shortcuts.Subscription { state listener : Maybe(Function(Void)) = Maybe::Nothing /* Handles keypress events. */ - fun handle (event : Html.Event) : Array(Array(Promise(Never, Void))) { + fun handle (event : Html.Event) : Array(Array(Promise(Void))) { control = if (event.ctrlKey && event.keyCode != 17) { Maybe::Just(17) @@ -63,7 +63,7 @@ provider Provider.Shortcuts : Provider.Shortcuts.Subscription { } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) next { listener = Maybe::Nothing } diff --git a/core/source/Provider/TabFocus.mint b/core/source/Provider/TabFocus.mint index ab6790b60..0857a42b1 100644 --- a/core/source/Provider/TabFocus.mint +++ b/core/source/Provider/TabFocus.mint @@ -1,7 +1,7 @@ /* Represents a subscription for `Provider.TabFocus` */ record Provider.TabFocus.Subscription { - onTabOut : Function(Promise(Never, Void)), - onTabIn : Function(Promise(Never, Void)), + onTabOut : Function(Promise(Void)), + onTabIn : Function(Promise(Void)), element : Maybe(Dom.Element) } @@ -11,7 +11,7 @@ provider Providers.TabFocus : Provider.TabFocus.Subscription { state listeners : Maybe(Tuple(Function(Void), Function(Void))) = Maybe::Nothing /* The `keyUp` event handler. */ - fun handleKeyUp (event : Html.Event) : Array(Promise(Never, Void)) { + fun handleKeyUp (event : Html.Event) : Array(Promise(Void)) { if (event.keyCode == Html.Event:TAB) { activeElement = Dom.getActiveElement() @@ -27,7 +27,7 @@ provider Providers.TabFocus : Provider.TabFocus.Subscription { } /* The `keyDown` event handler. */ - fun handleKeyDown (event : Html.Event) : Array(Promise(Never, Void)) { + fun handleKeyDown (event : Html.Event) : Array(Promise(Void)) { if (event.keyCode == Html.Event:TAB) { target = Maybe::Just(event.target) @@ -43,7 +43,7 @@ provider Providers.TabFocus : Provider.TabFocus.Subscription { } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map( (methods : Tuple(Function(Void), Function(Void))) { diff --git a/core/source/Provider/Tick.mint b/core/source/Provider/Tick.mint index fc81c3fc5..24f1137b0 100644 --- a/core/source/Provider/Tick.mint +++ b/core/source/Provider/Tick.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.Tick` */ record Provider.Tick.Subscription { - ticks : Function(Promise(Never, Void)) + ticks : Function(Promise(Void)) } /* A provider for periodic updates (every 1 seconds). */ @@ -8,14 +8,14 @@ provider Provider.Tick : Provider.Tick.Subscription { state id : Number = -1 /* Call the subscribers. */ - fun process : Array(Promise(Never, Void)) { + fun process : Array(Promise(Void)) { for (subscription of subscriptions) { subscription.ticks() } } /* Attaches the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { next { id = `clearInterval(#{id}) || -1` } } else if (id == -1) { diff --git a/core/source/Provider/Url.mint b/core/source/Provider/Url.mint index b2bd82d12..f72dc705d 100644 --- a/core/source/Provider/Url.mint +++ b/core/source/Provider/Url.mint @@ -1,6 +1,6 @@ /* Represents a subscription for `Provider.Url` */ record Provider.Url.Subscription { - changes : Function(Url, Promise(Never, Void)) + changes : Function(Url, Promise(Void)) } /* A provider for global "popstate" events, which emit the current URL. */ @@ -9,7 +9,7 @@ provider Provider.Url : Provider.Url.Subscription { state listener : Maybe(Function(Void)) = Maybe::Nothing /* The event handler. */ - fun handle (event : Html.Event) : Array(Promise(Never, Void)) { + fun handle (event : Html.Event) : Array(Promise(Void)) { url = Window.url() @@ -19,7 +19,7 @@ provider Provider.Url : Provider.Url.Subscription { } /* Updates the provider. */ - fun update : Promise(Never, Void) { + fun update : Promise(Void) { if (Array.isEmpty(subscriptions)) { Maybe.map((unsubscribe : Function(Void)) { unsubscribe() }, listener) next { listener = Maybe::Nothing } diff --git a/core/source/Provider/Websocket.mint b/core/source/Provider/Websocket.mint index c80afeefe..91db31852 100644 --- a/core/source/Provider/Websocket.mint +++ b/core/source/Provider/Websocket.mint @@ -2,55 +2,47 @@ provider Provider.WebSocket : WebSocket.Config { state connections : Map(String, WebSocket) = Map.empty() - fun onOpen (url : String, socket : WebSocket) : Promise(Never, Void) { - sequence { - for (subscription of subscriptions) { - subscription.onOpen(socket) - } when { - subscription.url == url - } - - next { } + fun onOpen (url : String, socket : WebSocket) : Promise(Void) { + for (subscription of subscriptions) { + subscription.onOpen(socket) + } when { + subscription.url == url } - } - fun onMessage (url : String, data : String) : Promise(Never, Void) { - sequence { - for (subscription of subscriptions) { - subscription.onMessage(data) - } when { - subscription.url == url - } + next { } + } - next { } + fun onMessage (url : String, data : String) : Promise(Void) { + for (subscription of subscriptions) { + subscription.onMessage(data) + } when { + subscription.url == url } - } - fun onError (url : String) : Promise(Never, Void) { - sequence { - for (subscription of subscriptions) { - subscription.onError() - } when { - subscription.url == url - } + next { } + } - next { } + fun onError (url : String) : Promise(Void) { + for (subscription of subscriptions) { + subscription.onError() + } when { + subscription.url == url } - } - fun onClose (url : String) : Promise(Never, Void) { - sequence { - for (subscription of subscriptions) { - subscription.onClose() - } when { - subscription.url == url - } + next { } + } - next { } + fun onClose (url : String) : Promise(Void) { + for (subscription of subscriptions) { + subscription.onClose() + } when { + subscription.url == url } + + next { } } - fun update : Promise(Never, Void) { + fun update : Promise(Void) { updatedConnections = subscriptions |> Array.reduce( diff --git a/core/source/Test/Context.mint b/core/source/Test/Context.mint index c52730727..19c4800d4 100644 --- a/core/source/Test/Context.mint +++ b/core/source/Test/Context.mint @@ -22,9 +22,9 @@ module Test.Context { } */ fun then ( - proc : Function(a, Promise(b, c)), + proc : Function(a, Promise(b)), context : Test.Context(a) - ) : Test.Context(c) { + ) : Test.Context(b) { ` #{context}.step((subject) => { return #{proc}(subject) @@ -43,7 +43,7 @@ module Test.Context { */ fun timeout (duration : Number, context : Test.Context(a)) : Test.Context(a) { context - |> then((subject : a) : Promise(Never, a) { Timer.timeout(duration, subject) }) + |> then((subject : a) : Promise(a) { Timer.timeout(duration, subject) }) } /* @@ -101,7 +101,7 @@ module Test.Context { */ fun map (method : Function(a, b), context : Test.Context(a)) : Test.Context(b) { context - |> then((item : a) : Promise(Never, b) { Promise.resolve(method(item)) }) + |> then((item : a) : Promise(b) { Promise.resolve(method(item)) }) } /* Spies on the given entity if it's a function. */ diff --git a/core/source/Test/Window.mint b/core/source/Test/Window.mint index 7cfa72bab..e7671085e 100644 --- a/core/source/Test/Window.mint +++ b/core/source/Test/Window.mint @@ -3,7 +3,7 @@ module Test.Window { /* Sets the horizontal scroll position of the window during a test. */ fun setScrollLeft (to : Number, context : Test.Context(a)) : Test.Context(a) { Test.Context.then( - (subject : Dom.Element) : Promise(Never, a) { + (subject : Dom.Element) : Promise(a) { Window.setScrollLeft(100) Promise.resolve(subject) }, @@ -13,7 +13,7 @@ module Test.Window { /* Sets the vertical scroll position of the window during a test. */ fun setScrollTop (to : Number, context : Test.Context(a)) : Test.Context(a) { Test.Context.then( - (subject : Dom.Element) : Promise(Never, a) { + (subject : Dom.Element) : Promise(a) { Window.setScrollTop(100) Promise.resolve(subject) }, diff --git a/core/source/Timer.mint b/core/source/Timer.mint index 2a1da5d39..03fd05d0f 100644 --- a/core/source/Timer.mint +++ b/core/source/Timer.mint @@ -4,7 +4,7 @@ module Timer { Returns a promise which resolves after the given number of time in milliseconds. */ - fun timeout (duration : Number, subject : a) : Promise(Never, a) { + fun timeout (duration : Number, subject : a) : Promise(a) { ` new Promise((resolve) => { setTimeout(() => { @@ -15,7 +15,7 @@ module Timer { } /* Returns a promise which resolves after the next `animationFrame`. */ - fun nextFrame (subject : a) : Promise(Never, a) { + fun nextFrame (subject : a) : Promise(a) { ` new Promise((resolve) => { requestAnimationFrame(() => { diff --git a/core/source/WebSocket.mint b/core/source/WebSocket.mint index 2e0bf4cda..2bb827c91 100644 --- a/core/source/WebSocket.mint +++ b/core/source/WebSocket.mint @@ -1,8 +1,8 @@ record WebSocket.Config { - onOpen : Function(WebSocket, Promise(Never, Void)), - onMessage : Function(String, Promise(Never, Void)), - onError : Function(Promise(Never, Void)), - onClose : Function(Promise(Never, Void)), + onOpen : Function(WebSocket, Promise(Void)), + onMessage : Function(String, Promise(Void)), + onError : Function(Promise(Void)), + onClose : Function(Promise(Void)), reconnectOnClose : Bool, url : String } @@ -73,7 +73,7 @@ module WebSocket { WebSocket.send("some data", websocket) */ - fun send (data : String, socket : WebSocket) : Promise(Never, Void) { + fun send (data : String, socket : WebSocket) : Promise(Void) { `#{socket}.send(#{data})` } @@ -85,7 +85,7 @@ module WebSocket { If the `reconnectOnClose` flag was specified then the connection will reconnect using this function. */ - fun close (socket : WebSocket) : Promise(Never, Void) { + fun close (socket : WebSocket) : Promise(Void) { `#{socket}.close()` } @@ -95,7 +95,7 @@ module WebSocket { WebSocket.closeWithoutReconnecting(websocket) */ - fun closeWithoutReconnecting (socket : WebSocket) : Promise(Never, Void) { + fun closeWithoutReconnecting (socket : WebSocket) : Promise(Void) { ` (() => { #{socket}.shouldNotReconnect = true; diff --git a/core/source/Window.mint b/core/source/Window.mint index f2e2c67d1..5e0dc4222 100644 --- a/core/source/Window.mint +++ b/core/source/Window.mint @@ -1,11 +1,11 @@ module Window { /* Navigates to the given URL. */ - fun navigate (url : String) : Promise(Never, Void) { + fun navigate (url : String) : Promise(Void) { `_navigate(#{url})` } /* Sets the URL of the window without navigating to it. */ - fun setUrl (url : String) : Promise(Never, Void) { + fun setUrl (url : String) : Promise(Void) { `_navigate(#{url}, false)` } @@ -15,7 +15,7 @@ module Window { } /* Sets the windows title. */ - fun setTitle (title : String) : Promise(Never, Void) { + fun setTitle (title : String) : Promise(Void) { `document.title = #{title}` } @@ -82,12 +82,12 @@ module Window { } /* Sets the horizontal scroll position of the window in pixels. */ - fun setScrollTop (position : Number) : Promise(Never, Void) { + fun setScrollTop (position : Number) : Promise(Void) { `window.scrollTo(#{scrollTop()}, #{position})` } /* Sets the vertical scroll position of the window in pixels. */ - fun setScrollLeft (position : Number) : Promise(Never, Void) { + fun setScrollLeft (position : Number) : Promise(Void) { `window.scrollTo(#{position}, #{scrollLeft()})` } @@ -98,15 +98,15 @@ module Window { This function returns a promise but blocks execution until the popup is closed. */ - fun prompt (label : String, current : String) : Promise(String, String) { + fun prompt (label : String, current : String) : Promise(Result(String, String)) { ` new Promise((resolve, reject) => { let result = window.prompt(#{label}, #{current}) if (result) { - resolve(result) + resolve(#{Result::Ok(`result`)}) } else { - reject("User cancelled!") + reject(#{Result::Err("User cancelled!")}) } }) ` @@ -118,15 +118,15 @@ module Window { This function returns a promise but blocks execution until the popup is closed. */ - fun confirm (message : String) : Promise(String, Void) { + fun confirm (message : String) : Promise(Result(String, Void)) { ` new Promise((resolve, reject) => { let result = window.confirm(#{message}) if (result) { - resolve(result); + resolve(#{Result::Ok(`result`)}) } else { - reject("User cancelled!") + reject(#{Result::Err("User cancelled!")}) } }) ` @@ -138,7 +138,7 @@ module Window { This function returns a promise but blocks execution until the popup is closed. */ - fun alert (message : String) : Promise(Never, Void) { + fun alert (message : String) : Promise(Void) { ` new Promise((resolve, reject) => { window.alert(#{message}) @@ -173,7 +173,7 @@ module Window { This function triggers that behavior. */ - fun triggerHashJump : Promise(Never, Void) { + fun triggerHashJump : Promise(Void) { `requestAnimationFrame(() => { if (window.location.hash) { window.location.href = window.location.hash @@ -187,7 +187,7 @@ module Window { Window.open("https://www.google.com") */ - fun open (url : String) : Promise(Never, Void) { + fun open (url : String) : Promise(Void) { `window.open(#{url})` } diff --git a/core/tests/tests/Dom.mint b/core/tests/tests/Dom.mint index 5a5dcc9b2..4edb012ee 100644 --- a/core/tests/tests/Dom.mint +++ b/core/tests/tests/Dom.mint @@ -110,11 +110,10 @@ component Test.Dom.Focus { } } - fun show : Promise(Never, Void) { - sequence { - Timer.timeout(100, "") - next { shown = true } - } + fun show : Promise(Void) { + await Timer.timeout(100, "") + + next { shown = true } } fun focus : Promise(String, Void) { diff --git a/core/tests/tests/Promise.mint b/core/tests/tests/Promise.mint index d6efd1a0e..13b8d159d 100644 --- a/core/tests/tests/Promise.mint +++ b/core/tests/tests/Promise.mint @@ -1,26 +1,11 @@ component Test.Promise { state result : String = "" - fun reject : Promise(Never, Void) { - sequence { - rejected = - Promise.reject("rejected") + fun resolve : Promise(Void) { + await newResult = + Promise.resolve("resolved") - Promise.never() - } catch String => error { - next { result = error } - } - } - - fun resolve : Promise(Never, Void) { - sequence { - newResult = - Promise.resolve("resolved") - - next { result = newResult } - } catch { - next { } - } + next { result = newResult } } fun render : Html { @@ -29,35 +14,25 @@ component Test.Promise { <{ result }> - - +
} } component Test.Promise2 { - state resolve : Function(String, Void) = (error : String) { void } - state reject : Function(String, Void) = (error : String) { void } + state resolve : Function(Void) = (error : String) { void } state result : String = "" fun componentDidMount : Promise(Never, Void) { - {resolve, reject, promise} = + {resolve, promise} = Promise.create() - sequence { - next - { - resolve = resolve, - reject = reject - } + next { reject = reject } - newResult = - promise + await newResult = + promise - next { result = newResult } - } catch { - next { result = "rejected" } - } + next { result = newResult } } fun render : Html { @@ -67,7 +42,6 @@ component Test.Promise2 { -
} } @@ -80,14 +54,6 @@ suite "Promise.create" { |> Test.Html.triggerClick("resolve") |> Test.Html.assertTextOf("result", "resolved") } - - test "reject rejects a promise" { - - |> Test.Html.start() - |> Test.Html.assertTextOf("result", "") - |> Test.Html.triggerClick("reject") - |> Test.Html.assertTextOf("result", "rejected") - } } suite "Promise.resolve" { @@ -99,13 +65,3 @@ suite "Promise.resolve" { |> Test.Html.assertTextOf("result", "resolved") } } - -suite "Promise.reject" { - test "rejects a promise" { - - |> Test.Html.start() - |> Test.Html.assertTextOf("result", "") - |> Test.Html.triggerClick("reject") - |> Test.Html.assertTextOf("result", "rejected") - } -} diff --git a/spec/compilers/next_call b/spec/compilers/next_call index efc19a8bb..281910695 100644 --- a/spec/compilers/next_call +++ b/spec/compilers/next_call @@ -2,7 +2,7 @@ component Main { state name : String = "Joe" state age : Number = 24 - fun test : Promise(Never, Void) { + fun test : Promise(Void) { next { name = "Hello", diff --git a/spec/compilers/sequence_using_argument b/spec/compilers/sequence_using_argument index 075809e2b..a623f551e 100644 --- a/spec/compilers/sequence_using_argument +++ b/spec/compilers/sequence_using_argument @@ -1,7 +1,7 @@ component Main { state greeting : String = "ho" - fun test : Promise(Never, Void) { + fun test : Promise(Never, Promise(Void)) { sequence { newGreeting = "hello" next { greeting = newGreeting } diff --git a/spec/formatters/next_call b/spec/formatters/next_call index 792ae3602..ba8e7417e 100644 --- a/spec/formatters/next_call +++ b/spec/formatters/next_call @@ -1,7 +1,7 @@ component Test { state name : String = "Joe" - fun test : Promise(Never, Void) { + fun test : Promise(Void) { next {name = "Hello"} } @@ -13,7 +13,7 @@ component Test { component Test { state name : String = "Joe" - fun test : Promise(Never, Void) { + fun test : Promise(Void) { next { name = "Hello" } } diff --git a/spec/formatters/next_call_multiline b/spec/formatters/next_call_multiline index d6f227782..fbd1b8d27 100644 --- a/spec/formatters/next_call_multiline +++ b/spec/formatters/next_call_multiline @@ -2,7 +2,7 @@ component Test { state name : String = "Joe" state age : Number = 24 - fun test : Promise(Never, Void) { + fun test : Promise(Void) { next {name = "Hello",age=30} } @@ -15,7 +15,7 @@ component Test { state name : String = "Joe" state age : Number = 24 - fun test : Promise(Never, Void) { + fun test : Promise(Void) { next { name = "Hello", diff --git a/spec/type_checking/next_call b/spec/type_checking/next_call index eb159fc7b..2f0726e76 100644 --- a/spec/type_checking/next_call +++ b/spec/type_checking/next_call @@ -2,7 +2,7 @@ component Main { state name : String = "Joe" state age : Number = 24 - fun test : Promise(Never, Void) { + fun test : Promise(Void) { next { name = "Hello", age=30 @@ -15,7 +15,7 @@ component Main { } -------------------------------------------------------NextCallInvalidInvokation module Test { - fun test : Promise(Never, Void) { + fun test : Promise(Void) { next { age = 30 } } } diff --git a/spec/type_checking/store b/spec/type_checking/store index 98f657274..f22333a4b 100644 --- a/spec/type_checking/store +++ b/spec/type_checking/store @@ -1,7 +1,7 @@ store Test { state a : String = "" - fun b : Promise(Never, Void) { + fun b : Promise(Void) { next { a = "Blah" } } } diff --git a/spec/type_checking/store_call_with_next b/spec/type_checking/store_call_with_next index 7d081b2e1..e9b92f56c 100644 --- a/spec/type_checking/store_call_with_next +++ b/spec/type_checking/store_call_with_next @@ -1,5 +1,5 @@ store Test { - fun set : Promise(Never, Void) { + fun set : Promise(Void) { next {} } } diff --git a/src/message.cr b/src/message.cr index c17755a75..25fd8e804 100644 --- a/src/message.cr +++ b/src/message.cr @@ -193,7 +193,9 @@ module Mint end def build - [] of Element + Builder.build do + snippet node + end end def render(renderer) diff --git a/src/type_checkers/next_call.cr b/src/type_checkers/next_call.cr index ce6ea3d4d..30ce033b0 100644 --- a/src/type_checkers/next_call.cr +++ b/src/type_checkers/next_call.cr @@ -53,7 +53,7 @@ module Mint } unless Comparer.compare(state_type, type) end - Type.new("Promise", [NEVER, VOID] of Checkable) + Type.new("Promise", [VOID] of Checkable) end end end From fc1a9a149af911ca325514fe59efdc72ebef0550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Sat, 9 Oct 2021 09:33:10 +0200 Subject: [PATCH 15/20] Make core tests pass. --- core/tests/tests/Dom.mint | 5 +- core/tests/tests/Html/Portals/Body.mint | 4 +- core/tests/tests/Http.mint | 87 ++++++++++--------- core/tests/tests/Promise.mint | 12 +-- core/tests/tests/Provider/AnimationFrame.mint | 2 +- core/tests/tests/Provider/Mouse.mint | 6 +- core/tests/tests/Provider/Scroll.mint | 2 +- core/tests/tests/Provider/Tick.mint | 2 +- core/tests/tests/Timer.mint | 10 +-- core/tests/tests/Window.mint | 4 +- spec/compilers/block_with_await | 2 +- src/ast/block.cr | 4 + src/ast/function.cr | 2 +- src/compilers/function.cr | 13 ++- src/formatters/statement.cr | 21 +++-- src/js.cr | 9 ++ src/type_checkers/block.cr | 4 +- 17 files changed, 103 insertions(+), 86 deletions(-) diff --git a/core/tests/tests/Dom.mint b/core/tests/tests/Dom.mint index 4edb012ee..bed1eeba2 100644 --- a/core/tests/tests/Dom.mint +++ b/core/tests/tests/Dom.mint @@ -112,11 +112,10 @@ component Test.Dom.Focus { fun show : Promise(Void) { await Timer.timeout(100, "") - - next { shown = true } + await next { shown = true } } - fun focus : Promise(String, Void) { + fun focus : Promise(Result(String, Void)) { input |> Maybe.withLazyDefault(() { Dom.createElement("div") }) |> Dom.focusWhenVisible() diff --git a/core/tests/tests/Html/Portals/Body.mint b/core/tests/tests/Html/Portals/Body.mint index 5a1cac988..dfc89b4bc 100644 --- a/core/tests/tests/Html/Portals/Body.mint +++ b/core/tests/tests/Html/Portals/Body.mint @@ -5,7 +5,7 @@ suite "Html.Portals.Body" { |> Test.Html.start() |> Test.Context.then( - (subject : Dom.Element) : Promise(a, Bool) { + (subject : Dom.Element) : Promise(Bool) { Dom.getElementBySelector("body > portal-body") |> Maybe.map((element : Dom.Element) : Bool { true }) |> Maybe.withDefault(false) @@ -21,7 +21,7 @@ suite "Html.Portals.Body" { |> Test.Html.start() |> Test.Context.then( - (subject : Dom.Element) : Promise(a, Bool) { + (subject : Dom.Element) : Promise(Bool) { Dom.getElementBySelector("body > portal-body2") |> Maybe.map((element : Dom.Element) : Bool { true }) |> Maybe.withDefault(false) diff --git a/core/tests/tests/Http.mint b/core/tests/tests/Http.mint index 74b12c97c..47b337608 100644 --- a/core/tests/tests/Http.mint +++ b/core/tests/tests/Http.mint @@ -254,21 +254,20 @@ component Test.Http { state body : String = "" fun wrap ( - method : Function(Promise(a, b), Void), - input : Promise(a, b) - ) : Promise(a, b) { + method : Function(Promise(a), Void), + input : Promise(a) + ) : Promise(a) { `#{method}(#{input})` } - fun componentDidMount : Promise(Never, Void) { - sequence { - response = - Http.empty() - |> Http.url(url) - |> Http.method(method) - |> Http.sendWithId("test") - |> wrap( - ` + fun componentDidMount : Promise(Void) { + await request = + Http.empty() + |> Http.url(url) + |> Http.method(method) + |> Http.sendWithId("test") + |> wrap( + ` (async (promise) => { let _requests = #{Http.requests()} @@ -285,37 +284,39 @@ component Test.Http { }) `) - next { status = response.status } - } catch Http.ErrorResponse => error { - case (error.type) { - Http.Error::NetworkError => - next - { - errorMessage = "network-error", - status = error.status - } - - Http.Error::BadUrl => - next - { - errorMessage = "bad-url", - status = error.status - } - - Http.Error::Timeout => - next - { - errorMessage = "timeout", - status = error.status - } - - Http.Error::Aborted => - next - { - errorMessage = "aborted", - status = error.status - } - } + await case (request) { + Result::Ok(response) => next { status = response.status } + + Result::Err(error) => + case (error.type) { + Http.Error::NetworkError => + next + { + errorMessage = "network-error", + status = error.status + } + + Http.Error::BadUrl => + next + { + errorMessage = "bad-url", + status = error.status + } + + Http.Error::Timeout => + next + { + errorMessage = "timeout", + status = error.status + } + + Http.Error::Aborted => + next + { + errorMessage = "aborted", + status = error.status + } + } } } diff --git a/core/tests/tests/Promise.mint b/core/tests/tests/Promise.mint index 13b8d159d..ef70fa792 100644 --- a/core/tests/tests/Promise.mint +++ b/core/tests/tests/Promise.mint @@ -5,7 +5,7 @@ component Test.Promise { await newResult = Promise.resolve("resolved") - next { result = newResult } + await next { result = newResult } } fun render : Html { @@ -20,19 +20,19 @@ component Test.Promise { } component Test.Promise2 { - state resolve : Function(Void) = (error : String) { void } + state resolve : Function(String, Void) = (result : String) { void } state result : String = "" - fun componentDidMount : Promise(Never, Void) { + fun componentDidMount : Promise(Void) { {resolve, promise} = Promise.create() - next { reject = reject } + await next { resolve = resolve } await newResult = promise - next { result = newResult } + await next { result = newResult } } fun render : Html { @@ -47,7 +47,7 @@ component Test.Promise2 { } suite "Promise.create" { - test "resolve resolves a promise" { + test "resolves a promise" { |> Test.Html.start() |> Test.Html.assertTextOf("result", "") diff --git a/core/tests/tests/Provider/AnimationFrame.mint b/core/tests/tests/Provider/AnimationFrame.mint index 5adc72e41..aa8c6211e 100644 --- a/core/tests/tests/Provider/AnimationFrame.mint +++ b/core/tests/tests/Provider/AnimationFrame.mint @@ -3,7 +3,7 @@ component Test.Provider.AnimationFrame { use Provider.AnimationFrame { frames = - (timestamp : Number) : Promise(Never, Void) { + (timestamp : Number) : Promise(Void) { if (timestamp > 0) { next { frames = frames + 1 } } else { diff --git a/core/tests/tests/Provider/Mouse.mint b/core/tests/tests/Provider/Mouse.mint index 015d6ca76..5f5bc5726 100644 --- a/core/tests/tests/Provider/Mouse.mint +++ b/core/tests/tests/Provider/Mouse.mint @@ -4,9 +4,9 @@ component Test.Provider.Mouse { state ups : Number = 0 use Provider.Mouse { - clicks = (event : Html.Event) : Promise(Never, Void) { next { clicks = clicks + 1 } }, - moves = (event : Html.Event) : Promise(Never, Void) { next { moves = moves + 1 } }, - ups = (event : Html.Event) : Promise(Never, Void) { next { ups = ups + 1 } } + clicks = (event : Html.Event) : Promise(Void) { next { clicks = clicks + 1 } }, + moves = (event : Html.Event) : Promise(Void) { next { moves = moves + 1 } }, + ups = (event : Html.Event) : Promise(Void) { next { ups = ups + 1 } } } fun render : Html { diff --git a/core/tests/tests/Provider/Scroll.mint b/core/tests/tests/Provider/Scroll.mint index 88463bb09..972f5d717 100644 --- a/core/tests/tests/Provider/Scroll.mint +++ b/core/tests/tests/Provider/Scroll.mint @@ -1,5 +1,5 @@ component Test.Provider.Scroll { - use Provider.Scroll { scrolls = (event : Html.Event) : Promise(Never, Void) { next { position = Window.scrollTop() } } } + use Provider.Scroll { scrolls = (event : Html.Event) : Promise(Void) { next { position = Window.scrollTop() } } } state position : Number = 0 diff --git a/core/tests/tests/Provider/Tick.mint b/core/tests/tests/Provider/Tick.mint index 791da0076..4e2569caa 100644 --- a/core/tests/tests/Provider/Tick.mint +++ b/core/tests/tests/Provider/Tick.mint @@ -1,7 +1,7 @@ component Test.Provider.Tick { state counter : Number = 0 - use Provider.Tick { ticks = () : Promise(Never, Void) { next { counter = counter + 1 } } } + use Provider.Tick { ticks = () : Promise(Void) { next { counter = counter + 1 } } } fun render : Html {
diff --git a/core/tests/tests/Timer.mint b/core/tests/tests/Timer.mint index 922da39aa..72aaa93c7 100644 --- a/core/tests/tests/Timer.mint +++ b/core/tests/tests/Timer.mint @@ -3,13 +3,13 @@ suite "Timer.timeout" { Test.Context.of("TEST") |> Test.Context.timeout(1) |> Test.Context.then( - (subject : String) : Promise(a, String) { + (subject : String) : Promise(String) { subject |> String.toLowerCase() |> Promise.resolve() }) |> Test.Context.then( - (subject : String) : Promise(a, Bool) { + (subject : String) : Promise(Bool) { subject == "test" |> Promise.resolve() }) @@ -20,15 +20,15 @@ suite "Timer.nextFrame" { test "resolves after the next frame" { Test.Context.of("TEST") |> Test.Context.then( - (subject : String) : Promise(a, String) { Timer.nextFrame(subject) }) + (subject : String) : Promise(String) { Timer.nextFrame(subject) }) |> Test.Context.then( - (subject : String) : Promise(a, String) { + (subject : String) : Promise(String) { subject |> String.toLowerCase() |> Promise.resolve() }) |> Test.Context.then( - (subject : String) : Promise(a, Bool) { + (subject : String) : Promise(Bool) { subject == "test" |> Promise.resolve() }) diff --git a/core/tests/tests/Window.mint b/core/tests/tests/Window.mint index bdbdf128e..abab578d1 100644 --- a/core/tests/tests/Window.mint +++ b/core/tests/tests/Window.mint @@ -1,5 +1,5 @@ component ScrollTest { - use Provider.Scroll { scrolls = (event : Html.Event) : Promise(Never, Void) { `this.forceUpdate()` } } + use Provider.Scroll { scrolls = (event : Html.Event) : Promise(Void) { `this.forceUpdate()` } } style base { height: 3000px; @@ -88,7 +88,7 @@ suite "Window.scrollWidth" { |> Test.Html.start() |> Test.Context.then( - (subject : Dom.Element) : Promise(Never, Dom.Element) { Timer.nextFrame(subject) }) + (subject : Dom.Element) : Promise(Dom.Element) { Timer.nextFrame(subject) }) |> Test.Html.assertTextOf("scroll-width", "3008") } } diff --git a/spec/compilers/block_with_await b/spec/compilers/block_with_await index 2ed273394..2cc348514 100644 --- a/spec/compilers/block_with_await +++ b/spec/compilers/block_with_await @@ -19,7 +19,7 @@ class A extends _C { return; } - b() { + async b() { return await this.a(); } diff --git a/src/ast/block.cr b/src/ast/block.cr index c4454a0f8..cad115b75 100644 --- a/src/ast/block.cr +++ b/src/ast/block.cr @@ -8,6 +8,10 @@ module Mint @from : Int32, @to : Int32) end + + def async? + statements.select(Ast::Statement).any?(&.await) + end end end end diff --git a/src/ast/function.cr b/src/ast/function.cr index ee6cb9d14..cf1f5f433 100644 --- a/src/ast/function.cr +++ b/src/ast/function.cr @@ -9,8 +9,8 @@ module Mint def initialize(@arguments : Array(Argument), @type : TypeOrVariable?, @comment : Comment?, - @body : Expression, @name : Variable, + @body : Block, @input : Data, @from : Int32, @to : Int32) diff --git a/src/compilers/function.cr b/src/compilers/function.cr index 9a2d470a1..a54c84c07 100644 --- a/src/compilers/function.cr +++ b/src/compilers/function.cr @@ -13,12 +13,7 @@ module Mint js.variable_of(node) expression = - case item = node.body - when Ast::Block - compile item, for_function: true - else - compile item - end + compile node.body, for_function: true arguments = compile node.arguments @@ -31,7 +26,11 @@ module Mint body = js.statements(items) - js.function(name, arguments, body) + if node.body.async? + js.async_function(name, arguments, body) + else + js.function(name, arguments, body) + end end end end diff --git a/src/formatters/statement.cr b/src/formatters/statement.cr index 043548383..7de3db507 100644 --- a/src/formatters/statement.cr +++ b/src/formatters/statement.cr @@ -4,14 +4,21 @@ module Mint expression = format node.expression - case node.target - when Nil - expression - else - target = - format node.target + right = + case node.target + when Nil + expression + else + target = + format node.target + + "#{target} =\n#{indent(expression)}" + end - "#{target} =\n#{indent(expression)}" + if node.await + "await #{right}" + else + right end end end diff --git a/src/js.cr b/src/js.cr index 9dcc3f5a9..bc94f812c 100644 --- a/src/js.cr +++ b/src/js.cr @@ -2,6 +2,7 @@ module Mint abstract class Renderer abstract def object(hash : Hash(String, String)) : String abstract def function(name : String, arguments : Array(String), body : String) : String + abstract def async_function(name : String, arguments : Array(String), body : String) : String abstract def arrow_function(arguments : Array(String), body : String) : String abstract def const(name : String, value : String) : String abstract def class(name : String, extends : String, body : Array(String)) : String @@ -73,6 +74,10 @@ module Mint "#{name}(#{arguments.join(',')}){#{body}}" end + def async_function(name : String, arguments : Array(String), body : String) : String + "async #{name}(#{arguments.join(',')}){#{body}}" + end + def arrow_function(arguments : Array(String), body : String) : String "((#{arguments.join(", ")})=>{#{body}})" end @@ -182,6 +187,10 @@ module Mint "#{name}(#{arguments.join(", ")}) #{class_body(body)}" end + def async_function(name : String, arguments : Array(String), body : String) : String + "async #{name}(#{arguments.join(", ")}) #{class_body(body)}" + end + def arrow_function(arguments : Array(String), body : String) : String "(#{arguments.join(", ")}) => #{class_body(body)}" end diff --git a/src/type_checkers/block.cr b/src/type_checkers/block.cr index 003e89542..6c981e6c3 100644 --- a/src/type_checkers/block.cr +++ b/src/type_checkers/block.cr @@ -15,9 +15,7 @@ module Mint end last = - statements - .sort_by! { |item| resolve_order.index(item) || -1 } - .last + statements.last if async Type.new("Promise", [cache[last]] of Checkable) From aa0982b2ed6abc666a5bf65cc3d27c736457a1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Sat, 9 Oct 2021 09:38:33 +0200 Subject: [PATCH 16/20] Remove parallel language feature. --- spec/compilers/parallel_simple | 54 ------- spec/compilers/parallel_with_catch | 98 ------------ spec/compilers/parallel_with_catch_all | 77 ---------- spec/formatters/parallel | 25 ---- spec/formatters/parallel_with_catch_all | 30 ---- spec/parsers/parallel_spec.cr | 20 --- spec/type_checking/parallel_with_catch | 140 ------------------ src/ast/parallel.cr | 18 --- src/ast/parallel_statement.cr | 14 -- src/ast/statement.cr | 2 - src/compilers/parallel.cr | 139 ----------------- src/formatters/parallel.cr | 31 ---- src/messages/parallel_catch_type_mismatch.cr | 12 -- src/messages/parallel_catched_all.cr | 9 -- src/messages/parallel_catches_nothing.cr | 11 -- src/messages/parallel_did_not_catch.cr | 16 -- .../parallel_expected_closing_bracket.cr | 7 - .../parallel_expected_opening_bracket.cr | 7 - src/messages/parallel_expected_statement.cr | 19 --- .../parallel_statement_expected_equal_sign.cr | 16 -- .../parallel_statement_expected_expression.cr | 15 -- src/parsers/basic_expression.cr | 1 - src/parsers/parallel.cr | 58 -------- src/parsers/parallel_statement.cr | 25 ---- src/type_checkers/parallel.cr | 91 ------------ src/type_checkers/variable.cr | 2 +- 26 files changed, 1 insertion(+), 936 deletions(-) delete mode 100644 spec/compilers/parallel_simple delete mode 100644 spec/compilers/parallel_with_catch delete mode 100644 spec/compilers/parallel_with_catch_all delete mode 100644 spec/formatters/parallel delete mode 100644 spec/formatters/parallel_with_catch_all delete mode 100644 spec/parsers/parallel_spec.cr delete mode 100644 spec/type_checking/parallel_with_catch delete mode 100644 src/ast/parallel.cr delete mode 100644 src/ast/parallel_statement.cr delete mode 100644 src/compilers/parallel.cr delete mode 100644 src/formatters/parallel.cr delete mode 100644 src/messages/parallel_catch_type_mismatch.cr delete mode 100644 src/messages/parallel_catched_all.cr delete mode 100644 src/messages/parallel_catches_nothing.cr delete mode 100644 src/messages/parallel_did_not_catch.cr delete mode 100644 src/messages/parallel_expected_closing_bracket.cr delete mode 100644 src/messages/parallel_expected_opening_bracket.cr delete mode 100644 src/messages/parallel_expected_statement.cr delete mode 100644 src/messages/parallel_statement_expected_equal_sign.cr delete mode 100644 src/messages/parallel_statement_expected_expression.cr delete mode 100644 src/parsers/parallel.cr delete mode 100644 src/parsers/parallel_statement.cr delete mode 100644 src/type_checkers/parallel.cr diff --git a/spec/compilers/parallel_simple b/spec/compilers/parallel_simple deleted file mode 100644 index 7ed417289..000000000 --- a/spec/compilers/parallel_simple +++ /dev/null @@ -1,54 +0,0 @@ -component Main { - fun test : Promise(Never, String) { - parallel { - a = "Hello" - b = "World" - } then { - a + b - } - } - - fun render : String { - test() - - "" - } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let b = null; - let c = null; - - await Promise.all([ - (async () => { - b = await `Hello` - })(), - (async () => { - c = await `World` - })() - ]); - - _ = b + c; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in parallel expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return ``; - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/parallel_with_catch b/spec/compilers/parallel_with_catch deleted file mode 100644 index 0e6f776cc..000000000 --- a/spec/compilers/parallel_with_catch +++ /dev/null @@ -1,98 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, String) { - parallel { - greeting = - Promise.reject("x") - - b = - Promise.reject("y") - - a = - Promise.reject(0) - } then { - "blah" - } catch String => a { - "hello" - } catch Number => a { - "asd" - } - } - - fun render : String { - test() - - "" - } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - b(h) { - return; - } -}); - -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let d = null; - let e = null; - let g = null; - - await Promise.all([ - (async () => { - try { - d = await B.b(`x`) - } catch (_error) { - let c = _error; - _ = `hello`; - throw new DoError(); - } - })(), - (async () => { - try { - e = await B.b(`y`) - } catch (_error) { - let c = _error; - _ = `hello`; - throw new DoError(); - } - })(), - (async () => { - try { - g = await B.b(0) - } catch (_error) { - let f = _error; - _ = `asd`; - throw new DoError(); - } - })() - ]); - - _ = `blah`; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in parallel expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return ``; - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/parallel_with_catch_all b/spec/compilers/parallel_with_catch_all deleted file mode 100644 index a1c8987a2..000000000 --- a/spec/compilers/parallel_with_catch_all +++ /dev/null @@ -1,77 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, String) { - parallel { - greeting = - Promise.reject("x") - - a = - "Hello" - - b = - "World" - } then { - a + b - } catch { - "Hmm..." - } - } - - fun render : String { - test() - - "" - } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - b(f) { - return; - } -}); - -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let c = null; - let d = null; - let e = null; - - await Promise.all([ - (async () => { - c = await B.b(`x`) - })(), - (async () => { - d = await `Hello` - })(), - (async () => { - e = await `World` - })() - ]); - - _ = d + e; - } catch (_error) { - if (!(_error instanceof DoError)) { - return `Hmm...` - } - }; - - return _; - })(); - } - - render() { - this.a(); - return ``; - } -}; - -A.displayName = "Main"; diff --git a/spec/formatters/parallel b/spec/formatters/parallel deleted file mode 100644 index 2b794e6e6..000000000 --- a/spec/formatters/parallel +++ /dev/null @@ -1,25 +0,0 @@ -module X { - fun x : Promise(Never, String) { - parallel {/* Head Comment */a="Hello"b="World"/* Tail Comment */}then{/* Head Comment */a + b/* Tail Comment */} - } -} --------------------------------------------------------------------------------- -module X { - fun x : Promise(Never, String) { - parallel { - /* Head Comment */ - a = - "Hello" - - b = - "World" - - /* Tail Comment */ - } then { - /* Head Comment */ - a + b - - /* Tail Comment */ - } - } -} diff --git a/spec/formatters/parallel_with_catch_all b/spec/formatters/parallel_with_catch_all deleted file mode 100644 index fd7a71200..000000000 --- a/spec/formatters/parallel_with_catch_all +++ /dev/null @@ -1,30 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -module A { - fun test : Promise(Never, String) { - parallel {a=Promise.reject("hello")}then{""}catch{"blah"} - } -} --------------------------------------------------------------------------------- -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -module A { - fun test : Promise(Never, String) { - parallel { - a = - Promise.reject("hello") - } then { - "" - } catch { - "blah" - } - } -} diff --git a/spec/parsers/parallel_spec.cr b/spec/parsers/parallel_spec.cr deleted file mode 100644 index 0d63d8593..000000000 --- a/spec/parsers/parallel_spec.cr +++ /dev/null @@ -1,20 +0,0 @@ -require "../spec_helper" - -describe "Do Expression" do - subject parallel - - expect_ignore "a" - expect_ignore "." - expect_ignore "d" - - expect_error "parallel ", Mint::Parser::ParallelExpectedOpeningBracket - expect_error "parallel ,", Mint::Parser::ParallelExpectedOpeningBracket - expect_error "parallel a", Mint::Parser::ParallelExpectedOpeningBracket - expect_error "parallel {", Mint::Parser::ParallelExpectedStatement - expect_error "parallel { }", Mint::Parser::ParallelExpectedStatement - expect_error "parallel { a = b", Mint::Parser::ParallelExpectedClosingBracket - - expect_ok "parallel { a = b }" - expect_ok "parallel { a = x } then { y }" - expect_ok "parallel { a = x b = x } then { y }" -end diff --git a/spec/type_checking/parallel_with_catch b/spec/type_checking/parallel_with_catch deleted file mode 100644 index a6c171ec6..000000000 --- a/spec/type_checking/parallel_with_catch +++ /dev/null @@ -1,140 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, String) { - parallel { - greeting = - Promise.reject("hello") - - blah = - Promise.reject(0) - } then { - "true" - } catch String => a { - "hello" - } catch Number => a { - "hello" - } - } - - fun render : Html { -
- } -} --------------------------------------------------------------ParallelDidNotCatch -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Bool) { - parallel { - greeting = - Promise.reject("hello") - - blah = - Promise.reject(0) - } then { - true - } - } - - fun render : Html { -
- } -} -----------------------------------------------------------ParallelCatchesNothing -component Main { - fun test : Promise(Never, Bool) { - parallel { - true - } then { - true - } catch String => error { - false - } - } - - fun render : Html { -
- } -} --------------------------------------------------------ParallelCatchTypeMismatch -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Bool) { - parallel { - blah = - Promise.reject(0) - } then { - true - } catch Number => error { - "" - } - } - - fun render : Html { -
- } -} - --------------------------------------------------------ParallelCatchTypeMismatch -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Bool) { - parallel { - blah = - Promise.reject(0) - } then { - true - } catch { - "" - } - } - - fun render : Html { -
- } -} ---------------------------------------------------------------ParallelCatchedAll -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Bool) { - parallel { - blah = - Promise.reject(0) - - } then { - true - } catch Number => error { - false - } catch { - false - } - } - - fun render : Html { -
- } -} diff --git a/src/ast/parallel.cr b/src/ast/parallel.cr deleted file mode 100644 index ce575d9b3..000000000 --- a/src/ast/parallel.cr +++ /dev/null @@ -1,18 +0,0 @@ -module Mint - class Ast - class Parallel < Node - getter statements, catches, then_branch, finally, comments, catch_all - - def initialize(@statements : Array(Statement), - @comments : Array(Comment), - @then_branch : Then?, - @finally : Finally?, - @catches : Array(Catch), - @catch_all : CatchAll?, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/ast/parallel_statement.cr b/src/ast/parallel_statement.cr deleted file mode 100644 index 6c73b8bdb..000000000 --- a/src/ast/parallel_statement.cr +++ /dev/null @@ -1,14 +0,0 @@ -module Mint - class Ast - class ParallelStatement < Node - getter name, expression - - def initialize(@expression : Expression, - @name : Variable, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/ast/statement.cr b/src/ast/statement.cr index 0e8b64421..25fd50a22 100644 --- a/src/ast/statement.cr +++ b/src/ast/statement.cr @@ -2,9 +2,7 @@ module Mint class Ast class Statement < Node enum Parent - Try Sequence - Parallel None end diff --git a/src/compilers/parallel.cr b/src/compilers/parallel.cr deleted file mode 100644 index 14fec2a12..000000000 --- a/src/compilers/parallel.cr +++ /dev/null @@ -1,139 +0,0 @@ -module Mint - class Compiler - protected def prefix(_node : Ast::Parallel, statement : Ast::Statement, value : String) - case target = statement.target - when Ast::Variable - js.assign(js.variable_of(target), value) - when Ast::TupleDestructuring - variables = - target - .parameters - .join(',') { |param| js.variable_of(param) } - - "[#{variables}] = #{value}" - else - value - end - end - - def _compile(node : Ast::Parallel) : String - _compile(node) { |statement| compile(statement) } - end - - def _compile(node : Ast::Parallel, & : Ast::Statement, Int32, Bool -> String) : String - statements = node.statements - statements_size = statements.size - - body = statements.map_with_index do |statement, index| - is_last = - (index + 1) == statements_size - - expression = - yield statement, index, is_last - - # Get the time of the statement - type = types[statement]? - - catches = - case type - when TypeChecker::Type - if type.name.in?("Promise", "Result") && (type_param = type.parameters.first?) - node - .catches - .select(&.type.==(type_param.name)) - .map { |item| compile(item).as(String) } - end - end || %w[] - - case type - when TypeChecker::Type - case type.name - when "Result" - if catches.empty? - js.asynciif do - js.statements([ - js.let("_", expression), - js.if("_ instanceof Err") do - "throw _._0" - end, - prefix(node, statement, "_._0"), - ]) - end - else - js.asynciif do - js.statements([ - js.let("_", expression), - js.if("_ instanceof Err") do - js.statements([ - js.let("_error", "_._0"), - ] + catches) - end, - prefix(node, statement, "_._0"), - ]) - end - end - when "Promise" - if catches && !catches.empty? - js.asynciif do - js.try(prefix(node, statement, "await #{expression}"), - [js.catch("_error", js.statements(catches))], - "") - end - end - end - end || js.asynciif do - prefix(node, statement, "await #{expression}") - end - end - - catch_all = - node.catch_all.try do |catch| - "return #{compile catch.expression}" - end || - js.statements([ - "console.warn(`Unhandled error in parallel expression:`)", - "console.warn(_error)", - ]) - - finally = - if node_finally = node.finally - compile node_finally - end - - then_block = - if then_branch = node.then_branch - js.assign("_", compile(then_branch.expression)) - end - - names = - statements.compact_map do |statement| - case target = statement.target - when Ast::Variable - js.let(js.variable_of(target), "null") - when Ast::TupleDestructuring - target.parameters.map do |variable| - js.let(js.variable_of(variable), "null") - end - end - end.flatten - - js.asynciif do - js.statements([ - js.let("_", "null"), - js.try( - js.statements(names + [ - js.call("await Promise.all", [js.array(body)]), - then_block, - ].compact), - [ - js.catch("_error") do - js.if("!(_error instanceof DoError)", catch_all) - end, - ], - finally || ""), - js.return("_"), - ]) - end - end - end -end diff --git a/src/formatters/parallel.cr b/src/formatters/parallel.cr deleted file mode 100644 index 1443aaba6..000000000 --- a/src/formatters/parallel.cr +++ /dev/null @@ -1,31 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::Parallel) : String - items = - node.statements + node.comments - - body = - list items - - catches = - format node.catches - - then_branch = - format node.then_branch - - finally = - format node.finally - - node.catch_all.try do |catch| - catches.push format(catch) - end - - ["parallel {\n#{indent(body)}\n}", - then_branch.to_s, - catches.join(' '), - finally.to_s, - ].reject!(&.blank?) - .join(' ') - end - end -end diff --git a/src/messages/parallel_catch_type_mismatch.cr b/src/messages/parallel_catch_type_mismatch.cr deleted file mode 100644 index adde38abb..000000000 --- a/src/messages/parallel_catch_type_mismatch.cr +++ /dev/null @@ -1,12 +0,0 @@ -message ParallelCatchTypeMismatch do - title "Type Error" - - block do - text "The return type of a catch does not match the return type" - text "of the last statement in a parallel expression." - end - - was_expecting_type expected, got - - snippet node -end diff --git a/src/messages/parallel_catched_all.cr b/src/messages/parallel_catched_all.cr deleted file mode 100644 index e7d03b8bb..000000000 --- a/src/messages/parallel_catched_all.cr +++ /dev/null @@ -1,9 +0,0 @@ -message ParallelCatchedAll do - title "Type Error" - - block do - text "All possible errors have been catched." - end - - snippet node, "There is a general catch which now can be safely removed:" -end diff --git a/src/messages/parallel_catches_nothing.cr b/src/messages/parallel_catches_nothing.cr deleted file mode 100644 index 500e31b42..000000000 --- a/src/messages/parallel_catches_nothing.cr +++ /dev/null @@ -1,11 +0,0 @@ -message ParallelCatchesNothing do - title "Type Error" - - block do - text "There are no statements that can result (as an error) in this type:" - end - - type got - - snippet node, "There is a catch for this type, which now can be removed:" -end diff --git a/src/messages/parallel_did_not_catch.cr b/src/messages/parallel_did_not_catch.cr deleted file mode 100644 index 8fcd495a5..000000000 --- a/src/messages/parallel_did_not_catch.cr +++ /dev/null @@ -1,16 +0,0 @@ -message ParallelDidNotCatch do - title "Type Error" - - block do - text "I am checking if all the possible errors are handled in" - bold "a parallel expression." - end - - block do - text "I found that these types are not handled:" - end - - type_list remaining - - snippet node -end diff --git a/src/messages/parallel_expected_closing_bracket.cr b/src/messages/parallel_expected_closing_bracket.cr deleted file mode 100644 index d001c9e15..000000000 --- a/src/messages/parallel_expected_closing_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message ParallelExpectedClosingBracket do - title "Syntax Error" - - closing_bracket "parallel expression", got - - snippet node -end diff --git a/src/messages/parallel_expected_opening_bracket.cr b/src/messages/parallel_expected_opening_bracket.cr deleted file mode 100644 index 881e121a8..000000000 --- a/src/messages/parallel_expected_opening_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message ParallelExpectedOpeningBracket do - title "Syntax Error" - - opening_bracket "parallel expression", got - - snippet node -end diff --git a/src/messages/parallel_expected_statement.cr b/src/messages/parallel_expected_statement.cr deleted file mode 100644 index d7ac40f04..000000000 --- a/src/messages/parallel_expected_statement.cr +++ /dev/null @@ -1,19 +0,0 @@ -message ParallelExpectedStatement do - title "Syntax Error" - - block do - text "A" - bold "parallel expression" - text "must have at least one statement." - end - - block do - text "I was looking for a" - bold "statement" - text "but found" - code got - text "instead." - end - - snippet node -end diff --git a/src/messages/parallel_statement_expected_equal_sign.cr b/src/messages/parallel_statement_expected_equal_sign.cr deleted file mode 100644 index c2df1d2a0..000000000 --- a/src/messages/parallel_statement_expected_equal_sign.cr +++ /dev/null @@ -1,16 +0,0 @@ -message ParallelStatementExpectedEqualSign do - title "Syntax Error" - - block do - text "The" - bold "name" - text "of a statement and its" - bold "expression" - text "must be separated by an" - bold "equal sign" - end - - was_looking_for "equal sign", got, "=" - - snippet node -end diff --git a/src/messages/parallel_statement_expected_expression.cr b/src/messages/parallel_statement_expected_expression.cr deleted file mode 100644 index 9ffc35c43..000000000 --- a/src/messages/parallel_statement_expected_expression.cr +++ /dev/null @@ -1,15 +0,0 @@ -message ParallelStatementExpectedExpression do - title "Syntax Error" - - block do - text "A" - bold "statement" - text "in a" - bold "parallel expression" - text "must have an expression." - end - - was_looking_for "expression", got - - snippet node -end diff --git a/src/parsers/basic_expression.cr b/src/parsers/basic_expression.cr index de2939f36..53a01651e 100644 --- a/src/parsers/basic_expression.cr +++ b/src/parsers/basic_expression.cr @@ -29,7 +29,6 @@ module Mint for_expression || next_call || sequence || - parallel || case_expression || parenthesized_expression_or_inline_function || starts_with_uppercase || diff --git a/src/parsers/parallel.cr b/src/parsers/parallel.cr deleted file mode 100644 index cd4d2c1a7..000000000 --- a/src/parsers/parallel.cr +++ /dev/null @@ -1,58 +0,0 @@ -module Mint - class Parser - syntax_error ParallelExpectedOpeningBracket - syntax_error ParallelExpectedClosingBracket - syntax_error ParallelExpectedStatement - - def parallel : Ast::Parallel? - start do |start_position| - next unless keyword "parallel" - next unless whitespace? - whitespace - - body = block( - opening_bracket: ParallelExpectedOpeningBracket, - closing_bracket: ParallelExpectedClosingBracket - ) do - results = many { statement(:parallel) || comment } - - raise ParallelExpectedStatement if results.none?(Ast::Statement) - - results - end - - whitespace - then_branch = then_block - - whitespace - catches = many { catch } - - whitespace - catch_all = self.catch_all - - statements = [] of Ast::Statement - comments = [] of Ast::Comment - - body.each do |item| - case item - when Ast::Statement - statements << item - when Ast::Comment - comments << item - end - end - - self << Ast::Parallel.new( - then_branch: then_branch, - statements: statements, - catch_all: catch_all, - from: start_position, - comments: comments, - finally: finally, - catches: catches, - to: position, - input: data) - end - end - end -end diff --git a/src/parsers/parallel_statement.cr b/src/parsers/parallel_statement.cr deleted file mode 100644 index 25e589db6..000000000 --- a/src/parsers/parallel_statement.cr +++ /dev/null @@ -1,25 +0,0 @@ -module Mint - class Parser - syntax_error ParallelStatementExpectedExpression - syntax_error ParallelStatementExpectedEqualSign - - def parallel_statement : Ast::ParallelStatement? - start do |start_position| - next unless name = variable - - whitespace - keyword! "=", ParallelStatementExpectedEqualSign - whitespace - - body = expression! ParallelStatementExpectedExpression - - self << Ast::ParallelStatement.new( - expression: body, - from: start_position, - to: position, - input: data, - name: name) - end - end - end -end diff --git a/src/type_checkers/parallel.cr b/src/type_checkers/parallel.cr deleted file mode 100644 index ebcb72548..000000000 --- a/src/type_checkers/parallel.cr +++ /dev/null @@ -1,91 +0,0 @@ -module Mint - class TypeChecker - type_error ParallelCatchTypeMismatch - type_error ParallelCatchesNothing - type_error ParallelDidNotCatch - type_error ParallelCatchedAll - - def check(node : Ast::Parallel) : Checkable - to_catch = [] of Checkable - - node.statements.map do |statement| - new_type = resolve statement - - if new_type.name.in?("Promise", "Result") && new_type.parameters.size == 2 - unless new_type.parameters[0].name.in?("Void", "Never") - to_catch << new_type.parameters[0] - end - end - end - - final_type = - scope node.statements do - node.then_branch.try do |branch| - resolve branch.expression - end - end - - node.catches.each do |catch| - catch_type = resolve_type(Type.new(catch.type)) - - raise ParallelCatchesNothing, { - "got" => catch_type, - "node" => catch, - } if to_catch.none? { |item| Comparer.compare(catch_type, item) } - - check_variable catch.variable - - scope({catch.variable.value, catch_type, catch}) do - catch_return_type = resolve catch - - if final_type - raise ParallelCatchTypeMismatch, { - "expected" => final_type, - "got" => catch_return_type, - "node" => catch.expression, - } unless Comparer.compare(final_type, catch_return_type) - end - end - - to_catch.reject! { |item| Comparer.compare(catch_type, item) } - end - - if node_finally = node.finally - resolve node_finally - end - - catch_all_type = - node.catch_all.try do |catch| - raise ParallelCatchedAll, { - "node" => catch, - } if to_catch.empty? - - type = resolve catch.expression - - if final_type - raise ParallelCatchTypeMismatch, { - "expected" => final_type, - "node" => catch, - "got" => type, - } unless Comparer.compare(type, final_type) - end - - type - end - - raise ParallelDidNotCatch, { - "remaining" => to_catch, - "node" => node, - } if !to_catch.empty? && catch_all_type.nil? - - promise_type = - Type.new("Promise", [NEVER, Variable.new("a")] of Checkable) - - if final_type && Comparer.compare(promise_type, final_type) - final_type - else - Type.new("Promise", [NEVER, final_type || VOID] of Checkable) - end - end - end -end diff --git a/src/type_checkers/variable.cr b/src/type_checkers/variable.cr index deba61012..b46f96a63 100644 --- a/src/type_checkers/variable.cr +++ b/src/type_checkers/variable.cr @@ -7,7 +7,7 @@ module Mint %w(break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof new return super switch this throw try typeof var void while with yield state - sequence parallel) + sequence) def check(node : Ast::Variable) : Checkable raise VariableReserved, { From b4f0dd2ef9ba80ac435307aaea60978a87653113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Sat, 9 Oct 2021 09:48:18 +0200 Subject: [PATCH 17/20] Remove sequence, catch, finally and then laguage constructs. --- spec/compilers/catch | 66 -------- spec/compilers/finally | 43 ----- spec/compilers/sequence_simple | 39 ----- spec/compilers/sequence_using_argument | 60 ------- spec/compilers/sequence_with_argument | 41 ----- spec/compilers/sequence_with_catch | 94 ----------- spec/compilers/sequence_with_finally | 43 ----- spec/compilers/sequence_with_result_and_catch | 67 -------- .../sequence_with_result_and_catch_all | 62 -------- .../sequence_with_statement_reordering | 45 ------ spec/formatters/catch | 37 ----- spec/formatters/finally | 22 --- spec/formatters/sequence | 14 -- spec/formatters/sequence_with_catch | 30 ---- spec/formatters/sequence_with_catch_all | 30 ---- spec/formatters/sequence_with_comments | 21 --- spec/formatters/sequence_with_finally | 16 -- spec/parsers/catch_spec.cr | 23 --- spec/parsers/finally_spec.cr | 20 --- spec/parsers/sequence_spec.cr | 24 --- spec/recursion_spec.cr | 6 +- spec/type_checking/finally | 31 ---- spec/type_checking/sequence | 32 ---- spec/type_checking/sequence_with_catch | 149 ------------------ src/ast.cr | 1 - src/ast/catch.cr | 15 -- src/ast/catch_all.cr | 13 -- src/ast/finally.cr | 13 -- src/ast/sequence.cr | 17 -- src/ast/statement.cr | 1 - src/ast/then.cr | 13 -- src/compilers/catch.cr | 17 -- src/compilers/finally.cr | 10 -- src/compilers/sequence.cr | 131 --------------- src/compilers/test.cr | 22 --- src/formatters/catch.cr | 16 -- src/formatters/catch_all.cr | 10 -- src/formatters/finally.cr | 10 -- src/formatters/sequence.cr | 27 ---- src/formatters/then.cr | 10 -- src/messages/catch_expected_arrow.cr | 14 -- .../catch_expected_closing_bracket.cr | 7 - src/messages/catch_expected_expression.cr | 12 -- .../catch_expected_opening_bracket.cr | 7 - src/messages/catch_expected_variable.cr | 14 -- .../finally_expected_closing_bracket.cr | 7 - src/messages/finally_expected_expression.cr | 15 -- .../finally_expected_opening_bracket.cr | 7 - src/messages/sequence_catch_type_mismatch.cr | 12 -- src/messages/sequence_catched_all.cr | 9 -- src/messages/sequence_catches_nothing.cr | 11 -- src/messages/sequence_did_not_catch.cr | 16 -- .../sequence_expected_closing_bracket.cr | 7 - .../sequence_expected_opening_bracket.cr | 7 - src/messages/sequence_expected_statement.cr | 20 --- src/messages/then_expected_closing_bracket.cr | 7 - src/messages/then_expected_expression.cr | 15 -- src/messages/then_expected_opening_bracket.cr | 7 - src/parsers/basic_expression.cr | 1 - src/parsers/catch.cr | 39 ----- src/parsers/catch_all.cr | 22 --- src/parsers/finally.cr | 27 ---- src/parsers/sequence.cr | 54 ------- src/parsers/then.cr | 27 ---- src/type_checkers/catch.cr | 7 - src/type_checkers/finally.cr | 7 - src/type_checkers/sequence.cr | 82 ---------- src/type_checkers/variable.cr | 7 +- 68 files changed, 5 insertions(+), 1803 deletions(-) delete mode 100644 spec/compilers/catch delete mode 100644 spec/compilers/finally delete mode 100644 spec/compilers/sequence_simple delete mode 100644 spec/compilers/sequence_using_argument delete mode 100644 spec/compilers/sequence_with_argument delete mode 100644 spec/compilers/sequence_with_catch delete mode 100644 spec/compilers/sequence_with_finally delete mode 100644 spec/compilers/sequence_with_result_and_catch delete mode 100644 spec/compilers/sequence_with_result_and_catch_all delete mode 100644 spec/compilers/sequence_with_statement_reordering delete mode 100644 spec/formatters/catch delete mode 100644 spec/formatters/finally delete mode 100644 spec/formatters/sequence delete mode 100644 spec/formatters/sequence_with_catch delete mode 100644 spec/formatters/sequence_with_catch_all delete mode 100644 spec/formatters/sequence_with_comments delete mode 100644 spec/formatters/sequence_with_finally delete mode 100644 spec/parsers/catch_spec.cr delete mode 100644 spec/parsers/finally_spec.cr delete mode 100644 spec/parsers/sequence_spec.cr delete mode 100644 spec/type_checking/finally delete mode 100644 spec/type_checking/sequence delete mode 100644 spec/type_checking/sequence_with_catch delete mode 100644 src/ast/catch.cr delete mode 100644 src/ast/catch_all.cr delete mode 100644 src/ast/finally.cr delete mode 100644 src/ast/sequence.cr delete mode 100644 src/ast/then.cr delete mode 100644 src/compilers/catch.cr delete mode 100644 src/compilers/finally.cr delete mode 100644 src/compilers/sequence.cr delete mode 100644 src/formatters/catch.cr delete mode 100644 src/formatters/catch_all.cr delete mode 100644 src/formatters/finally.cr delete mode 100644 src/formatters/sequence.cr delete mode 100644 src/formatters/then.cr delete mode 100644 src/messages/catch_expected_arrow.cr delete mode 100644 src/messages/catch_expected_closing_bracket.cr delete mode 100644 src/messages/catch_expected_expression.cr delete mode 100644 src/messages/catch_expected_opening_bracket.cr delete mode 100644 src/messages/catch_expected_variable.cr delete mode 100644 src/messages/finally_expected_closing_bracket.cr delete mode 100644 src/messages/finally_expected_expression.cr delete mode 100644 src/messages/finally_expected_opening_bracket.cr delete mode 100644 src/messages/sequence_catch_type_mismatch.cr delete mode 100644 src/messages/sequence_catched_all.cr delete mode 100644 src/messages/sequence_catches_nothing.cr delete mode 100644 src/messages/sequence_did_not_catch.cr delete mode 100644 src/messages/sequence_expected_closing_bracket.cr delete mode 100644 src/messages/sequence_expected_opening_bracket.cr delete mode 100644 src/messages/sequence_expected_statement.cr delete mode 100644 src/messages/then_expected_closing_bracket.cr delete mode 100644 src/messages/then_expected_expression.cr delete mode 100644 src/messages/then_expected_opening_bracket.cr delete mode 100644 src/parsers/catch.cr delete mode 100644 src/parsers/catch_all.cr delete mode 100644 src/parsers/finally.cr delete mode 100644 src/parsers/sequence.cr delete mode 100644 src/parsers/then.cr delete mode 100644 src/type_checkers/catch.cr delete mode 100644 src/type_checkers/finally.cr delete mode 100644 src/type_checkers/sequence.cr diff --git a/spec/compilers/catch b/spec/compilers/catch deleted file mode 100644 index f6d61fc1b..000000000 --- a/spec/compilers/catch +++ /dev/null @@ -1,66 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Void) { - sequence { - greeting = - Promise.reject("hello") - - void - } catch String => a { - void - } - } - - fun render : String { - test() - - "" - } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - b(e) { - return; - } -}); - -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let d = await (async () => { - try { - return await B.b(`hello`) - } catch (_error) { - let c = _error; - _ = null; - throw new DoError(); - } - })(); - - _ = await null; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return ``; - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/finally b/spec/compilers/finally deleted file mode 100644 index e6d7e0094..000000000 --- a/spec/compilers/finally +++ /dev/null @@ -1,43 +0,0 @@ -component Main { - fun test : Promise(Never, Void) { - sequence { - void - } finally { - void - } - } - - fun render : String { - test() - - "" - } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - _ = await null; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - } finally { - null - }; - - return _; - })(); - } - - render() { - this.a(); - return ``; - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/sequence_simple b/spec/compilers/sequence_simple deleted file mode 100644 index b395fd294..000000000 --- a/spec/compilers/sequence_simple +++ /dev/null @@ -1,39 +0,0 @@ -component Main { - fun test : Promise(Never, Void) { - sequence { - void - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - _ = await null; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return _h("div", {}); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/sequence_using_argument b/spec/compilers/sequence_using_argument deleted file mode 100644 index a623f551e..000000000 --- a/spec/compilers/sequence_using_argument +++ /dev/null @@ -1,60 +0,0 @@ -component Main { - state greeting : String = "ho" - - fun test : Promise(Never, Promise(Void)) { - sequence { - newGreeting = "hello" - next { greeting = newGreeting } - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------------------------- -class A extends _C { - constructor(props) { - super(props); - - this.state = new Record({ - c: `ho` - }); - } - - get c() { - return this.state.c; - } - - a() { - return (async () => { - let _ = null; - - try { - let b = await `hello`; - - _ = await new Promise((_resolve) => { - this.setState(_u(this.state, new Record({ - c: b - })), _resolve) - }); - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return _h("div", {}); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/sequence_with_argument b/spec/compilers/sequence_with_argument deleted file mode 100644 index 87a5ef06c..000000000 --- a/spec/compilers/sequence_with_argument +++ /dev/null @@ -1,41 +0,0 @@ -component Main { - fun test : Promise(Never, Void) { - sequence { - greeting = "hello" - void - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let b = await `hello`; - _ = await null; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return _h("div", {}); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/sequence_with_catch b/spec/compilers/sequence_with_catch deleted file mode 100644 index 5ee6ac366..000000000 --- a/spec/compilers/sequence_with_catch +++ /dev/null @@ -1,94 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, String) { - sequence { - greeting = - Promise.reject("x") - - b = - Promise.reject("y") - - a = - Promise.reject(0) - - "blah" - } catch String => a { - a - } catch Number => a { - "asd" - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - b(h) { - return; - } -}); - -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let d = await (async () => { - try { - return await B.b(`x`) - } catch (_error) { - let c = _error; - _ = c; - throw new DoError(); - } - })(); - - let e = await (async () => { - try { - return await B.b(`y`) - } catch (_error) { - let c = _error; - _ = c; - throw new DoError(); - } - })(); - - let g = await (async () => { - try { - return await B.b(0) - } catch (_error) { - let f = _error; - _ = `asd`; - throw new DoError(); - } - })(); - - _ = await `blah`; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return _h("div", {}); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/sequence_with_finally b/spec/compilers/sequence_with_finally deleted file mode 100644 index 4e8f73a79..000000000 --- a/spec/compilers/sequence_with_finally +++ /dev/null @@ -1,43 +0,0 @@ -component Main { - fun test : Promise(Never, Void) { - sequence { - void - } finally { - void - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - _ = await null; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - } finally { - null - }; - - return _; - })(); - } - - render() { - this.a(); - return _h("div", {}); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/sequence_with_result_and_catch b/spec/compilers/sequence_with_result_and_catch deleted file mode 100644 index 78dac198a..000000000 --- a/spec/compilers/sequence_with_result_and_catch +++ /dev/null @@ -1,67 +0,0 @@ -module Result { - fun error (input : a) : Result(a, b) { - `new Err(arguments[0])` - } -} - -component Main { - fun test : Promise(Never, String) { - sequence { - Result.error("") - - "test" - } catch String => error { - "test" - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - b(d) { - return (new Err(arguments[0])); - } -}); - -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let _0 = B.b(``); - - if (_0 instanceof Err) { - let _error = _0._0; - - let c = _error; - _ = `test`; - throw new DoError(); - }; - - _0._0; - - _ = await `test`; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return _h("div", {}); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/sequence_with_result_and_catch_all b/spec/compilers/sequence_with_result_and_catch_all deleted file mode 100644 index 508aad5e8..000000000 --- a/spec/compilers/sequence_with_result_and_catch_all +++ /dev/null @@ -1,62 +0,0 @@ -module Result { - fun error (input : a) : Result(a, b) { - `new Err(#{input})` - } -} - -component Main { - fun test : Promise(Never, String) { - sequence { - Result.error("") - - "test" - } catch { - "test" - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------------------------- -const B = new(class extends _M { - b(c) { - return (new Err(c)); - } -}); - -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let _0 = B.b(``); - - if (_0 instanceof Err) { - throw _0._0 - }; - - _0._0; - - _ = await `test`; - } catch (_error) { - if (!(_error instanceof DoError)) { - _ = `test` - } - }; - - return _; - })(); - } - - render() { - this.a(); - return _h("div", {}); - } -}; - -A.displayName = "Main"; diff --git a/spec/compilers/sequence_with_statement_reordering b/spec/compilers/sequence_with_statement_reordering deleted file mode 100644 index 4702c2df3..000000000 --- a/spec/compilers/sequence_with_statement_reordering +++ /dev/null @@ -1,45 +0,0 @@ -component Main { - fun test : Promise(Never, String) { - sequence { - b = a - - a = "hello" - - b - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------------------------- -class A extends _C { - a() { - return (async () => { - let _ = null; - - try { - let b = await `hello`; - let c = await b; - _ = await c; - } catch (_error) { - if (!(_error instanceof DoError)) { - console.warn(`Unhandled error in sequence expression:`); - console.warn(_error); - } - }; - - return _; - })(); - } - - render() { - this.a(); - return _h("div", {}); - } -}; - -A.displayName = "Main"; diff --git a/spec/formatters/catch b/spec/formatters/catch deleted file mode 100644 index 748a25354..000000000 --- a/spec/formatters/catch +++ /dev/null @@ -1,37 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -module A { - fun test : Promise(Never, String) { - sequence { - a = - Promise.reject("hello") - "" - }catchString=>a{/*HEAD*/"blah"/*TAIL*/} - } -} --------------------------------------------------------------------------------- -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -module A { - fun test : Promise(Never, String) { - sequence { - a = - Promise.reject("hello") - - "" - } catch String => a { - /* HEAD */ - "blah" - - /* TAIL */ - } - } -} diff --git a/spec/formatters/finally b/spec/formatters/finally deleted file mode 100644 index 5beea7626..000000000 --- a/spec/formatters/finally +++ /dev/null @@ -1,22 +0,0 @@ -module A { - fun test : Promise(Never, String) { - sequence { - a = - "hello" - }finally{/* HEAD */"blah"/* TAIL */} - } -} --------------------------------------------------------------------------------- -module A { - fun test : Promise(Never, String) { - sequence { - a = - "hello" - } finally { - /* HEAD */ - "blah" - - /* TAIL */ - } - } -} diff --git a/spec/formatters/sequence b/spec/formatters/sequence deleted file mode 100644 index 18b93cd43..000000000 --- a/spec/formatters/sequence +++ /dev/null @@ -1,14 +0,0 @@ -module A { - fun test : Promise(Never, String) { - sequence {a="hello"} - } -} --------------------------------------------------------------------------------- -module A { - fun test : Promise(Never, String) { - sequence { - a = - "hello" - } - } -} diff --git a/spec/formatters/sequence_with_catch b/spec/formatters/sequence_with_catch deleted file mode 100644 index 109ef3bf4..000000000 --- a/spec/formatters/sequence_with_catch +++ /dev/null @@ -1,30 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -module A { - fun test : Promise(Never, String) { - sequence {a=Promise.reject("hello") ""}catchString=>a{"blah"} - } -} --------------------------------------------------------------------------------- -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -module A { - fun test : Promise(Never, String) { - sequence { - a = - Promise.reject("hello") - - "" - } catch String => a { - "blah" - } - } -} diff --git a/spec/formatters/sequence_with_catch_all b/spec/formatters/sequence_with_catch_all deleted file mode 100644 index 2222a3c6e..000000000 --- a/spec/formatters/sequence_with_catch_all +++ /dev/null @@ -1,30 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -module A { - fun test : Promise(Never, String) { - sequence {a=Promise.reject("hello") ""}catch{"blah"} - } -} --------------------------------------------------------------------------------- -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -module A { - fun test : Promise(Never, String) { - sequence { - a = - Promise.reject("hello") - - "" - } catch { - "blah" - } - } -} diff --git a/spec/formatters/sequence_with_comments b/spec/formatters/sequence_with_comments deleted file mode 100644 index c6bc29f07..000000000 --- a/spec/formatters/sequence_with_comments +++ /dev/null @@ -1,21 +0,0 @@ -module A { - fun test : Promise(Never, String) { - sequence {/* A *//* B */a="hello"/* C *//* D */} - } -} --------------------------------------------------------------------------------- -module A { - fun test : Promise(Never, String) { - sequence { - /* A */ - - /* B */ - a = - "hello" - - /* C */ - - /* D */ - } - } -} diff --git a/spec/formatters/sequence_with_finally b/spec/formatters/sequence_with_finally deleted file mode 100644 index 4ab959328..000000000 --- a/spec/formatters/sequence_with_finally +++ /dev/null @@ -1,16 +0,0 @@ -module A { - fun test : Promise(Never, String) { - sequence {a="hello"}finally{"blah"} - } -} --------------------------------------------------------------------------------- -module A { - fun test : Promise(Never, String) { - sequence { - a = - "hello" - } finally { - "blah" - } - } -} diff --git a/spec/parsers/catch_spec.cr b/spec/parsers/catch_spec.cr deleted file mode 100644 index d49b75a3c..000000000 --- a/spec/parsers/catch_spec.cr +++ /dev/null @@ -1,23 +0,0 @@ -require "../spec_helper" - -describe "Catch" do - subject catch - - expect_ignore "" - expect_ignore "ad" - expect_ignore "???" - expect_ignore "catc" - expect_ignore "catch" - expect_ignore "catch " - - expect_error "catch X", Mint::Parser::CatchExpectedArrow - expect_error "catch X ", Mint::Parser::CatchExpectedArrow - expect_error "catch X =>", Mint::Parser::CatchExpectedVariable - expect_error "catch X => ", Mint::Parser::CatchExpectedVariable - expect_error "catch X => a", Mint::Parser::CatchExpectedOpeningBracket - expect_error "catch X => a ", Mint::Parser::CatchExpectedOpeningBracket - expect_error "catch X => a {", Mint::Parser::CatchExpectedExpression - expect_error "catch X => a {a", Mint::Parser::CatchExpectedClosingBracket - - expect_ok "catch X => a { a }" -end diff --git a/spec/parsers/finally_spec.cr b/spec/parsers/finally_spec.cr deleted file mode 100644 index 3ebe84a2e..000000000 --- a/spec/parsers/finally_spec.cr +++ /dev/null @@ -1,20 +0,0 @@ -require "../spec_helper" - -describe "Finally" do - subject finally - - expect_ignore "" - expect_ignore "a" - expect_ignore "??," - expect_ignore "finall" - - expect_error "finally", Mint::Parser::FinallyExpectedOpeningBracket - expect_error "finally ", Mint::Parser::FinallyExpectedOpeningBracket - expect_error "finally {", Mint::Parser::FinallyExpectedExpression - expect_error "finally { ", Mint::Parser::FinallyExpectedExpression - expect_error "finally { a", Mint::Parser::FinallyExpectedClosingBracket - expect_error "finally { a ", Mint::Parser::FinallyExpectedClosingBracket - - expect_ok "finally{a}" - expect_ok "finally { a }" -end diff --git a/spec/parsers/sequence_spec.cr b/spec/parsers/sequence_spec.cr deleted file mode 100644 index 76e33f9cd..000000000 --- a/spec/parsers/sequence_spec.cr +++ /dev/null @@ -1,24 +0,0 @@ -require "../spec_helper" - -describe "Do Expression" do - subject sequence - - expect_ignore "a" - expect_ignore "." - expect_ignore "d" - - expect_error "sequence ", Mint::Parser::SequenceExpectedOpeningBracket - expect_error "sequence ,", Mint::Parser::SequenceExpectedOpeningBracket - expect_error "sequence a", Mint::Parser::SequenceExpectedOpeningBracket - expect_error "sequence {", Mint::Parser::SequenceExpectedStatement - expect_error "sequence { }", Mint::Parser::SequenceExpectedStatement - expect_error "sequence { a", Mint::Parser::SequenceExpectedClosingBracket - expect_error "sequence { a =", Mint::Parser::SequenceExpectedStatement - expect_error "sequence { a = a", Mint::Parser::SequenceExpectedClosingBracket - expect_error "sequence { a = a ", Mint::Parser::SequenceExpectedClosingBracket - - expect_ok "sequence { a }" - expect_ok "sequence { a b }" - expect_ok "sequence { a b }" - expect_ok "sequence { a = x b = c }" -end diff --git a/spec/recursion_spec.cr b/spec/recursion_spec.cr index 3a984a7ee..5116ccfc2 100644 --- a/spec/recursion_spec.cr +++ b/spec/recursion_spec.cr @@ -7,7 +7,7 @@ describe "variable" do component Test { state greeting : String = "" - fun test : Void { + fun test : Promise(Void) { greeting = if (greeting == "hello") { "bye" @@ -15,9 +15,7 @@ describe "variable" do "hello" } - sequence { - next { greeting = greeting } - } + next { greeting = greeting } } fun render : Html { diff --git a/spec/type_checking/finally b/spec/type_checking/finally deleted file mode 100644 index 61eee50af..000000000 --- a/spec/type_checking/finally +++ /dev/null @@ -1,31 +0,0 @@ -component Main { - fun test : Promise(Never, Bool) { - sequence { - true - } finally { - false - } - } - - fun render : Html { - test() - -
- } -} ------------------------------------------------------------OperationTypeMismatch -component Main { - fun test : Promise(Never, Bool) { - sequence { - true - } finally { - "0" + 1 - } - } - - fun render : Html { - test() - -
- } -} diff --git a/spec/type_checking/sequence b/spec/type_checking/sequence deleted file mode 100644 index 2706ca312..000000000 --- a/spec/type_checking/sequence +++ /dev/null @@ -1,32 +0,0 @@ -component Main { - fun test : Promise(Never, String) { - sequence { - "Hello" - } - } - - fun render : Html { -
- } -} --------------------------------------------------------------------------------- -module Promise { - fun resolve (input : b) : Promise(Never, b) { - `` - } -} - -component Main { - fun test : Promise(Never, String) { - sequence { - x = - Promise.resolve("Hello") - - x + " World!" - } - } - - fun render : Html { -
- } -} diff --git a/spec/type_checking/sequence_with_catch b/spec/type_checking/sequence_with_catch deleted file mode 100644 index bb9cc09c2..000000000 --- a/spec/type_checking/sequence_with_catch +++ /dev/null @@ -1,149 +0,0 @@ -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, String) { - sequence { - greeting = - Promise.reject("hello") - - blah = - Promise.reject(0) - - "true" - } catch String => a { - "hello" - } catch Number => a { - "hello" - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------------SequenceDidNotCatch -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Bool) { - sequence { - greeting = - Promise.reject("hello") - - blah = - Promise.reject(0) - - true - } - } - - fun render : Html { - test() - -
- } -} -----------------------------------------------------------SequenceCatchesNothing -component Main { - fun test : Promise(Never, Bool) { - sequence { - true - } catch String => error { - false - } - } - - fun render : Html { - test() - -
- } -} --------------------------------------------------------SequenceCatchTypeMismatch -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Bool) { - sequence { - blah = - Promise.reject(0) - - true - } catch Number => error { - "" - } - } - - fun render : Html { - test() - -
- } -} - --------------------------------------------------------SequenceCatchTypeMismatch -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Bool) { - sequence { - blah = - Promise.reject(0) - - true - } catch { - "" - } - } - - fun render : Html { - test() - -
- } -} ---------------------------------------------------------------SequenceCatchedAll -module Promise { - fun reject (input : a) : Promise(a, b) { - `` - } -} - -component Main { - fun test : Promise(Never, Bool) { - sequence { - blah = - Promise.reject(0) - - true - } catch Number => error { - false - } catch { - false - } - } - - fun render : Html { - test() - -
- } -} diff --git a/src/ast.cr b/src/ast.cr index 012bdf60b..4af2600db 100644 --- a/src/ast.cr +++ b/src/ast.cr @@ -18,7 +18,6 @@ module Mint Operation | NextCall | Variable | - Sequence | Routes | Encode | EnumId | diff --git a/src/ast/catch.cr b/src/ast/catch.cr deleted file mode 100644 index e448befcc..000000000 --- a/src/ast/catch.cr +++ /dev/null @@ -1,15 +0,0 @@ -module Mint - class Ast - class Catch < Node - getter variable, expression, type - - def initialize(@expression : Expression, - @variable : Variable, - @type : String, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/ast/catch_all.cr b/src/ast/catch_all.cr deleted file mode 100644 index c09a72052..000000000 --- a/src/ast/catch_all.cr +++ /dev/null @@ -1,13 +0,0 @@ -module Mint - class Ast - class CatchAll < Node - getter expression - - def initialize(@expression : Expression, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/ast/finally.cr b/src/ast/finally.cr deleted file mode 100644 index 5beae5f76..000000000 --- a/src/ast/finally.cr +++ /dev/null @@ -1,13 +0,0 @@ -module Mint - class Ast - class Finally < Node - getter expression - - def initialize(@expression : Expression, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/ast/sequence.cr b/src/ast/sequence.cr deleted file mode 100644 index 0f9636157..000000000 --- a/src/ast/sequence.cr +++ /dev/null @@ -1,17 +0,0 @@ -module Mint - class Ast - class Sequence < Node - getter statements, catches, finally, comments, catch_all - - def initialize(@statements : Array(Statement), - @comments : Array(Comment), - @finally : Finally?, - @catches : Array(Catch), - @catch_all : CatchAll?, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/ast/statement.cr b/src/ast/statement.cr index 25fd50a22..a0e82c11d 100644 --- a/src/ast/statement.cr +++ b/src/ast/statement.cr @@ -2,7 +2,6 @@ module Mint class Ast class Statement < Node enum Parent - Sequence None end diff --git a/src/ast/then.cr b/src/ast/then.cr deleted file mode 100644 index b0b2380db..000000000 --- a/src/ast/then.cr +++ /dev/null @@ -1,13 +0,0 @@ -module Mint - class Ast - class Then < Node - getter expression - - def initialize(@expression : Expression, - @input : Data, - @from : Int32, - @to : Int32) - end - end - end -end diff --git a/src/compilers/catch.cr b/src/compilers/catch.cr deleted file mode 100644 index d8edd17fe..000000000 --- a/src/compilers/catch.cr +++ /dev/null @@ -1,17 +0,0 @@ -module Mint - class Compiler - def _compile(node : Ast::Catch) : String - body = - compile node.expression - - variable = - js.variable_of(node) - - js.statements([ - js.let(variable, "_error"), - js.assign("_", body), - "throw new DoError()", - ]) - end - end -end diff --git a/src/compilers/finally.cr b/src/compilers/finally.cr deleted file mode 100644 index ba82c684d..000000000 --- a/src/compilers/finally.cr +++ /dev/null @@ -1,10 +0,0 @@ -module Mint - class Compiler - def _compile(node : Ast::Finally) : String - body = - compile node.expression - - "finally {\n#{body.indent}\n}" - end - end -end diff --git a/src/compilers/sequence.cr b/src/compilers/sequence.cr deleted file mode 100644 index 65853e6d8..000000000 --- a/src/compilers/sequence.cr +++ /dev/null @@ -1,131 +0,0 @@ -module Mint - class Compiler - protected def prefix(_node : Ast::Sequence, statement : Ast::Statement, value : String) - case target = statement.target - when Ast::Variable - js.let(js.variable_of(target), value) - when Ast::TupleDestructuring - variables = - target - .parameters - .join(',') { |param| js.variable_of(param) } - - "const [#{variables}] = #{value}" - else - value - end - end - - def _compile(node : Ast::Sequence) : String - _compile(node) { |statement| compile(statement) } - end - - def _compile(node : Ast::Sequence, & : Ast::Statement, Int32, Bool -> String) : String - statements = node.statements - statements_size = statements.size - - body = - statements - .sort_by { |item| resolve_order.index(item) || -1 } - .map_with_index do |statement, index| - is_last = - (index + 1) == statements_size - - inner_prefix = ->(value : String) { - if is_last - "_ = #{value}" - else - prefix(node, statement, value) - end - } - - expression = - yield statement, index, is_last - - # Get the time of the statement - type = types[statement]? - - catches = - case type - when TypeChecker::Type - if type.name.in?("Promise", "Result") && type.parameters[0] - node - .catches - .select(&.type.==(type.parameters[0].name)) - .map { |item| compile(item).as(String) } - else - %w[] - end - else - %w[] - end - - case type - when TypeChecker::Type - case type.name - when "Result" - if catches.empty? - js.statements([ - js.let("_#{index}", expression), - js.if("_#{index} instanceof Err") do - "throw _#{index}._0" - end, - inner_prefix.call("_#{index}._0"), - ]) - else - js.statements([ - js.let("_#{index}", expression), - js.if("_#{index} instanceof Err") do - js.statements([ - js.let("_error", "_#{index}._0"), - ] + catches) - end, - inner_prefix.call("_#{index}._0"), - ]) - end - when "Promise" - unless catches.empty? - try = js.asynciif do - js.try( - body: "return await #{expression}", - catches: [ - js.catch("_error") { js.statements(catches) }, - ], - finally: "") - end - inner_prefix.call("await #{try}") - end - end - end || inner_prefix.call("await #{expression}") - end - - catch_all = - node.catch_all.try do |catch| - "_ = #{compile catch.expression}" - end || js.statements([ - "console.warn(`Unhandled error in sequence expression:`)", - "console.warn(_error)", - ]) - - finally = - if node_finally = node.finally - compile node_finally - end - - js.asynciif do - js.statements([ - js.let("_", "null"), - js.try( - body: js.statements(body), - catches: [ - js.catch("_error") do - js.if("!(_error instanceof DoError)", catch_all) - end, - ], - finally: finally.to_s), - "return _", - ]) - end - end - end -end diff --git a/src/compilers/test.cr b/src/compilers/test.cr index 3f3d1845d..a63225151 100644 --- a/src/compilers/test.cr +++ b/src/compilers/test.cr @@ -28,13 +28,6 @@ module Mint JS end - def unwrap_parenthesized_expression(node) - while node.is_a?(Ast::ParenthesizedExpression) - node = node.expression - end - node - end - def _compile(node : Ast::Test) : String name = compile node.name @@ -49,21 +42,6 @@ module Mint case raw_expression when Ast::Operation _compile_operation_test(raw_expression) - when Ast::Sequence - _compile(raw_expression) do |statement, _index, is_last| - if is_last - exp = - unwrap_parenthesized_expression(statement.expression) - - case exp - when Ast::Operation - if wrapped = _compile_operation_test(exp) - next wrapped - end - end - end - compile(statement) - end end expression ||= compile(raw_expression) diff --git a/src/formatters/catch.cr b/src/formatters/catch.cr deleted file mode 100644 index 0ac8e3c26..000000000 --- a/src/formatters/catch.cr +++ /dev/null @@ -1,16 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::Catch) : String - body = - format node.expression - - variable = - format node.variable - - type = - format node.type - - "catch #{type} => #{variable} #{body}" - end - end -end diff --git a/src/formatters/catch_all.cr b/src/formatters/catch_all.cr deleted file mode 100644 index 832c966c6..000000000 --- a/src/formatters/catch_all.cr +++ /dev/null @@ -1,10 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::CatchAll) : String - body = - format node.expression - - "catch #{body}" - end - end -end diff --git a/src/formatters/finally.cr b/src/formatters/finally.cr deleted file mode 100644 index 260ab3f53..000000000 --- a/src/formatters/finally.cr +++ /dev/null @@ -1,10 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::Finally) : String - body = - format node.expression - - "finally #{body}" - end - end -end diff --git a/src/formatters/sequence.cr b/src/formatters/sequence.cr deleted file mode 100644 index 899e407f3..000000000 --- a/src/formatters/sequence.cr +++ /dev/null @@ -1,27 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::Sequence) : String - items = - node.statements + node.comments - - body = - list items - - catches = - format node.catches - - finally = - format node.finally - - node.catch_all.try do |catch| - catches.push format(catch) - end - - ["sequence {\n#{indent(body)}\n}", - catches.join(' '), - finally.to_s, - ].reject!(&.blank?) - .join(' ') - end - end -end diff --git a/src/formatters/then.cr b/src/formatters/then.cr deleted file mode 100644 index f86ae32ce..000000000 --- a/src/formatters/then.cr +++ /dev/null @@ -1,10 +0,0 @@ -module Mint - class Formatter - def format(node : Ast::Then) : String - body = - format node.expression - - "then #{body}" - end - end -end diff --git a/src/messages/catch_expected_arrow.cr b/src/messages/catch_expected_arrow.cr deleted file mode 100644 index 27b41e8a2..000000000 --- a/src/messages/catch_expected_arrow.cr +++ /dev/null @@ -1,14 +0,0 @@ -message CatchExpectedArrow do - title "Syntax Error" - - block do - text "The variable and the type of" - bold "a catch" - text "must be separated by" - bold "an arrow." - end - - was_looking_for "arrow", got, "=>" - - snippet node -end diff --git a/src/messages/catch_expected_closing_bracket.cr b/src/messages/catch_expected_closing_bracket.cr deleted file mode 100644 index c4de83568..000000000 --- a/src/messages/catch_expected_closing_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message CatchExpectedClosingBracket do - title "Syntax Error" - - closing_bracket "a catch expression", got - - snippet node -end diff --git a/src/messages/catch_expected_expression.cr b/src/messages/catch_expected_expression.cr deleted file mode 100644 index 20837b335..000000000 --- a/src/messages/catch_expected_expression.cr +++ /dev/null @@ -1,12 +0,0 @@ -message CatchExpectedExpression do - title "Syntax Error" - - block do - text "A catch must have exactly" - bold "one expression." - end - - was_looking_for "expression", got - - snippet node -end diff --git a/src/messages/catch_expected_opening_bracket.cr b/src/messages/catch_expected_opening_bracket.cr deleted file mode 100644 index c608b001c..000000000 --- a/src/messages/catch_expected_opening_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message CatchExpectedOpeningBracket do - title "Syntax Error" - - opening_bracket "a catch expression", got - - snippet node -end diff --git a/src/messages/catch_expected_variable.cr b/src/messages/catch_expected_variable.cr deleted file mode 100644 index ae1bdd5e3..000000000 --- a/src/messages/catch_expected_variable.cr +++ /dev/null @@ -1,14 +0,0 @@ -message CatchExpectedVariable do - title "Syntax Error" - - block do - text "In a catch you must specify" - bold "a variable" - text "to hold the" - bold "catched value." - end - - was_looking_for "variable", got - - snippet node -end diff --git a/src/messages/finally_expected_closing_bracket.cr b/src/messages/finally_expected_closing_bracket.cr deleted file mode 100644 index d3a7360c5..000000000 --- a/src/messages/finally_expected_closing_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message FinallyExpectedClosingBracket do - title "Syntax Error" - - closing_bracket "finally block", got - - snippet node -end diff --git a/src/messages/finally_expected_expression.cr b/src/messages/finally_expected_expression.cr deleted file mode 100644 index 2c72f90ef..000000000 --- a/src/messages/finally_expected_expression.cr +++ /dev/null @@ -1,15 +0,0 @@ -message FinallyExpectedExpression do - title "Syntax Error" - - block do - text "The" - bold "body" - text "of a" - bold "finally block" - text "must be a single expression." - end - - was_looking_for "expression", got - - snippet node -end diff --git a/src/messages/finally_expected_opening_bracket.cr b/src/messages/finally_expected_opening_bracket.cr deleted file mode 100644 index 8977a75f9..000000000 --- a/src/messages/finally_expected_opening_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message FinallyExpectedOpeningBracket do - title "Syntax Error" - - opening_bracket "finally block", got - - snippet node -end diff --git a/src/messages/sequence_catch_type_mismatch.cr b/src/messages/sequence_catch_type_mismatch.cr deleted file mode 100644 index 071dfc61f..000000000 --- a/src/messages/sequence_catch_type_mismatch.cr +++ /dev/null @@ -1,12 +0,0 @@ -message SequenceCatchTypeMismatch do - title "Type Error" - - block do - text "The return type of a catch does not match the return type" - text "of the last statement in a sequence expression." - end - - was_expecting_type expected, got - - snippet node -end diff --git a/src/messages/sequence_catched_all.cr b/src/messages/sequence_catched_all.cr deleted file mode 100644 index ee9a8d41f..000000000 --- a/src/messages/sequence_catched_all.cr +++ /dev/null @@ -1,9 +0,0 @@ -message SequenceCatchedAll do - title "Type Error" - - block do - text "All possible errors have been catched." - end - - snippet node, "There is a general catch which now can be safely removed:" -end diff --git a/src/messages/sequence_catches_nothing.cr b/src/messages/sequence_catches_nothing.cr deleted file mode 100644 index 52ec22288..000000000 --- a/src/messages/sequence_catches_nothing.cr +++ /dev/null @@ -1,11 +0,0 @@ -message SequenceCatchesNothing do - title "Type Error" - - block do - text "There are no statements that can result (as an error) in this type:" - end - - type got - - snippet node, "There is a catch for this type, which now can be removed:" -end diff --git a/src/messages/sequence_did_not_catch.cr b/src/messages/sequence_did_not_catch.cr deleted file mode 100644 index c2b36fa2e..000000000 --- a/src/messages/sequence_did_not_catch.cr +++ /dev/null @@ -1,16 +0,0 @@ -message SequenceDidNotCatch do - title "Type Error" - - block do - text "I am checking if all the possible errors are handled in" - bold "a sequence expression." - end - - block do - text "I found that these types are not handled:" - end - - type_list remaining - - snippet node -end diff --git a/src/messages/sequence_expected_closing_bracket.cr b/src/messages/sequence_expected_closing_bracket.cr deleted file mode 100644 index ce2ee966d..000000000 --- a/src/messages/sequence_expected_closing_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message SequenceExpectedClosingBracket do - title "Syntax Error" - - closing_bracket "sequence expression", got - - snippet node -end diff --git a/src/messages/sequence_expected_opening_bracket.cr b/src/messages/sequence_expected_opening_bracket.cr deleted file mode 100644 index cc9e28a54..000000000 --- a/src/messages/sequence_expected_opening_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message SequenceExpectedOpeningBracket do - title "Syntax Error" - - opening_bracket "sequence expression", got - - snippet node -end diff --git a/src/messages/sequence_expected_statement.cr b/src/messages/sequence_expected_statement.cr deleted file mode 100644 index 6cb9134e3..000000000 --- a/src/messages/sequence_expected_statement.cr +++ /dev/null @@ -1,20 +0,0 @@ -message SequenceExpectedStatement do - title "Syntax Error" - - block do - text "A" - bold "sequence expression" - text "must have at least one statement." - end - - block do - text "I was looking for a" - bold "statement" - - text "but found" - code got - text "instead." - end - - snippet node -end diff --git a/src/messages/then_expected_closing_bracket.cr b/src/messages/then_expected_closing_bracket.cr deleted file mode 100644 index 9e32dd9a5..000000000 --- a/src/messages/then_expected_closing_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message ThenExpectedClosingBracket do - title "Syntax Error" - - closing_bracket "then block", got - - snippet node -end diff --git a/src/messages/then_expected_expression.cr b/src/messages/then_expected_expression.cr deleted file mode 100644 index f929ffeba..000000000 --- a/src/messages/then_expected_expression.cr +++ /dev/null @@ -1,15 +0,0 @@ -message ThenExpectedExpression do - title "Syntax Error" - - block do - text "The" - bold "body" - text "of a" - bold "then block" - text "must be a single expression." - end - - was_looking_for "expression", got - - snippet node -end diff --git a/src/messages/then_expected_opening_bracket.cr b/src/messages/then_expected_opening_bracket.cr deleted file mode 100644 index 2f0d3c5f0..000000000 --- a/src/messages/then_expected_opening_bracket.cr +++ /dev/null @@ -1,7 +0,0 @@ -message ThenExpectedOpeningBracket do - title "Syntax Error" - - opening_bracket "then block", got - - snippet node -end diff --git a/src/parsers/basic_expression.cr b/src/parsers/basic_expression.cr index 53a01651e..d5c4a9c9a 100644 --- a/src/parsers/basic_expression.cr +++ b/src/parsers/basic_expression.cr @@ -28,7 +28,6 @@ module Mint if_expression || for_expression || next_call || - sequence || case_expression || parenthesized_expression_or_inline_function || starts_with_uppercase || diff --git a/src/parsers/catch.cr b/src/parsers/catch.cr deleted file mode 100644 index 689c0392a..000000000 --- a/src/parsers/catch.cr +++ /dev/null @@ -1,39 +0,0 @@ -module Mint - class Parser - syntax_error CatchExpectedOpeningBracket - syntax_error CatchExpectedClosingBracket - syntax_error CatchExpectedExpression - syntax_error CatchExpectedVariable - syntax_error CatchExpectedArrow - - def catch : Ast::Catch? - start do |start_position| - next unless keyword "catch" - - whitespace - next unless type = type_id - whitespace - - keyword! "=>", CatchExpectedArrow - - whitespace - variable = variable! CatchExpectedVariable - whitespace - - expression = - code_block( - opening_bracket: CatchExpectedOpeningBracket, - closing_bracket: CatchExpectedClosingBracket, - statement_error: CatchExpectedExpression) - - self << Ast::Catch.new( - expression: expression, - from: start_position, - variable: variable, - to: position, - input: data, - type: type) - end - end - end -end diff --git a/src/parsers/catch_all.cr b/src/parsers/catch_all.cr deleted file mode 100644 index c5b8e490e..000000000 --- a/src/parsers/catch_all.cr +++ /dev/null @@ -1,22 +0,0 @@ -module Mint - class Parser - def catch_all : Ast::CatchAll? - start do |start_position| - next unless keyword "catch" - whitespace - - expression = - code_block( - opening_bracket: CatchExpectedOpeningBracket, - closing_bracket: CatchExpectedClosingBracket, - statement_error: CatchExpectedExpression) - - self << Ast::CatchAll.new( - expression: expression, - from: start_position, - to: position, - input: data) - end - end - end -end diff --git a/src/parsers/finally.cr b/src/parsers/finally.cr deleted file mode 100644 index 1b19e9521..000000000 --- a/src/parsers/finally.cr +++ /dev/null @@ -1,27 +0,0 @@ -module Mint - class Parser - syntax_error FinallyExpectedOpeningBracket - syntax_error FinallyExpectedClosingBracket - syntax_error FinallyExpectedExpression - - def finally : Ast::Finally? - start do |start_position| - whitespace - - next unless keyword "finally" - - expression = code_block( - opening_bracket: FinallyExpectedOpeningBracket, - closing_bracket: FinallyExpectedClosingBracket, - statement_error: FinallyExpectedExpression, - ) - - self << Ast::Finally.new( - expression: expression, - from: start_position, - to: position, - input: data) - end - end - end -end diff --git a/src/parsers/sequence.cr b/src/parsers/sequence.cr deleted file mode 100644 index 5157b99a2..000000000 --- a/src/parsers/sequence.cr +++ /dev/null @@ -1,54 +0,0 @@ -module Mint - class Parser - syntax_error SequenceExpectedOpeningBracket - syntax_error SequenceExpectedClosingBracket - syntax_error SequenceExpectedStatement - - def sequence : Ast::Sequence? - start do |start_position| - next unless keyword "sequence" - next unless whitespace? - whitespace - - body = block( - opening_bracket: SequenceExpectedOpeningBracket, - closing_bracket: SequenceExpectedClosingBracket - ) do - results = many { statement(:sequence) || comment } - - raise SequenceExpectedStatement if results.none?(Ast::Statement) - - results - end - - whitespace - catches = many { catch } - - whitespace - catch_all = self.catch_all - - statements = [] of Ast::Statement - comments = [] of Ast::Comment - - body.each do |item| - case item - when Ast::Statement - statements << item - when Ast::Comment - comments << item - end - end - - self << Ast::Sequence.new( - statements: statements, - from: start_position, - catch_all: catch_all, - comments: comments, - finally: finally, - catches: catches, - to: position, - input: data) - end - end - end -end diff --git a/src/parsers/then.cr b/src/parsers/then.cr deleted file mode 100644 index 796163f41..000000000 --- a/src/parsers/then.cr +++ /dev/null @@ -1,27 +0,0 @@ -module Mint - class Parser - syntax_error ThenExpectedOpeningBracket - syntax_error ThenExpectedClosingBracket - syntax_error ThenExpectedExpression - - def then_block : Ast::Then? - start do |start_position| - whitespace - - next unless keyword "then" - - expression = - code_block( - opening_bracket: ThenExpectedOpeningBracket, - closing_bracket: ThenExpectedClosingBracket, - statement_error: ThenExpectedExpression) - - self << Ast::Then.new( - expression: expression.as(Ast::Expression), - from: start_position, - to: position, - input: data) - end - end - end -end diff --git a/src/type_checkers/catch.cr b/src/type_checkers/catch.cr deleted file mode 100644 index 54acc91a5..000000000 --- a/src/type_checkers/catch.cr +++ /dev/null @@ -1,7 +0,0 @@ -module Mint - class TypeChecker - def check(node : Ast::Catch) : Checkable - resolve node.expression - end - end -end diff --git a/src/type_checkers/finally.cr b/src/type_checkers/finally.cr deleted file mode 100644 index 5a339d4ad..000000000 --- a/src/type_checkers/finally.cr +++ /dev/null @@ -1,7 +0,0 @@ -module Mint - class TypeChecker - def check(node : Ast::Finally) : Checkable - resolve node.expression - end - end -end diff --git a/src/type_checkers/sequence.cr b/src/type_checkers/sequence.cr deleted file mode 100644 index 0bc0bd553..000000000 --- a/src/type_checkers/sequence.cr +++ /dev/null @@ -1,82 +0,0 @@ -module Mint - class TypeChecker - type_error SequenceCatchTypeMismatch - type_error SequenceCatchesNothing - type_error SequenceDidNotCatch - type_error SequenceCatchedAll - - def check(node : Ast::Sequence) : Checkable - to_catch = [] of Checkable - - scope node.statements do - node.statements.map do |statement| - new_type = resolve statement - - if new_type.name.in?("Promise", "Result") && new_type.parameters.size == 2 - unless new_type.parameters[0].name.in?("Void", "Never") - to_catch << new_type.parameters[0] - end - end - end - end - - final_type = resolve node.statements.last - - node.catches.each do |catch| - catch_type = resolve_type(Type.new(catch.type)) - - raise SequenceCatchesNothing, { - "got" => catch_type, - "node" => catch, - } if to_catch.none? { |item| Comparer.compare(catch_type, item) } - - check_variable catch.variable - - scope({catch.variable.value, catch_type, catch}) do - catch_return_type = resolve catch - - raise SequenceCatchTypeMismatch, { - "expected" => final_type, - "got" => catch_return_type, - "node" => catch.expression, - } unless Comparer.compare(final_type, catch_return_type) - end - - to_catch.reject! { |item| Comparer.compare(catch_type, item) } - end - - resolve node.finally.not_nil! if node.finally - - catch_all_type = - node.catch_all.try do |catch| - raise SequenceCatchedAll, { - "node" => catch, - } if to_catch.empty? - - type = resolve catch.expression - - raise SequenceCatchTypeMismatch, { - "expected" => final_type, - "node" => catch, - "got" => type, - } unless Comparer.compare(type, final_type) - - type - end - - raise SequenceDidNotCatch, { - "remaining" => to_catch, - "node" => node, - } if !to_catch.empty? && catch_all_type.nil? - - promise_type = - Type.new("Promise", [NEVER, Variable.new("a")] of Checkable) - - if final_type && Comparer.compare(promise_type, final_type) - final_type - else - Type.new("Promise", [NEVER, final_type || VOID] of Checkable) - end - end - end -end diff --git a/src/type_checkers/variable.cr b/src/type_checkers/variable.cr index b46f96a63..b5b35a004 100644 --- a/src/type_checkers/variable.cr +++ b/src/type_checkers/variable.cr @@ -4,10 +4,9 @@ module Mint type_error VariableMissing RESERVED = - %w(break case catch class const continue debugger default delete do else - export extends finally for function if import in instanceof new return - super switch this throw try typeof var void while with yield state - sequence) + %w(break case class const continue debugger default delete do else + export extends for function if import in instanceof new return + super switch this throw try typeof var void while with yield state) def check(node : Ast::Variable) : Checkable raise VariableReserved, { From 351c6545617e7ed99015bd34ebc6b41af72f29fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Mon, 11 Oct 2021 08:57:13 +0200 Subject: [PATCH 18/20] Updates for handling blocks. --- src/ast/access.cr | 2 +- src/ast/for.cr | 2 +- src/ast/for_condition.cr | 2 +- src/ast/get.cr | 2 +- src/ast/if.cr | 2 +- src/ast/route.cr | 2 +- src/ast/test.cr | 4 ++-- src/compilers/block.cr | 24 +++++++++++++++--------- src/compilers/get.cr | 7 +------ src/compilers/route.cr | 2 +- src/js.cr | 9 +++++++++ 11 files changed, 34 insertions(+), 24 deletions(-) diff --git a/src/ast/access.cr b/src/ast/access.cr index 44ee741fd..8f74bea1d 100644 --- a/src/ast/access.cr +++ b/src/ast/access.cr @@ -6,9 +6,9 @@ module Mint def initialize(@field : Variable, @lhs : Expression, - @safe : Bool, @input : Data, @from : Int32, + @safe : Bool, @to : Int32) end end diff --git a/src/ast/for.cr b/src/ast/for.cr index ae20c474b..ed1b2b627 100644 --- a/src/ast/for.cr +++ b/src/ast/for.cr @@ -6,7 +6,7 @@ module Mint def initialize(@condition : ForCondition?, @arguments : Array(Variable), @subject : Expression, - @body : Expression, + @body : Block, @input : Data, @from : Int32, @to : Int32) diff --git a/src/ast/for_condition.cr b/src/ast/for_condition.cr index 1fdf9b5e7..a14530059 100644 --- a/src/ast/for_condition.cr +++ b/src/ast/for_condition.cr @@ -3,7 +3,7 @@ module Mint class ForCondition < Node getter condition - def initialize(@condition : Expression, + def initialize(@condition : Block, @input : Data, @from : Int32, @to : Int32) diff --git a/src/ast/get.cr b/src/ast/get.cr index f49b78d27..259851e48 100644 --- a/src/ast/get.cr +++ b/src/ast/get.cr @@ -5,8 +5,8 @@ module Mint def initialize(@type : TypeOrVariable?, @comment : Comment?, - @body : Expression, @name : Variable, + @body : Block, @input : Data, @from : Int32, @to : Int32) diff --git a/src/ast/if.cr b/src/ast/if.cr index 39e74a439..4bf809738 100644 --- a/src/ast/if.cr +++ b/src/ast/if.cr @@ -6,7 +6,7 @@ module Mint alias Branches = Tuple(Array(CssDefinition), Array(CssDefinition)) | Tuple(Array(CssDefinition), Nil) | Tuple(Array(CssDefinition), If) | - Tuple(Node, Node) + Tuple(Block, Block) def initialize(@branches : Branches, @condition : Node, diff --git a/src/ast/route.cr b/src/ast/route.cr index 482446fde..141a10fc7 100644 --- a/src/ast/route.cr +++ b/src/ast/route.cr @@ -4,7 +4,7 @@ module Mint getter url, expression, arguments def initialize(@arguments : Array(Argument), - @expression : Expression, + @expression : Block, @input : Data, @from : Int32, @url : String, diff --git a/src/ast/test.cr b/src/ast/test.cr index bf678da91..ad0a89f6e 100644 --- a/src/ast/test.cr +++ b/src/ast/test.cr @@ -3,8 +3,8 @@ module Mint class Test < Node getter name, expression - def initialize(@expression : Expression, - @name : StringLiteral, + def initialize(@name : StringLiteral, + @expression : Block, @input : Data, @from : Int32, @to : Int32) diff --git a/src/compilers/block.cr b/src/compilers/block.cr index 8608b74ed..4527ed054 100644 --- a/src/compilers/block.cr +++ b/src/compilers/block.cr @@ -9,18 +9,18 @@ module Mint end def _compile(node : Ast::Block, for_function = false) : String - if node.statements.size == 1 + statements = + node.statements.select(Ast::Statement) + + if statements.size == 1 if for_function - js.return(compile(node.statements.first)) + js.return(compile(statements.first)) else - compile(node.statements.first) + compile(statements.first) end else compiled_statements = - compile( - node - .statements - .sort_by! { |item| resolve_order.index(item) || -1 }) + compile(statements.sort_by! { |item| resolve_order.index(item) || -1 }) last = compiled_statements.pop @@ -28,8 +28,14 @@ module Mint if for_function js.statements(compiled_statements + [js.return(last)]) else - js.iif do - js.statements(compiled_statements + [js.return(last)]) + if node.async? + js.asynciif do + js.statements(compiled_statements + [js.return(last)]) + end + else + js.iif do + js.statements(compiled_statements + [js.return(last)]) + end end end end diff --git a/src/compilers/get.cr b/src/compilers/get.cr index 6d8014a51..8f9d3dbc9 100644 --- a/src/compilers/get.cr +++ b/src/compilers/get.cr @@ -2,12 +2,7 @@ module Mint class Compiler def _compile(node : Ast::Get) : String body = - case item = node.body - when Ast::Block - compile item, for_function: true - else - compile item - end + compile item, for_function: true name = js.variable_of(node) diff --git a/src/compilers/route.cr b/src/compilers/route.cr index 91aa5c2c0..0454c04f3 100644 --- a/src/compilers/route.cr +++ b/src/compilers/route.cr @@ -18,7 +18,7 @@ module Mint .map { |argument| @serializer.decoder(cache[argument]) } js.object({ - "handler" => js.arrow_function(arguments, expression), + "handler" => js.async_arrow_function(arguments, expression), "decoders" => js.array(decoders), "mapping" => js.array(mapping), "path" => "`#{node.url}`", diff --git a/src/js.cr b/src/js.cr index bc94f812c..cb3eb4114 100644 --- a/src/js.cr +++ b/src/js.cr @@ -4,6 +4,7 @@ module Mint abstract def function(name : String, arguments : Array(String), body : String) : String abstract def async_function(name : String, arguments : Array(String), body : String) : String abstract def arrow_function(arguments : Array(String), body : String) : String + abstract def async_arrow_function(arguments : Array(String), body : String) : String abstract def const(name : String, value : String) : String abstract def class(name : String, extends : String, body : Array(String)) : String abstract def assign(name : String, value : String) : String @@ -82,6 +83,10 @@ module Mint "((#{arguments.join(", ")})=>{#{body}})" end + def async_arrow_function(arguments : Array(String), body : String) : String + "(async (#{arguments.join(", ")})=>{#{body}})" + end + def const(name : String, value : String) : String "const #{name}=#{value}" end @@ -195,6 +200,10 @@ module Mint "(#{arguments.join(", ")}) => #{class_body(body)}" end + def async_arrow_function(arguments : Array(String), body : String) : String + "async (#{arguments.join(", ")}) => #{class_body(body)}" + end + def const(name : String, value : String) : String "const #{name} = #{value}" end From 00131ad58b203377d5bb5a418549b9b2bd205262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Wed, 13 Oct 2021 09:03:57 +0200 Subject: [PATCH 19/20] Started implementing tree-sitter grammar. --- .gitignore | 1 + grammar/Cargo.toml | 26 + grammar/binding.gyp | 19 + grammar/bindings/node/binding.cc | 28 + grammar/bindings/node/index.js | 19 + grammar/bindings/rust/build.rs | 40 + grammar/bindings/rust/lib.rs | 52 ++ grammar/build/config.gypi | 95 +++ grammar/grammar.js | 89 +++ grammar/package.json | 7 + grammar/src/grammar.json | 458 +++++++++++ grammar/src/node-types.json | 260 +++++++ grammar/src/parser.c | 1209 ++++++++++++++++++++++++++++++ grammar/src/tree_sitter/parser.h | 223 ++++++ grammar/test/corpus/type.txt | 22 + grammar/yarn.lock | 8 + 16 files changed, 2556 insertions(+) create mode 100644 grammar/Cargo.toml create mode 100644 grammar/binding.gyp create mode 100644 grammar/bindings/node/binding.cc create mode 100644 grammar/bindings/node/index.js create mode 100644 grammar/bindings/rust/build.rs create mode 100644 grammar/bindings/rust/lib.rs create mode 100644 grammar/build/config.gypi create mode 100644 grammar/grammar.js create mode 100644 grammar/package.json create mode 100644 grammar/src/grammar.json create mode 100644 grammar/src/node-types.json create mode 100644 grammar/src/parser.c create mode 100644 grammar/src/tree_sitter/parser.h create mode 100644 grammar/test/corpus/type.txt create mode 100644 grammar/yarn.lock diff --git a/.gitignore b/.gitignore index 78d79f265..1cc2eaa98 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /lib/ /bin/ /.shards/ +node_modules diff --git a/grammar/Cargo.toml b/grammar/Cargo.toml new file mode 100644 index 000000000..e86d1f660 --- /dev/null +++ b/grammar/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "tree-sitter-mint" +description = "mint grammar for the tree-sitter parsing library" +version = "0.0.1" +keywords = ["incremental", "parsing", "mint"] +categories = ["parsing", "text-editors"] +repository = "https://github.com/tree-sitter/tree-sitter-mint" +edition = "2018" +license = "MIT" + +build = "bindings/rust/build.rs" +include = [ + "bindings/rust/*", + "grammar.js", + "queries/*", + "src/*", +] + +[lib] +path = "bindings/rust/lib.rs" + +[dependencies] +tree-sitter = "~0.20.0" + +[build-dependencies] +cc = "1.0" diff --git a/grammar/binding.gyp b/grammar/binding.gyp new file mode 100644 index 000000000..11694cb2d --- /dev/null +++ b/grammar/binding.gyp @@ -0,0 +1,19 @@ +{ + "targets": [ + { + "target_name": "tree_sitter_mint_binding", + "include_dirs": [ + " +#include "nan.h" + +using namespace v8; + +extern "C" TSLanguage * tree_sitter_mint(); + +namespace { + +NAN_METHOD(New) {} + +void Init(Local exports, Local module) { + Local tpl = Nan::New(New); + tpl->SetClassName(Nan::New("Language").ToLocalChecked()); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + Local constructor = Nan::GetFunction(tpl).ToLocalChecked(); + Local instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked(); + Nan::SetInternalFieldPointer(instance, 0, tree_sitter_mint()); + + Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("mint").ToLocalChecked()); + Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance); +} + +NODE_MODULE(tree_sitter_mint_binding, Init) + +} // namespace diff --git a/grammar/bindings/node/index.js b/grammar/bindings/node/index.js new file mode 100644 index 000000000..86ec369aa --- /dev/null +++ b/grammar/bindings/node/index.js @@ -0,0 +1,19 @@ +try { + module.exports = require("../../build/Release/tree_sitter_mint_binding"); +} catch (error1) { + if (error1.code !== 'MODULE_NOT_FOUND') { + throw error1; + } + try { + module.exports = require("../../build/Debug/tree_sitter_mint_binding"); + } catch (error2) { + if (error2.code !== 'MODULE_NOT_FOUND') { + throw error2; + } + throw error1 + } +} + +try { + module.exports.nodeTypeInfo = require("../../src/node-types.json"); +} catch (_) {} diff --git a/grammar/bindings/rust/build.rs b/grammar/bindings/rust/build.rs new file mode 100644 index 000000000..c6061f099 --- /dev/null +++ b/grammar/bindings/rust/build.rs @@ -0,0 +1,40 @@ +fn main() { + let src_dir = std::path::Path::new("src"); + + let mut c_config = cc::Build::new(); + c_config.include(&src_dir); + c_config + .flag_if_supported("-Wno-unused-parameter") + .flag_if_supported("-Wno-unused-but-set-variable") + .flag_if_supported("-Wno-trigraphs"); + let parser_path = src_dir.join("parser.c"); + c_config.file(&parser_path); + + // If your language uses an external scanner written in C, + // then include this block of code: + + /* + let scanner_path = src_dir.join("scanner.c"); + c_config.file(&scanner_path); + println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); + */ + + c_config.compile("parser"); + println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); + + // If your language uses an external scanner written in C++, + // then include this block of code: + + /* + let mut cpp_config = cc::Build::new(); + cpp_config.cpp(true); + cpp_config.include(&src_dir); + cpp_config + .flag_if_supported("-Wno-unused-parameter") + .flag_if_supported("-Wno-unused-but-set-variable"); + let scanner_path = src_dir.join("scanner.cc"); + cpp_config.file(&scanner_path); + cpp_config.compile("scanner"); + println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); + */ +} diff --git a/grammar/bindings/rust/lib.rs b/grammar/bindings/rust/lib.rs new file mode 100644 index 000000000..b8e41a802 --- /dev/null +++ b/grammar/bindings/rust/lib.rs @@ -0,0 +1,52 @@ +//! This crate provides mint language support for the [tree-sitter][] parsing library. +//! +//! Typically, you will use the [language][language func] function to add this language to a +//! tree-sitter [Parser][], and then use the parser to parse some code: +//! +//! ``` +//! let code = ""; +//! let mut parser = tree_sitter::Parser::new(); +//! parser.set_language(tree_sitter_mint::language()).expect("Error loading mint grammar"); +//! let tree = parser.parse(code, None).unwrap(); +//! ``` +//! +//! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html +//! [language func]: fn.language.html +//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html +//! [tree-sitter]: https://tree-sitter.github.io/ + +use tree_sitter::Language; + +extern "C" { + fn tree_sitter_mint() -> Language; +} + +/// Get the tree-sitter [Language][] for this grammar. +/// +/// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html +pub fn language() -> Language { + unsafe { tree_sitter_mint() } +} + +/// The content of the [`node-types.json`][] file for this grammar. +/// +/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types +pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json"); + +// Uncomment these to include any queries that this grammar contains + +// pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm"); +// pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm"); +// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm"); +// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm"); + +#[cfg(test)] +mod tests { + #[test] + fn test_can_load_grammar() { + let mut parser = tree_sitter::Parser::new(); + parser + .set_language(super::language()) + .expect("Error loading mint language"); + } +} diff --git a/grammar/build/config.gypi b/grammar/build/config.gypi new file mode 100644 index 000000000..f1e6d6378 --- /dev/null +++ b/grammar/build/config.gypi @@ -0,0 +1,95 @@ +# Do not edit. File was generated by node-gyp's "configure" step +{ + "target_defaults": { + "cflags": [], + "default_configuration": "Release", + "defines": [], + "include_dirs": [], + "libraries": [] + }, + "variables": { + "asan": 0, + "build_v8_with_gn": "false", + "coverage": "false", + "dcheck_always_on": 0, + "debug_nghttp2": "false", + "debug_node": "false", + "enable_lto": "false", + "enable_pgo_generate": "false", + "enable_pgo_use": "false", + "force_dynamic_crt": 0, + "gas_version": "2.27", + "host_arch": "x64", + "icu_data_in": "../../deps/icu-small/source/data/in/icudt67l.dat", + "icu_default_data": "", + "icu_endianness": "l", + "icu_gyp_path": "tools/icu/icu-generic.gyp", + "icu_locales": "en,root", + "icu_path": "deps/icu-small", + "icu_small": "true", + "icu_ver_major": "67", + "is_debug": 0, + "llvm_version": "0.0", + "napi_build_version": "6", + "node_byteorder": "little", + "node_debug_lib": "false", + "node_enable_d8": "false", + "node_install_npm": "true", + "node_module_version": 72, + "node_no_browser_globals": "false", + "node_prefix": "/", + "node_release_urlbase": "https://nodejs.org/download/release/", + "node_shared": "false", + "node_shared_brotli": "false", + "node_shared_cares": "false", + "node_shared_http_parser": "false", + "node_shared_libuv": "false", + "node_shared_nghttp2": "false", + "node_shared_openssl": "false", + "node_shared_zlib": "false", + "node_tag": "", + "node_target_type": "executable", + "node_use_bundled_v8": "true", + "node_use_dtrace": "false", + "node_use_etw": "false", + "node_use_node_code_cache": "true", + "node_use_node_snapshot": "true", + "node_use_openssl": "true", + "node_use_v8_platform": "true", + "node_with_ltcg": "false", + "node_without_node_options": "false", + "openssl_fips": "", + "openssl_is_fips": "false", + "shlib_suffix": "so.72", + "target_arch": "x64", + "v8_enable_gdbjit": 0, + "v8_enable_i18n_support": 1, + "v8_enable_inspector": 1, + "v8_enable_lite_mode": 0, + "v8_no_strict_aliasing": 1, + "v8_optimized_debug": 1, + "v8_promise_internal_field_count": 1, + "v8_random_seed": 0, + "v8_trace_maps": 0, + "v8_use_siphash": 1, + "v8_use_snapshot": 1, + "want_separate_host_toolset": 0, + "nodedir": "/home/gdot/.cache/node-gyp/12.18.3", + "standalone_static_library": 1, + "version_commit_hooks": "true", + "user_agent": "yarn/1.22.5 npm/? node/v12.18.3 linux x64", + "bin_links": "true", + "init_version": "1.0.0", + "init_license": "MIT", + "version_tag_prefix": "v", + "prefix": "/home/gdot/.asdf/installs/nodejs/12.18.3/.npm", + "registry": "https://registry.yarnpkg.com", + "ignore_scripts": "", + "version_git_message": "v%s", + "version_git_tag": "true", + "version_git_sign": "", + "strict_ssl": "true", + "save_prefix": "^", + "ignore_optional": "" + } +} diff --git a/grammar/grammar.js b/grammar/grammar.js new file mode 100644 index 000000000..3d6e272d3 --- /dev/null +++ b/grammar/grammar.js @@ -0,0 +1,89 @@ +module.exports = grammar({ + name: 'mint', + rules: { + program: $ => repeat($._top_level), + _top_level: $ => choice( + $.comment, + $.module + ), + comment: $ => token(choice( + seq('//', /.*/), + seq( + '/*', + /[^*]*\*+([^/*][^*]*\*+)*/, + '/' + ) + )), + module: $ => seq( + 'module', + field('name', $.entity_name), + '{', + repeat(choice( + $.comment, + $.function + )), + '}' + ), + function: $ => seq( + 'fun', + field('name', $.variable), + field('arguments', optional($.argument_list)), + field('type', optional($.type_definition)), + '{', + repeat($.statement), + '}' + ), + argument_list: $ => seq( + '(', + commaSep($.argument), + ')' + ), + argument: $ => seq( + field('name', $.variable), + field('type', optional($.type_definition)) + ), + variable: $ => /[a-z][a-zA-Z0-9]*/, + entity_name: $ => seq( + $._entity_part, + optional(repeat(seq('.', $._entity_part))) + ), + _entity_part: $ => /[A-Z][a-zA-Z]+/, + statement: $ => seq( + optional(seq( + field('name', $.variable), + "=" + )), + choice($.inline_javascript, $.module_access) + ), + module_access: $ => seq( + $.entity_name, + ".", + $.variable + ), + inline_javascript: $ => seq( + '`', + /[^`]*/, + '`'), + type_definition: $ => seq( + ':', + $.type + ), + type: $ => choice( + $.variable, + seq( + $._entity_part, + optional(seq( + "(", + commaSep($.type), + ")")) + )) + } +}); + +function commaSep1(rule) { + return seq(rule, repeat(seq(',', rule))); +} + +function commaSep(rule) { + return optional(commaSep1(rule)); +} diff --git a/grammar/package.json b/grammar/package.json new file mode 100644 index 000000000..e5dc2b4da --- /dev/null +++ b/grammar/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "tree-sitter-cli": "^0.20.0" + }, + "main": "bindings/node" +} diff --git a/grammar/src/grammar.json b/grammar/src/grammar.json new file mode 100644 index 000000000..e3698e48e --- /dev/null +++ b/grammar/src/grammar.json @@ -0,0 +1,458 @@ +{ + "name": "mint", + "rules": { + "program": { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_top_level" + } + }, + "_top_level": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "comment" + }, + { + "type": "SYMBOL", + "name": "module" + } + ] + }, + "comment": { + "type": "TOKEN", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "//" + }, + { + "type": "PATTERN", + "value": ".*" + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "/*" + }, + { + "type": "PATTERN", + "value": "[^*]*\\*+([^/*][^*]*\\*+)*" + }, + { + "type": "STRING", + "value": "/" + } + ] + } + ] + } + }, + "module": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "module" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "entity_name" + } + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "comment" + }, + { + "type": "SYMBOL", + "name": "function" + } + ] + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "function": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "fun" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "variable" + } + }, + { + "type": "FIELD", + "name": "arguments", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "argument_list" + }, + { + "type": "BLANK" + } + ] + } + }, + { + "type": "FIELD", + "name": "type", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "type_definition" + }, + { + "type": "BLANK" + } + ] + } + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "statement" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "argument_list": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "argument" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "argument" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "argument": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "variable" + } + }, + { + "type": "FIELD", + "name": "type", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "type_definition" + }, + { + "type": "BLANK" + } + ] + } + } + ] + }, + "variable": { + "type": "PATTERN", + "value": "[a-z][a-zA-Z0-9]*" + }, + "entity_name": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_entity_part" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "." + }, + { + "type": "SYMBOL", + "name": "_entity_part" + } + ] + } + }, + { + "type": "BLANK" + } + ] + } + ] + }, + "_entity_part": { + "type": "PATTERN", + "value": "[A-Z][a-zA-Z]+" + }, + "statement": { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "variable" + } + }, + { + "type": "STRING", + "value": "=" + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "inline_javascript" + }, + { + "type": "SYMBOL", + "name": "module_access" + } + ] + } + ] + }, + "module_access": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "entity_name" + }, + { + "type": "STRING", + "value": "." + }, + { + "type": "SYMBOL", + "name": "variable" + } + ] + }, + "inline_javascript": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "`" + }, + { + "type": "PATTERN", + "value": "[^`]*" + }, + { + "type": "STRING", + "value": "`" + } + ] + }, + "type_definition": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": ":" + }, + { + "type": "SYMBOL", + "name": "type" + } + ] + }, + "type": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_entity_part" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "type" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "type" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + } + ] + } + }, + "extras": [ + { + "type": "PATTERN", + "value": "\\s" + } + ], + "conflicts": [], + "precedences": [], + "externals": [], + "inline": [], + "supertypes": [] +} + diff --git a/grammar/src/node-types.json b/grammar/src/node-types.json new file mode 100644 index 000000000..f52d60c8a --- /dev/null +++ b/grammar/src/node-types.json @@ -0,0 +1,260 @@ +[ + { + "type": "argument", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "variable", + "named": true + } + ] + }, + "type": { + "multiple": false, + "required": false, + "types": [ + { + "type": "type_definition", + "named": true + } + ] + } + } + }, + { + "type": "argument_list", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "argument", + "named": true + } + ] + } + }, + { + "type": "entity_name", + "named": true, + "fields": {} + }, + { + "type": "function", + "named": true, + "fields": { + "arguments": { + "multiple": false, + "required": false, + "types": [ + { + "type": "argument_list", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "variable", + "named": true + } + ] + }, + "type": { + "multiple": false, + "required": false, + "types": [ + { + "type": "type_definition", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "statement", + "named": true + } + ] + } + }, + { + "type": "inline_javascript", + "named": true, + "fields": {} + }, + { + "type": "module", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "entity_name", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "comment", + "named": true + }, + { + "type": "function", + "named": true + } + ] + } + }, + { + "type": "program", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "comment", + "named": true + }, + { + "type": "module", + "named": true + } + ] + } + }, + { + "type": "statement", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": false, + "types": [ + { + "type": "variable", + "named": true + } + ] + } + }, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "inline_javascript", + "named": true + } + ] + } + }, + { + "type": "type", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "type", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "type_definition", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "type", + "named": true + } + ] + } + }, + { + "type": "(", + "named": false + }, + { + "type": ")", + "named": false + }, + { + "type": ",", + "named": false + }, + { + "type": ".", + "named": false + }, + { + "type": ":", + "named": false + }, + { + "type": "=", + "named": false + }, + { + "type": "`", + "named": false + }, + { + "type": "comment", + "named": true + }, + { + "type": "fun", + "named": false + }, + { + "type": "module", + "named": false + }, + { + "type": "variable", + "named": true + }, + { + "type": "{", + "named": false + }, + { + "type": "}", + "named": false + } +] \ No newline at end of file diff --git a/grammar/src/parser.c b/grammar/src/parser.c new file mode 100644 index 000000000..dacd1def6 --- /dev/null +++ b/grammar/src/parser.c @@ -0,0 +1,1209 @@ +#include + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + +#define LANGUAGE_VERSION 13 +#define STATE_COUNT 70 +#define LARGE_STATE_COUNT 2 +#define SYMBOL_COUNT 33 +#define ALIAS_COUNT 0 +#define TOKEN_COUNT 16 +#define EXTERNAL_TOKEN_COUNT 0 +#define FIELD_COUNT 3 +#define MAX_ALIAS_SEQUENCE_LENGTH 7 +#define PRODUCTION_ID_COUNT 7 + +enum { + sym_comment = 1, + anon_sym_module = 2, + anon_sym_LBRACE = 3, + anon_sym_RBRACE = 4, + anon_sym_fun = 5, + anon_sym_LPAREN = 6, + anon_sym_COMMA = 7, + anon_sym_RPAREN = 8, + sym_variable = 9, + anon_sym_DOT = 10, + sym__entity_part = 11, + anon_sym_EQ = 12, + anon_sym_BQUOTE = 13, + aux_sym_inline_javascript_token1 = 14, + anon_sym_COLON = 15, + sym_program = 16, + sym__top_level = 17, + sym_module = 18, + sym_function = 19, + sym_argument_list = 20, + sym_argument = 21, + sym_entity_name = 22, + sym_statement = 23, + sym_inline_javascript = 24, + sym_type_definition = 25, + sym_type = 26, + aux_sym_program_repeat1 = 27, + aux_sym_module_repeat1 = 28, + aux_sym_function_repeat1 = 29, + aux_sym_argument_list_repeat1 = 30, + aux_sym_entity_name_repeat1 = 31, + aux_sym_type_repeat1 = 32, +}; + +static const char * const ts_symbol_names[] = { + [ts_builtin_sym_end] = "end", + [sym_comment] = "comment", + [anon_sym_module] = "module", + [anon_sym_LBRACE] = "{", + [anon_sym_RBRACE] = "}", + [anon_sym_fun] = "fun", + [anon_sym_LPAREN] = "(", + [anon_sym_COMMA] = ",", + [anon_sym_RPAREN] = ")", + [sym_variable] = "variable", + [anon_sym_DOT] = ".", + [sym__entity_part] = "_entity_part", + [anon_sym_EQ] = "=", + [anon_sym_BQUOTE] = "`", + [aux_sym_inline_javascript_token1] = "inline_javascript_token1", + [anon_sym_COLON] = ":", + [sym_program] = "program", + [sym__top_level] = "_top_level", + [sym_module] = "module", + [sym_function] = "function", + [sym_argument_list] = "argument_list", + [sym_argument] = "argument", + [sym_entity_name] = "entity_name", + [sym_statement] = "statement", + [sym_inline_javascript] = "inline_javascript", + [sym_type_definition] = "type_definition", + [sym_type] = "type", + [aux_sym_program_repeat1] = "program_repeat1", + [aux_sym_module_repeat1] = "module_repeat1", + [aux_sym_function_repeat1] = "function_repeat1", + [aux_sym_argument_list_repeat1] = "argument_list_repeat1", + [aux_sym_entity_name_repeat1] = "entity_name_repeat1", + [aux_sym_type_repeat1] = "type_repeat1", +}; + +static const TSSymbol ts_symbol_map[] = { + [ts_builtin_sym_end] = ts_builtin_sym_end, + [sym_comment] = sym_comment, + [anon_sym_module] = anon_sym_module, + [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_RBRACE] = anon_sym_RBRACE, + [anon_sym_fun] = anon_sym_fun, + [anon_sym_LPAREN] = anon_sym_LPAREN, + [anon_sym_COMMA] = anon_sym_COMMA, + [anon_sym_RPAREN] = anon_sym_RPAREN, + [sym_variable] = sym_variable, + [anon_sym_DOT] = anon_sym_DOT, + [sym__entity_part] = sym__entity_part, + [anon_sym_EQ] = anon_sym_EQ, + [anon_sym_BQUOTE] = anon_sym_BQUOTE, + [aux_sym_inline_javascript_token1] = aux_sym_inline_javascript_token1, + [anon_sym_COLON] = anon_sym_COLON, + [sym_program] = sym_program, + [sym__top_level] = sym__top_level, + [sym_module] = sym_module, + [sym_function] = sym_function, + [sym_argument_list] = sym_argument_list, + [sym_argument] = sym_argument, + [sym_entity_name] = sym_entity_name, + [sym_statement] = sym_statement, + [sym_inline_javascript] = sym_inline_javascript, + [sym_type_definition] = sym_type_definition, + [sym_type] = sym_type, + [aux_sym_program_repeat1] = aux_sym_program_repeat1, + [aux_sym_module_repeat1] = aux_sym_module_repeat1, + [aux_sym_function_repeat1] = aux_sym_function_repeat1, + [aux_sym_argument_list_repeat1] = aux_sym_argument_list_repeat1, + [aux_sym_entity_name_repeat1] = aux_sym_entity_name_repeat1, + [aux_sym_type_repeat1] = aux_sym_type_repeat1, +}; + +static const TSSymbolMetadata ts_symbol_metadata[] = { + [ts_builtin_sym_end] = { + .visible = false, + .named = true, + }, + [sym_comment] = { + .visible = true, + .named = true, + }, + [anon_sym_module] = { + .visible = true, + .named = false, + }, + [anon_sym_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_fun] = { + .visible = true, + .named = false, + }, + [anon_sym_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_COMMA] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN] = { + .visible = true, + .named = false, + }, + [sym_variable] = { + .visible = true, + .named = true, + }, + [anon_sym_DOT] = { + .visible = true, + .named = false, + }, + [sym__entity_part] = { + .visible = false, + .named = true, + }, + [anon_sym_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_BQUOTE] = { + .visible = true, + .named = false, + }, + [aux_sym_inline_javascript_token1] = { + .visible = false, + .named = false, + }, + [anon_sym_COLON] = { + .visible = true, + .named = false, + }, + [sym_program] = { + .visible = true, + .named = true, + }, + [sym__top_level] = { + .visible = false, + .named = true, + }, + [sym_module] = { + .visible = true, + .named = true, + }, + [sym_function] = { + .visible = true, + .named = true, + }, + [sym_argument_list] = { + .visible = true, + .named = true, + }, + [sym_argument] = { + .visible = true, + .named = true, + }, + [sym_entity_name] = { + .visible = true, + .named = true, + }, + [sym_statement] = { + .visible = true, + .named = true, + }, + [sym_inline_javascript] = { + .visible = true, + .named = true, + }, + [sym_type_definition] = { + .visible = true, + .named = true, + }, + [sym_type] = { + .visible = true, + .named = true, + }, + [aux_sym_program_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_module_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_function_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_argument_list_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_entity_name_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_type_repeat1] = { + .visible = false, + .named = false, + }, +}; + +enum { + field_arguments = 1, + field_name = 2, + field_type = 3, +}; + +static const char * const ts_field_names[] = { + [0] = NULL, + [field_arguments] = "arguments", + [field_name] = "name", + [field_type] = "type", +}; + +static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { + [1] = {.index = 0, .length = 1}, + [2] = {.index = 1, .length = 1}, + [3] = {.index = 2, .length = 2}, + [4] = {.index = 4, .length = 2}, + [5] = {.index = 6, .length = 2}, + [6] = {.index = 8, .length = 3}, +}; + +static const TSFieldMapEntry ts_field_map_entries[] = { + [0] = + {field_name, 1}, + [1] = + {field_name, 0}, + [2] = + {field_name, 0}, + {field_type, 1}, + [4] = + {field_arguments, 2}, + {field_name, 1}, + [6] = + {field_name, 1}, + {field_type, 2}, + [8] = + {field_arguments, 2}, + {field_name, 1}, + {field_type, 3}, +}; + +static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { + [0] = {0}, +}; + +static const uint16_t ts_non_terminal_alias_map[] = { + 0, +}; + +static bool ts_lex(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (eof) ADVANCE(13); + if (lookahead == '(') ADVANCE(20); + if (lookahead == ')') ADVANCE(22); + if (lookahead == ',') ADVANCE(21); + if (lookahead == '.') ADVANCE(24); + if (lookahead == '/') ADVANCE(2); + if (lookahead == ':') ADVANCE(30); + if (lookahead == '=') ADVANCE(26); + if (lookahead == '`') ADVANCE(27); + if (lookahead == 'f') ADVANCE(10); + if (lookahead == 'm') ADVANCE(9); + if (lookahead == '{') ADVANCE(17); + if (lookahead == '}') ADVANCE(18); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(0) + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(12); + END_STATE(); + case 1: + if (lookahead == ')') ADVANCE(22); + if (lookahead == '`') ADVANCE(27); + if (lookahead == '}') ADVANCE(18); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(1) + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(12); + if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); + END_STATE(); + case 2: + if (lookahead == '*') ADVANCE(4); + if (lookahead == '/') ADVANCE(15); + END_STATE(); + case 3: + if (lookahead == '*') ADVANCE(3); + if (lookahead == '/') ADVANCE(14); + if (lookahead != 0) ADVANCE(4); + END_STATE(); + case 4: + if (lookahead == '*') ADVANCE(3); + if (lookahead != 0) ADVANCE(4); + END_STATE(); + case 5: + if (lookahead == 'd') ADVANCE(11); + END_STATE(); + case 6: + if (lookahead == 'e') ADVANCE(16); + END_STATE(); + case 7: + if (lookahead == 'l') ADVANCE(6); + END_STATE(); + case 8: + if (lookahead == 'n') ADVANCE(19); + END_STATE(); + case 9: + if (lookahead == 'o') ADVANCE(5); + END_STATE(); + case 10: + if (lookahead == 'u') ADVANCE(8); + END_STATE(); + case 11: + if (lookahead == 'u') ADVANCE(7); + END_STATE(); + case 12: + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(25); + END_STATE(); + case 13: + ACCEPT_TOKEN(ts_builtin_sym_end); + END_STATE(); + case 14: + ACCEPT_TOKEN(sym_comment); + END_STATE(); + case 15: + ACCEPT_TOKEN(sym_comment); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(15); + END_STATE(); + case 16: + ACCEPT_TOKEN(anon_sym_module); + END_STATE(); + case 17: + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 18: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 19: + ACCEPT_TOKEN(anon_sym_fun); + END_STATE(); + case 20: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 21: + ACCEPT_TOKEN(anon_sym_COMMA); + END_STATE(); + case 22: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 23: + ACCEPT_TOKEN(sym_variable); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); + END_STATE(); + case 24: + ACCEPT_TOKEN(anon_sym_DOT); + END_STATE(); + case 25: + ACCEPT_TOKEN(sym__entity_part); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(25); + END_STATE(); + case 26: + ACCEPT_TOKEN(anon_sym_EQ); + END_STATE(); + case 27: + ACCEPT_TOKEN(anon_sym_BQUOTE); + END_STATE(); + case 28: + ACCEPT_TOKEN(aux_sym_inline_javascript_token1); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(28); + if (lookahead != 0 && + lookahead != '`') ADVANCE(29); + END_STATE(); + case 29: + ACCEPT_TOKEN(aux_sym_inline_javascript_token1); + if (lookahead != 0 && + lookahead != '`') ADVANCE(29); + END_STATE(); + case 30: + ACCEPT_TOKEN(anon_sym_COLON); + END_STATE(); + default: + return false; + } +} + +static const TSLexMode ts_lex_modes[STATE_COUNT] = { + [0] = {.lex_state = 0}, + [1] = {.lex_state = 0}, + [2] = {.lex_state = 1}, + [3] = {.lex_state = 1}, + [4] = {.lex_state = 1}, + [5] = {.lex_state = 0}, + [6] = {.lex_state = 1}, + [7] = {.lex_state = 1}, + [8] = {.lex_state = 0}, + [9] = {.lex_state = 1}, + [10] = {.lex_state = 1}, + [11] = {.lex_state = 1}, + [12] = {.lex_state = 1}, + [13] = {.lex_state = 0}, + [14] = {.lex_state = 0}, + [15] = {.lex_state = 0}, + [16] = {.lex_state = 0}, + [17] = {.lex_state = 0}, + [18] = {.lex_state = 0}, + [19] = {.lex_state = 1}, + [20] = {.lex_state = 0}, + [21] = {.lex_state = 0}, + [22] = {.lex_state = 1}, + [23] = {.lex_state = 1}, + [24] = {.lex_state = 0}, + [25] = {.lex_state = 0}, + [26] = {.lex_state = 0}, + [27] = {.lex_state = 0}, + [28] = {.lex_state = 0}, + [29] = {.lex_state = 1}, + [30] = {.lex_state = 0}, + [31] = {.lex_state = 0}, + [32] = {.lex_state = 0}, + [33] = {.lex_state = 1}, + [34] = {.lex_state = 0}, + [35] = {.lex_state = 0}, + [36] = {.lex_state = 0}, + [37] = {.lex_state = 0}, + [38] = {.lex_state = 0}, + [39] = {.lex_state = 0}, + [40] = {.lex_state = 0}, + [41] = {.lex_state = 0}, + [42] = {.lex_state = 0}, + [43] = {.lex_state = 1}, + [44] = {.lex_state = 0}, + [45] = {.lex_state = 0}, + [46] = {.lex_state = 0}, + [47] = {.lex_state = 0}, + [48] = {.lex_state = 1}, + [49] = {.lex_state = 0}, + [50] = {.lex_state = 0}, + [51] = {.lex_state = 1}, + [52] = {.lex_state = 0}, + [53] = {.lex_state = 0}, + [54] = {.lex_state = 0}, + [55] = {.lex_state = 0}, + [56] = {.lex_state = 0}, + [57] = {.lex_state = 0}, + [58] = {.lex_state = 0}, + [59] = {.lex_state = 0}, + [60] = {.lex_state = 0}, + [61] = {.lex_state = 0}, + [62] = {.lex_state = 0}, + [63] = {.lex_state = 0}, + [64] = {.lex_state = 0}, + [65] = {.lex_state = 0}, + [66] = {.lex_state = 1}, + [67] = {.lex_state = 28}, + [68] = {.lex_state = 0}, + [69] = {.lex_state = 0}, +}; + +static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { + [0] = { + [ts_builtin_sym_end] = ACTIONS(1), + [sym_comment] = ACTIONS(1), + [anon_sym_module] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), + [anon_sym_fun] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_COMMA] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), + [anon_sym_DOT] = ACTIONS(1), + [sym__entity_part] = ACTIONS(1), + [anon_sym_EQ] = ACTIONS(1), + [anon_sym_BQUOTE] = ACTIONS(1), + [anon_sym_COLON] = ACTIONS(1), + }, + [1] = { + [sym_program] = STATE(65), + [sym__top_level] = STATE(5), + [sym_module] = STATE(5), + [aux_sym_program_repeat1] = STATE(5), + [ts_builtin_sym_end] = ACTIONS(3), + [sym_comment] = ACTIONS(5), + [anon_sym_module] = ACTIONS(7), + }, +}; + +static const uint16_t ts_small_parse_table[] = { + [0] = 5, + ACTIONS(9), 1, + anon_sym_RBRACE, + ACTIONS(11), 1, + sym_variable, + ACTIONS(13), 1, + anon_sym_BQUOTE, + STATE(29), 1, + sym_inline_javascript, + STATE(9), 2, + sym_statement, + aux_sym_function_repeat1, + [17] = 5, + ACTIONS(11), 1, + sym_variable, + ACTIONS(13), 1, + anon_sym_BQUOTE, + ACTIONS(15), 1, + anon_sym_RBRACE, + STATE(29), 1, + sym_inline_javascript, + STATE(9), 2, + sym_statement, + aux_sym_function_repeat1, + [34] = 5, + ACTIONS(11), 1, + sym_variable, + ACTIONS(13), 1, + anon_sym_BQUOTE, + ACTIONS(17), 1, + anon_sym_RBRACE, + STATE(29), 1, + sym_inline_javascript, + STATE(9), 2, + sym_statement, + aux_sym_function_repeat1, + [51] = 4, + ACTIONS(7), 1, + anon_sym_module, + ACTIONS(19), 1, + ts_builtin_sym_end, + ACTIONS(21), 1, + sym_comment, + STATE(8), 3, + sym__top_level, + sym_module, + aux_sym_program_repeat1, + [66] = 5, + ACTIONS(11), 1, + sym_variable, + ACTIONS(13), 1, + anon_sym_BQUOTE, + ACTIONS(23), 1, + anon_sym_RBRACE, + STATE(29), 1, + sym_inline_javascript, + STATE(3), 2, + sym_statement, + aux_sym_function_repeat1, + [83] = 5, + ACTIONS(11), 1, + sym_variable, + ACTIONS(13), 1, + anon_sym_BQUOTE, + ACTIONS(25), 1, + anon_sym_RBRACE, + STATE(29), 1, + sym_inline_javascript, + STATE(9), 2, + sym_statement, + aux_sym_function_repeat1, + [100] = 4, + ACTIONS(27), 1, + ts_builtin_sym_end, + ACTIONS(29), 1, + sym_comment, + ACTIONS(32), 1, + anon_sym_module, + STATE(8), 3, + sym__top_level, + sym_module, + aux_sym_program_repeat1, + [115] = 5, + ACTIONS(35), 1, + anon_sym_RBRACE, + ACTIONS(37), 1, + sym_variable, + ACTIONS(40), 1, + anon_sym_BQUOTE, + STATE(29), 1, + sym_inline_javascript, + STATE(9), 2, + sym_statement, + aux_sym_function_repeat1, + [132] = 5, + ACTIONS(11), 1, + sym_variable, + ACTIONS(13), 1, + anon_sym_BQUOTE, + ACTIONS(43), 1, + anon_sym_RBRACE, + STATE(29), 1, + sym_inline_javascript, + STATE(4), 2, + sym_statement, + aux_sym_function_repeat1, + [149] = 5, + ACTIONS(11), 1, + sym_variable, + ACTIONS(13), 1, + anon_sym_BQUOTE, + ACTIONS(45), 1, + anon_sym_RBRACE, + STATE(29), 1, + sym_inline_javascript, + STATE(7), 2, + sym_statement, + aux_sym_function_repeat1, + [166] = 5, + ACTIONS(11), 1, + sym_variable, + ACTIONS(13), 1, + anon_sym_BQUOTE, + ACTIONS(47), 1, + anon_sym_RBRACE, + STATE(29), 1, + sym_inline_javascript, + STATE(2), 2, + sym_statement, + aux_sym_function_repeat1, + [183] = 4, + ACTIONS(49), 1, + sym_comment, + ACTIONS(51), 1, + anon_sym_RBRACE, + ACTIONS(53), 1, + anon_sym_fun, + STATE(15), 2, + sym_function, + aux_sym_module_repeat1, + [197] = 4, + ACTIONS(55), 1, + sym_comment, + ACTIONS(58), 1, + anon_sym_RBRACE, + ACTIONS(60), 1, + anon_sym_fun, + STATE(14), 2, + sym_function, + aux_sym_module_repeat1, + [211] = 4, + ACTIONS(53), 1, + anon_sym_fun, + ACTIONS(63), 1, + sym_comment, + ACTIONS(65), 1, + anon_sym_RBRACE, + STATE(14), 2, + sym_function, + aux_sym_module_repeat1, + [225] = 5, + ACTIONS(67), 1, + anon_sym_LBRACE, + ACTIONS(69), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_COLON, + STATE(44), 1, + sym_argument_list, + STATE(69), 1, + sym_type_definition, + [241] = 2, + ACTIONS(75), 1, + anon_sym_LPAREN, + ACTIONS(73), 3, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RPAREN, + [250] = 3, + ACTIONS(71), 1, + anon_sym_COLON, + STATE(54), 1, + sym_type_definition, + ACTIONS(77), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [261] = 4, + ACTIONS(79), 1, + anon_sym_RPAREN, + ACTIONS(81), 1, + sym_variable, + ACTIONS(83), 1, + sym__entity_part, + STATE(38), 1, + sym_type, + [274] = 1, + ACTIONS(85), 3, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RPAREN, + [280] = 1, + ACTIONS(87), 3, + ts_builtin_sym_end, + sym_comment, + anon_sym_module, + [286] = 3, + ACTIONS(89), 1, + anon_sym_RPAREN, + ACTIONS(91), 1, + sym_variable, + STATE(31), 1, + sym_argument, + [296] = 3, + ACTIONS(81), 1, + sym_variable, + ACTIONS(83), 1, + sym__entity_part, + STATE(46), 1, + sym_type, + [306] = 3, + ACTIONS(93), 1, + anon_sym_COMMA, + ACTIONS(96), 1, + anon_sym_RPAREN, + STATE(24), 1, + aux_sym_type_repeat1, + [316] = 1, + ACTIONS(98), 3, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RPAREN, + [322] = 1, + ACTIONS(100), 3, + sym_comment, + anon_sym_RBRACE, + anon_sym_fun, + [328] = 1, + ACTIONS(102), 3, + sym_comment, + anon_sym_RBRACE, + anon_sym_fun, + [334] = 3, + ACTIONS(104), 1, + anon_sym_COMMA, + ACTIONS(106), 1, + anon_sym_RPAREN, + STATE(24), 1, + aux_sym_type_repeat1, + [344] = 1, + ACTIONS(108), 3, + anon_sym_RBRACE, + sym_variable, + anon_sym_BQUOTE, + [350] = 1, + ACTIONS(110), 3, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RPAREN, + [356] = 3, + ACTIONS(112), 1, + anon_sym_COMMA, + ACTIONS(114), 1, + anon_sym_RPAREN, + STATE(34), 1, + aux_sym_argument_list_repeat1, + [366] = 1, + ACTIONS(73), 3, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RPAREN, + [372] = 3, + ACTIONS(81), 1, + sym_variable, + ACTIONS(83), 1, + sym__entity_part, + STATE(59), 1, + sym_type, + [382] = 3, + ACTIONS(112), 1, + anon_sym_COMMA, + ACTIONS(116), 1, + anon_sym_RPAREN, + STATE(42), 1, + aux_sym_argument_list_repeat1, + [392] = 3, + ACTIONS(118), 1, + anon_sym_LBRACE, + ACTIONS(120), 1, + anon_sym_DOT, + STATE(35), 1, + aux_sym_entity_name_repeat1, + [402] = 1, + ACTIONS(123), 3, + sym_comment, + anon_sym_RBRACE, + anon_sym_fun, + [408] = 1, + ACTIONS(125), 3, + sym_comment, + anon_sym_RBRACE, + anon_sym_fun, + [414] = 3, + ACTIONS(104), 1, + anon_sym_COMMA, + ACTIONS(127), 1, + anon_sym_RPAREN, + STATE(28), 1, + aux_sym_type_repeat1, + [424] = 1, + ACTIONS(129), 3, + ts_builtin_sym_end, + sym_comment, + anon_sym_module, + [430] = 1, + ACTIONS(131), 3, + sym_comment, + anon_sym_RBRACE, + anon_sym_fun, + [436] = 3, + ACTIONS(133), 1, + anon_sym_LBRACE, + ACTIONS(135), 1, + anon_sym_DOT, + STATE(35), 1, + aux_sym_entity_name_repeat1, + [446] = 3, + ACTIONS(137), 1, + anon_sym_COMMA, + ACTIONS(140), 1, + anon_sym_RPAREN, + STATE(42), 1, + aux_sym_argument_list_repeat1, + [456] = 1, + ACTIONS(142), 3, + anon_sym_RBRACE, + sym_variable, + anon_sym_BQUOTE, + [462] = 3, + ACTIONS(71), 1, + anon_sym_COLON, + ACTIONS(144), 1, + anon_sym_LBRACE, + STATE(64), 1, + sym_type_definition, + [472] = 1, + ACTIONS(146), 3, + sym_comment, + anon_sym_RBRACE, + anon_sym_fun, + [478] = 1, + ACTIONS(148), 3, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RPAREN, + [484] = 1, + ACTIONS(150), 3, + sym_comment, + anon_sym_RBRACE, + anon_sym_fun, + [490] = 1, + ACTIONS(152), 3, + anon_sym_RBRACE, + sym_variable, + anon_sym_BQUOTE, + [496] = 3, + ACTIONS(135), 1, + anon_sym_DOT, + ACTIONS(154), 1, + anon_sym_LBRACE, + STATE(41), 1, + aux_sym_entity_name_repeat1, + [506] = 1, + ACTIONS(156), 3, + sym_comment, + anon_sym_RBRACE, + anon_sym_fun, + [512] = 2, + ACTIONS(91), 1, + sym_variable, + STATE(52), 1, + sym_argument, + [519] = 1, + ACTIONS(140), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [524] = 1, + ACTIONS(158), 2, + anon_sym_LBRACE, + anon_sym_COLON, + [529] = 1, + ACTIONS(160), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [534] = 2, + ACTIONS(13), 1, + anon_sym_BQUOTE, + STATE(48), 1, + sym_inline_javascript, + [541] = 1, + ACTIONS(118), 2, + anon_sym_LBRACE, + anon_sym_DOT, + [546] = 2, + ACTIONS(162), 1, + sym__entity_part, + STATE(61), 1, + sym_entity_name, + [553] = 1, + ACTIONS(164), 2, + anon_sym_LBRACE, + anon_sym_COLON, + [558] = 1, + ACTIONS(96), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [563] = 1, + ACTIONS(166), 2, + anon_sym_LBRACE, + anon_sym_COLON, + [568] = 1, + ACTIONS(168), 1, + anon_sym_LBRACE, + [572] = 1, + ACTIONS(170), 1, + sym__entity_part, + [576] = 1, + ACTIONS(172), 1, + anon_sym_BQUOTE, + [580] = 1, + ACTIONS(174), 1, + anon_sym_LBRACE, + [584] = 1, + ACTIONS(176), 1, + ts_builtin_sym_end, + [588] = 1, + ACTIONS(178), 1, + sym_variable, + [592] = 1, + ACTIONS(180), 1, + aux_sym_inline_javascript_token1, + [596] = 1, + ACTIONS(182), 1, + anon_sym_EQ, + [600] = 1, + ACTIONS(184), 1, + anon_sym_LBRACE, +}; + +static const uint32_t ts_small_parse_table_map[] = { + [SMALL_STATE(2)] = 0, + [SMALL_STATE(3)] = 17, + [SMALL_STATE(4)] = 34, + [SMALL_STATE(5)] = 51, + [SMALL_STATE(6)] = 66, + [SMALL_STATE(7)] = 83, + [SMALL_STATE(8)] = 100, + [SMALL_STATE(9)] = 115, + [SMALL_STATE(10)] = 132, + [SMALL_STATE(11)] = 149, + [SMALL_STATE(12)] = 166, + [SMALL_STATE(13)] = 183, + [SMALL_STATE(14)] = 197, + [SMALL_STATE(15)] = 211, + [SMALL_STATE(16)] = 225, + [SMALL_STATE(17)] = 241, + [SMALL_STATE(18)] = 250, + [SMALL_STATE(19)] = 261, + [SMALL_STATE(20)] = 274, + [SMALL_STATE(21)] = 280, + [SMALL_STATE(22)] = 286, + [SMALL_STATE(23)] = 296, + [SMALL_STATE(24)] = 306, + [SMALL_STATE(25)] = 316, + [SMALL_STATE(26)] = 322, + [SMALL_STATE(27)] = 328, + [SMALL_STATE(28)] = 334, + [SMALL_STATE(29)] = 344, + [SMALL_STATE(30)] = 350, + [SMALL_STATE(31)] = 356, + [SMALL_STATE(32)] = 366, + [SMALL_STATE(33)] = 372, + [SMALL_STATE(34)] = 382, + [SMALL_STATE(35)] = 392, + [SMALL_STATE(36)] = 402, + [SMALL_STATE(37)] = 408, + [SMALL_STATE(38)] = 414, + [SMALL_STATE(39)] = 424, + [SMALL_STATE(40)] = 430, + [SMALL_STATE(41)] = 436, + [SMALL_STATE(42)] = 446, + [SMALL_STATE(43)] = 456, + [SMALL_STATE(44)] = 462, + [SMALL_STATE(45)] = 472, + [SMALL_STATE(46)] = 478, + [SMALL_STATE(47)] = 484, + [SMALL_STATE(48)] = 490, + [SMALL_STATE(49)] = 496, + [SMALL_STATE(50)] = 506, + [SMALL_STATE(51)] = 512, + [SMALL_STATE(52)] = 519, + [SMALL_STATE(53)] = 524, + [SMALL_STATE(54)] = 529, + [SMALL_STATE(55)] = 534, + [SMALL_STATE(56)] = 541, + [SMALL_STATE(57)] = 546, + [SMALL_STATE(58)] = 553, + [SMALL_STATE(59)] = 558, + [SMALL_STATE(60)] = 563, + [SMALL_STATE(61)] = 568, + [SMALL_STATE(62)] = 572, + [SMALL_STATE(63)] = 576, + [SMALL_STATE(64)] = 580, + [SMALL_STATE(65)] = 584, + [SMALL_STATE(66)] = 588, + [SMALL_STATE(67)] = 592, + [SMALL_STATE(68)] = 596, + [SMALL_STATE(69)] = 600, +}; + +static const TSParseActionEntry ts_parse_actions[] = { + [0] = {.entry = {.count = 0, .reusable = false}}, + [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), + [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 0), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), + [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 1), + [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [27] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), + [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(8), + [32] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(57), + [35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), + [37] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(68), + [40] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(67), + [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), + [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), + [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [55] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), SHIFT_REPEAT(14), + [58] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), + [60] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), SHIFT_REPEAT(66), + [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), + [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 1), + [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument, 1, .production_id = 2), + [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [83] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 3), + [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 4, .production_id = 1), + [89] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), + [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [93] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_type_repeat1, 2), SHIFT_REPEAT(33), + [96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_type_repeat1, 2), + [98] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 5), + [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 4, .production_id = 1), + [102] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 7, .production_id = 6), + [104] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), + [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [108] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 1), + [110] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 4), + [112] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), + [114] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), + [116] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_entity_name_repeat1, 2), + [120] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_entity_name_repeat1, 2), SHIFT_REPEAT(62), + [123] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 6), + [125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 4), + [127] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 5, .production_id = 1), + [131] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 1), + [133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_entity_name, 2), + [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), + [137] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_argument_list_repeat1, 2), SHIFT_REPEAT(51), + [140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_argument_list_repeat1, 2), + [142] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_inline_javascript, 3), + [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [146] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 5), + [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_definition, 2), + [150] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 4), + [152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 3, .production_id = 2), + [154] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_entity_name, 1), + [156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 5), + [158] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 4), + [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument, 2, .production_id = 3), + [162] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [164] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 2), + [166] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 3), + [168] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [170] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), + [174] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [176] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [178] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [180] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), + [182] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), + [184] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), +}; + +#ifdef __cplusplus +extern "C" { +#endif +#ifdef _WIN32 +#define extern __declspec(dllexport) +#endif + +extern const TSLanguage *tree_sitter_mint(void) { + static const TSLanguage language = { + .version = LANGUAGE_VERSION, + .symbol_count = SYMBOL_COUNT, + .alias_count = ALIAS_COUNT, + .token_count = TOKEN_COUNT, + .external_token_count = EXTERNAL_TOKEN_COUNT, + .state_count = STATE_COUNT, + .large_state_count = LARGE_STATE_COUNT, + .production_id_count = PRODUCTION_ID_COUNT, + .field_count = FIELD_COUNT, + .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, + .parse_table = &ts_parse_table[0][0], + .small_parse_table = ts_small_parse_table, + .small_parse_table_map = ts_small_parse_table_map, + .parse_actions = ts_parse_actions, + .symbol_names = ts_symbol_names, + .field_names = ts_field_names, + .field_map_slices = ts_field_map_slices, + .field_map_entries = ts_field_map_entries, + .symbol_metadata = ts_symbol_metadata, + .public_symbol_map = ts_symbol_map, + .alias_map = ts_non_terminal_alias_map, + .alias_sequences = &ts_alias_sequences[0][0], + .lex_modes = ts_lex_modes, + .lex_fn = ts_lex, + }; + return &language; +} +#ifdef __cplusplus +} +#endif diff --git a/grammar/src/tree_sitter/parser.h b/grammar/src/tree_sitter/parser.h new file mode 100644 index 000000000..cbbc7b4ee --- /dev/null +++ b/grammar/src/tree_sitter/parser.h @@ -0,0 +1,223 @@ +#ifndef TREE_SITTER_PARSER_H_ +#define TREE_SITTER_PARSER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#define ts_builtin_sym_error ((TSSymbol)-1) +#define ts_builtin_sym_end 0 +#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 + +typedef uint16_t TSStateId; + +#ifndef TREE_SITTER_API_H_ +typedef uint16_t TSSymbol; +typedef uint16_t TSFieldId; +typedef struct TSLanguage TSLanguage; +#endif + +typedef struct { + TSFieldId field_id; + uint8_t child_index; + bool inherited; +} TSFieldMapEntry; + +typedef struct { + uint16_t index; + uint16_t length; +} TSFieldMapSlice; + +typedef struct { + bool visible; + bool named; + bool supertype; +} TSSymbolMetadata; + +typedef struct TSLexer TSLexer; + +struct TSLexer { + int32_t lookahead; + TSSymbol result_symbol; + void (*advance)(TSLexer *, bool); + void (*mark_end)(TSLexer *); + uint32_t (*get_column)(TSLexer *); + bool (*is_at_included_range_start)(const TSLexer *); + bool (*eof)(const TSLexer *); +}; + +typedef enum { + TSParseActionTypeShift, + TSParseActionTypeReduce, + TSParseActionTypeAccept, + TSParseActionTypeRecover, +} TSParseActionType; + +typedef union { + struct { + uint8_t type; + TSStateId state; + bool extra; + bool repetition; + } shift; + struct { + uint8_t type; + uint8_t child_count; + TSSymbol symbol; + int16_t dynamic_precedence; + uint16_t production_id; + } reduce; + uint8_t type; +} TSParseAction; + +typedef struct { + uint16_t lex_state; + uint16_t external_lex_state; +} TSLexMode; + +typedef union { + TSParseAction action; + struct { + uint8_t count; + bool reusable; + } entry; +} TSParseActionEntry; + +struct TSLanguage { + uint32_t version; + uint32_t symbol_count; + uint32_t alias_count; + uint32_t token_count; + uint32_t external_token_count; + uint32_t state_count; + uint32_t large_state_count; + uint32_t production_id_count; + uint32_t field_count; + uint16_t max_alias_sequence_length; + const uint16_t *parse_table; + const uint16_t *small_parse_table; + const uint32_t *small_parse_table_map; + const TSParseActionEntry *parse_actions; + const char * const *symbol_names; + const char * const *field_names; + const TSFieldMapSlice *field_map_slices; + const TSFieldMapEntry *field_map_entries; + const TSSymbolMetadata *symbol_metadata; + const TSSymbol *public_symbol_map; + const uint16_t *alias_map; + const TSSymbol *alias_sequences; + const TSLexMode *lex_modes; + bool (*lex_fn)(TSLexer *, TSStateId); + bool (*keyword_lex_fn)(TSLexer *, TSStateId); + TSSymbol keyword_capture_token; + struct { + const bool *states; + const TSSymbol *symbol_map; + void *(*create)(void); + void (*destroy)(void *); + bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist); + unsigned (*serialize)(void *, char *); + void (*deserialize)(void *, const char *, unsigned); + } external_scanner; +}; + +/* + * Lexer Macros + */ + +#define START_LEXER() \ + bool result = false; \ + bool skip = false; \ + bool eof = false; \ + int32_t lookahead; \ + goto start; \ + next_state: \ + lexer->advance(lexer, skip); \ + start: \ + skip = false; \ + lookahead = lexer->lookahead; + +#define ADVANCE(state_value) \ + { \ + state = state_value; \ + goto next_state; \ + } + +#define SKIP(state_value) \ + { \ + skip = true; \ + state = state_value; \ + goto next_state; \ + } + +#define ACCEPT_TOKEN(symbol_value) \ + result = true; \ + lexer->result_symbol = symbol_value; \ + lexer->mark_end(lexer); + +#define END_STATE() return result; + +/* + * Parse Table Macros + */ + +#define SMALL_STATE(id) id - LARGE_STATE_COUNT + +#define STATE(id) id + +#define ACTIONS(id) id + +#define SHIFT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = state_value \ + } \ + }} + +#define SHIFT_REPEAT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = state_value, \ + .repetition = true \ + } \ + }} + +#define SHIFT_EXTRA() \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .extra = true \ + } \ + }} + +#define REDUCE(symbol_val, child_count_val, ...) \ + {{ \ + .reduce = { \ + .type = TSParseActionTypeReduce, \ + .symbol = symbol_val, \ + .child_count = child_count_val, \ + __VA_ARGS__ \ + }, \ + }} + +#define RECOVER() \ + {{ \ + .type = TSParseActionTypeRecover \ + }} + +#define ACCEPT_INPUT() \ + {{ \ + .type = TSParseActionTypeAccept \ + }} + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_PARSER_H_ diff --git a/grammar/test/corpus/type.txt b/grammar/test/corpus/type.txt new file mode 100644 index 000000000..8e537cd2e --- /dev/null +++ b/grammar/test/corpus/type.txt @@ -0,0 +1,22 @@ +======================= +Type with type variable +======================= + +module Test { + fun type : Type(a) { + `` + } +} + +--- + +(program + (module + (entity_name) + (function + (variable) + (type_definition + (type + (type + (variable)))) + (statement (inline_javascript))))) diff --git a/grammar/yarn.lock b/grammar/yarn.lock new file mode 100644 index 000000000..e3d8430a3 --- /dev/null +++ b/grammar/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +tree-sitter-cli@^0.20.0: + version "0.20.0" + resolved "https://registry.yarnpkg.com/tree-sitter-cli/-/tree-sitter-cli-0.20.0.tgz#feaaa11c7ecf44a6e236aa1e2963b85d045d33cc" + integrity sha512-4D1qapWbJXZ5rrSUGM5rcw5Vuq/smzn9KbiFRhlON6KeuuXjra+KAtDYVrDgAoLIG4ku+jbEEGrJxCptUGi3dg== From d4f24fa233900d84ac9a34687eddda9ce21aef3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guszt=C3=A1v=20Szikszai?= Date: Thu, 25 Nov 2021 06:59:07 +0100 Subject: [PATCH 20/20] Parses core successfully. --- grammar/.tool-versions | 1 + grammar/Taskfile | 19 + grammar/build/Makefile | 324 + .../tree_sitter_mint_binding.node.d | 1 + .../bindings/node/binding.o.d | 71 + .../tree_sitter_mint_binding/src/parser.o.d | 5 + .../Release/tree_sitter_mint_binding.node.d | 1 + .../obj.target/tree_sitter_mint_binding.node | Bin 0 -> 23624 bytes .../bindings/node/binding.o | Bin 0 -> 7736 bytes .../tree_sitter_mint_binding/src/parser.o | Bin 0 -> 10928 bytes .../Release/tree_sitter_mint_binding.node | Bin 0 -> 23624 bytes grammar/build/binding.Makefile | 6 + grammar/build/config.gypi | 291 +- .../build/tree_sitter_mint_binding.target.mk | 175 + grammar/grammar.js | 317 +- grammar/package.json | 3 +- grammar/src/grammar.json | 2120 ++- grammar/src/node-types.json | 2472 ++- grammar/src/parser.c | 13120 +++++++++++++++- grammar/src/scanner.c | 73 + grammar/test/corpus/call-in-call.txt | 27 + grammar/test/corpus/type.txt | 1 + grammar/yarn.lock | 13 +- 23 files changed, 18022 insertions(+), 1018 deletions(-) create mode 100644 grammar/.tool-versions create mode 100755 grammar/Taskfile create mode 100644 grammar/build/Makefile create mode 100644 grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding.node.d create mode 100644 grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o.d create mode 100644 grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding/src/parser.o.d create mode 100644 grammar/build/Release/.deps/Release/tree_sitter_mint_binding.node.d create mode 100755 grammar/build/Release/obj.target/tree_sitter_mint_binding.node create mode 100644 grammar/build/Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o create mode 100644 grammar/build/Release/obj.target/tree_sitter_mint_binding/src/parser.o create mode 100755 grammar/build/Release/tree_sitter_mint_binding.node create mode 100644 grammar/build/binding.Makefile create mode 100644 grammar/build/tree_sitter_mint_binding.target.mk create mode 100644 grammar/src/scanner.c create mode 100644 grammar/test/corpus/call-in-call.txt diff --git a/grammar/.tool-versions b/grammar/.tool-versions new file mode 100644 index 000000000..a3a6ae685 --- /dev/null +++ b/grammar/.tool-versions @@ -0,0 +1 @@ +nodejs 16.6.2 diff --git a/grammar/Taskfile b/grammar/Taskfile new file mode 100755 index 000000000..e63e03a5c --- /dev/null +++ b/grammar/Taskfile @@ -0,0 +1,19 @@ +#!/bin/bash +PATH=./node_modules/.bin:$PATH + +function test { + yarn tree-sitter generate && yarn tree-sitter parse $1 +} + +function test-all { + tree-sitter generate && yarn tree-sitter parse "../core/source/*.mint" --quiet --stat +} + +function help { + echo "$0 " + echo "Tasks:" + compgen -A function | cat -n +} + +TIMEFORMAT="Task completed in %3lR" +time ${@:-default} diff --git a/grammar/build/Makefile b/grammar/build/Makefile new file mode 100644 index 000000000..4c94fff24 --- /dev/null +++ b/grammar/build/Makefile @@ -0,0 +1,324 @@ +# We borrow heavily from the kernel build setup, though we are simpler since +# we don't have Kconfig tweaking settings on us. + +# The implicit make rules have it looking for RCS files, among other things. +# We instead explicitly write all the rules we care about. +# It's even quicker (saves ~200ms) to pass -r on the command line. +MAKEFLAGS=-r + +# The source directory tree. +srcdir := .. +abs_srcdir := $(abspath $(srcdir)) + +# The name of the builddir. +builddir_name ?= . + +# The V=1 flag on command line makes us verbosely print command lines. +ifdef V + quiet= +else + quiet=quiet_ +endif + +# Specify BUILDTYPE=Release on the command line for a release build. +BUILDTYPE ?= Release + +# Directory all our build output goes into. +# Note that this must be two directories beneath src/ for unit tests to pass, +# as they reach into the src/ directory for data with relative paths. +builddir ?= $(builddir_name)/$(BUILDTYPE) +abs_builddir := $(abspath $(builddir)) +depsdir := $(builddir)/.deps + +# Object output directory. +obj := $(builddir)/obj +abs_obj := $(abspath $(obj)) + +# We build up a list of every single one of the targets so we can slurp in the +# generated dependency rule Makefiles in one pass. +all_deps := + + + +CC.target ?= $(CC) +CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) +CXX.target ?= $(CXX) +CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) +LINK.target ?= $(LINK) +LDFLAGS.target ?= $(LDFLAGS) +AR.target ?= $(AR) + +# C++ apps need to be linked with g++. +LINK ?= $(CXX.target) + +# TODO(evan): move all cross-compilation logic to gyp-time so we don't need +# to replicate this environment fallback in make as well. +CC.host ?= gcc +CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) +CXX.host ?= g++ +CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) +LINK.host ?= $(CXX.host) +LDFLAGS.host ?= +AR.host ?= ar + +# Define a dir function that can handle spaces. +# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions +# "leading spaces cannot appear in the text of the first argument as written. +# These characters can be put into the argument value by variable substitution." +empty := +space := $(empty) $(empty) + +# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces +replace_spaces = $(subst $(space),?,$1) +unreplace_spaces = $(subst ?,$(space),$1) +dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) + +# Flags to make gcc output dependency info. Note that you need to be +# careful here to use the flags that ccache and distcc can understand. +# We write to a dep file on the side first and then rename at the end +# so we can't end up with a broken dep file. +depfile = $(depsdir)/$(call replace_spaces,$@).d +DEPFLAGS = -MMD -MF $(depfile).raw + +# We have to fixup the deps output in a few ways. +# (1) the file output should mention the proper .o file. +# ccache or distcc lose the path to the target, so we convert a rule of +# the form: +# foobar.o: DEP1 DEP2 +# into +# path/to/foobar.o: DEP1 DEP2 +# (2) we want missing files not to cause us to fail to build. +# We want to rewrite +# foobar.o: DEP1 DEP2 \ +# DEP3 +# to +# DEP1: +# DEP2: +# DEP3: +# so if the files are missing, they're just considered phony rules. +# We have to do some pretty insane escaping to get those backslashes +# and dollar signs past make, the shell, and sed at the same time. +# Doesn't work with spaces, but that's fine: .d files have spaces in +# their names replaced with other characters. +define fixup_dep +# The depfile may not exist if the input file didn't have any #includes. +touch $(depfile).raw +# Fixup path as in (1). +sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) +# Add extra rules as in (2). +# We remove slashes and replace spaces with new lines; +# remove blank lines; +# delete the first line and append a colon to the remaining lines. +sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ + grep -v '^$$' |\ + sed -e 1d -e 's|$$|:|' \ + >> $(depfile) +rm $(depfile).raw +endef + +# Command definitions: +# - cmd_foo is the actual command to run; +# - quiet_cmd_foo is the brief-output summary of the command. + +quiet_cmd_cc = CC($(TOOLSET)) $@ +cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c + +quiet_cmd_cxx = CXX($(TOOLSET)) $@ +cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c + +quiet_cmd_touch = TOUCH $@ +cmd_touch = touch $@ + +quiet_cmd_copy = COPY $@ +# send stderr to /dev/null to ignore messages when linking directories. +cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@") + +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) + +# Due to circular dependencies between libraries :(, we wrap the +# special "figure out circular dependencies" flags around the entire +# input list during linking. +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group + +# We support two kinds of shared objects (.so): +# 1) shared_library, which is just bundling together many dependent libraries +# into a link line. +# 2) loadable_module, which is generating a module intended for dlopen(). +# +# They differ only slightly: +# In the former case, we want to package all dependent code into the .so. +# In the latter case, we want to package just the API exposed by the +# outermost module. +# This means shared_library uses --whole-archive, while loadable_module doesn't. +# (Note that --whole-archive is incompatible with the --start-group used in +# normal linking.) + +# Other shared-object link notes: +# - Set SONAME to the library filename so our binaries don't reference +# the local, absolute paths used on the link command-line. +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) + + +# Define an escape_quotes function to escape single quotes. +# This allows us to handle quotes properly as long as we always use +# use single quotes and escape_quotes. +escape_quotes = $(subst ','\'',$(1)) +# This comment is here just to include a ' to unconfuse syntax highlighting. +# Define an escape_vars function to escape '$' variable syntax. +# This allows us to read/write command lines with shell variables (e.g. +# $LD_LIBRARY_PATH), without triggering make substitution. +escape_vars = $(subst $$,$$$$,$(1)) +# Helper that expands to a shell command to echo a string exactly as it is in +# make. This uses printf instead of echo because printf's behaviour with respect +# to escape sequences is more portable than echo's across different shells +# (e.g., dash, bash). +exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' + +# Helper to compare the command we're about to run against the command +# we logged the last time we ran the command. Produces an empty +# string (false) when the commands match. +# Tricky point: Make has no string-equality test function. +# The kernel uses the following, but it seems like it would have false +# positives, where one string reordered its arguments. +# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ +# $(filter-out $(cmd_$@), $(cmd_$(1)))) +# We instead substitute each for the empty string into the other, and +# say they're equal if both substitutions produce the empty string. +# .d files contain ? instead of spaces, take that into account. +command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ + $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) + +# Helper that is non-empty when a prerequisite changes. +# Normally make does this implicitly, but we force rules to always run +# so we can check their command lines. +# $? -- new prerequisites +# $| -- order-only dependencies +prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) + +# Helper that executes all postbuilds until one fails. +define do_postbuilds + @E=0;\ + for p in $(POSTBUILDS); do\ + eval $$p;\ + E=$$?;\ + if [ $$E -ne 0 ]; then\ + break;\ + fi;\ + done;\ + if [ $$E -ne 0 ]; then\ + rm -rf "$@";\ + exit $$E;\ + fi +endef + +# do_cmd: run a command via the above cmd_foo names, if necessary. +# Should always run for a given target to handle command-line changes. +# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. +# Third argument, if non-zero, makes it do POSTBUILDS processing. +# Note: We intentionally do NOT call dirx for depfile, since it contains ? for +# spaces already and dirx strips the ? characters. +define do_cmd +$(if $(or $(command_changed),$(prereq_changed)), + @$(call exact_echo, $($(quiet)cmd_$(1))) + @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" + $(if $(findstring flock,$(word 1,$(cmd_$1))), + @$(cmd_$(1)) + @echo " $(quiet_cmd_$(1)): Finished", + @$(cmd_$(1)) + ) + @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) + @$(if $(2),$(fixup_dep)) + $(if $(and $(3), $(POSTBUILDS)), + $(call do_postbuilds) + ) +) +endef + +# Declare the "all" target first so it is the default, +# even though we don't have the deps yet. +.PHONY: all +all: + +# make looks for ways to re-generate included makefiles, but in our case, we +# don't have a direct way. Explicitly telling make that it has nothing to do +# for them makes it go faster. +%.d: ; + +# Use FORCE_DO_CMD to force a target to run. Should be coupled with +# do_cmd. +.PHONY: FORCE_DO_CMD +FORCE_DO_CMD: + +TOOLSET := target +# Suffix rules, putting all outputs into $(obj). +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) + +# Try building from generated source, too. +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) + +$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) + + +ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ + $(findstring $(join ^,$(prefix)),\ + $(join ^,tree_sitter_mint_binding.target.mk)))),) + include tree_sitter_mint_binding.target.mk +endif + +quiet_cmd_regen_makefile = ACTION Regenerating $@ +cmd_regen_makefile = cd $(srcdir); /home/gdot/.asdf/installs/nodejs/16.6.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/gdot/.cache/node-gyp/16.6.2" "-Dnode_gyp_dir=/home/gdot/.asdf/installs/nodejs/16.6.2/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/home/gdot/.cache/node-gyp/16.6.2/<(target_arch)/node.lib" "-Dmodule_root_dir=/home/gdot/Projects/mint-lang/mint/grammar" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/home/gdot/Projects/mint-lang/mint/grammar/build/config.gypi -I/home/gdot/.asdf/installs/nodejs/16.6.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/home/gdot/.cache/node-gyp/16.6.2/include/node/common.gypi "--toplevel-dir=." binding.gyp +Makefile: $(srcdir)/binding.gyp $(srcdir)/build/config.gypi $(srcdir)/../../../../.asdf/installs/nodejs/16.6.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../.cache/node-gyp/16.6.2/include/node/common.gypi + $(call do_cmd,regen_makefile) + +# "all" is a concatenation of the "all" targets from all the included +# sub-makefiles. This is just here to clarify. +all: + +# Add in dependency-tracking rules. $(all_deps) is the list of every single +# target in our tree. Only consider the ones with .d (dependency) info: +d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) +ifneq ($(d_files),) + include $(d_files) +endif diff --git a/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding.node.d b/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding.node.d new file mode 100644 index 000000000..1525b7638 --- /dev/null +++ b/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding.node.d @@ -0,0 +1 @@ +cmd_Release/obj.target/tree_sitter_mint_binding.node := g++ -o Release/obj.target/tree_sitter_mint_binding.node -shared -pthread -rdynamic -m64 -Wl,-soname=tree_sitter_mint_binding.node -Wl,--start-group Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o Release/obj.target/tree_sitter_mint_binding/src/parser.o -Wl,--end-group diff --git a/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o.d b/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o.d new file mode 100644 index 000000000..4c94a27b6 --- /dev/null +++ b/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o.d @@ -0,0 +1,71 @@ +cmd_Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o := g++ -o Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o ../bindings/node/binding.cc '-DNODE_GYP_MODULE_NAME=tree_sitter_mint_binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/home/gdot/.cache/node-gyp/16.6.2/include/node -I/home/gdot/.cache/node-gyp/16.6.2/src -I/home/gdot/.cache/node-gyp/16.6.2/deps/openssl/config -I/home/gdot/.cache/node-gyp/16.6.2/deps/openssl/openssl/include -I/home/gdot/.cache/node-gyp/16.6.2/deps/uv/include -I/home/gdot/.cache/node-gyp/16.6.2/deps/zlib -I/home/gdot/.cache/node-gyp/16.6.2/deps/v8/include -I../node_modules/nan -I../src -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++14 -MMD -MF ./Release/.deps/Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o.d.raw -c +Release/obj.target/tree_sitter_mint_binding/bindings/node/binding.o: \ + ../bindings/node/binding.cc ../src/tree_sitter/parser.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/node.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/v8.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/cppgc/common.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/v8config.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/v8-internal.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/v8-version.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/v8config.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/v8-platform.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/node_version.h \ + ../node_modules/nan/nan.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/node_version.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/uv.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/uv/errno.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/uv/version.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/uv/unix.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/uv/threadpool.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/uv/linux.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/node_buffer.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/node.h \ + /home/gdot/.cache/node-gyp/16.6.2/include/node/node_object_wrap.h \ + ../node_modules/nan/nan_callbacks.h \ + ../node_modules/nan/nan_callbacks_12_inl.h \ + ../node_modules/nan/nan_maybe_43_inl.h \ + ../node_modules/nan/nan_converters.h \ + ../node_modules/nan/nan_converters_43_inl.h \ + ../node_modules/nan/nan_new.h \ + ../node_modules/nan/nan_implementation_12_inl.h \ + ../node_modules/nan/nan_persistent_12_inl.h \ + ../node_modules/nan/nan_weak.h ../node_modules/nan/nan_object_wrap.h \ + ../node_modules/nan/nan_private.h \ + ../node_modules/nan/nan_typedarray_contents.h \ + ../node_modules/nan/nan_json.h ../node_modules/nan/nan_scriptorigin.h +../bindings/node/binding.cc: +../src/tree_sitter/parser.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/node.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/v8.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/cppgc/common.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/v8config.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/v8-internal.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/v8-version.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/v8config.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/v8-platform.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/node_version.h: +../node_modules/nan/nan.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/node_version.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/uv.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/uv/errno.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/uv/version.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/uv/unix.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/uv/threadpool.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/uv/linux.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/node_buffer.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/node.h: +/home/gdot/.cache/node-gyp/16.6.2/include/node/node_object_wrap.h: +../node_modules/nan/nan_callbacks.h: +../node_modules/nan/nan_callbacks_12_inl.h: +../node_modules/nan/nan_maybe_43_inl.h: +../node_modules/nan/nan_converters.h: +../node_modules/nan/nan_converters_43_inl.h: +../node_modules/nan/nan_new.h: +../node_modules/nan/nan_implementation_12_inl.h: +../node_modules/nan/nan_persistent_12_inl.h: +../node_modules/nan/nan_weak.h: +../node_modules/nan/nan_object_wrap.h: +../node_modules/nan/nan_private.h: +../node_modules/nan/nan_typedarray_contents.h: +../node_modules/nan/nan_json.h: +../node_modules/nan/nan_scriptorigin.h: diff --git a/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding/src/parser.o.d b/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding/src/parser.o.d new file mode 100644 index 000000000..d26799bd5 --- /dev/null +++ b/grammar/build/Release/.deps/Release/obj.target/tree_sitter_mint_binding/src/parser.o.d @@ -0,0 +1,5 @@ +cmd_Release/obj.target/tree_sitter_mint_binding/src/parser.o := cc -o Release/obj.target/tree_sitter_mint_binding/src/parser.o ../src/parser.c '-DNODE_GYP_MODULE_NAME=tree_sitter_mint_binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/home/gdot/.cache/node-gyp/16.6.2/include/node -I/home/gdot/.cache/node-gyp/16.6.2/src -I/home/gdot/.cache/node-gyp/16.6.2/deps/openssl/config -I/home/gdot/.cache/node-gyp/16.6.2/deps/openssl/openssl/include -I/home/gdot/.cache/node-gyp/16.6.2/deps/uv/include -I/home/gdot/.cache/node-gyp/16.6.2/deps/zlib -I/home/gdot/.cache/node-gyp/16.6.2/deps/v8/include -I../node_modules/nan -I../src -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=c99 -MMD -MF ./Release/.deps/Release/obj.target/tree_sitter_mint_binding/src/parser.o.d.raw -c +Release/obj.target/tree_sitter_mint_binding/src/parser.o: ../src/parser.c \ + ../src/tree_sitter/parser.h +../src/parser.c: +../src/tree_sitter/parser.h: diff --git a/grammar/build/Release/.deps/Release/tree_sitter_mint_binding.node.d b/grammar/build/Release/.deps/Release/tree_sitter_mint_binding.node.d new file mode 100644 index 000000000..9d501c198 --- /dev/null +++ b/grammar/build/Release/.deps/Release/tree_sitter_mint_binding.node.d @@ -0,0 +1 @@ +cmd_Release/tree_sitter_mint_binding.node := ln -f "Release/obj.target/tree_sitter_mint_binding.node" "Release/tree_sitter_mint_binding.node" 2>/dev/null || (rm -rf "Release/tree_sitter_mint_binding.node" && cp -af "Release/obj.target/tree_sitter_mint_binding.node" "Release/tree_sitter_mint_binding.node") diff --git a/grammar/build/Release/obj.target/tree_sitter_mint_binding.node b/grammar/build/Release/obj.target/tree_sitter_mint_binding.node new file mode 100755 index 0000000000000000000000000000000000000000..481a98cb8039b27568d4d725efa5194c9a3125eb GIT binary patch literal 23624 zcmeHP4S3YWnV-!j5Iz@B5%7a8LJf#(HV_D3B}=lfk${wdQY~(lWCM$v-E^~w!B$Nr zQBsUW+iQJ#y_U0HAFaI}{nBV#P5nUXwO-U#xjTE}M|BsyitQDta_;@!nR)*^``=x$ zy{EnBp2vat&%D2R-*?{m{LjvRGS~YXSC=>(f}K-*Ob~ToszPdYLiuJLK~O7d#ArOv z5ob%@vTRabELp7}4ux<_fbtjxpIRnKgl-w(utzKHwUn#$5^#}R`Nt$XLWOfUqKm>| zxndKg2+1GP>Gp88=Hrlf$!+*evX$b`FOXzj*r;H^AQM8yxmPj|0twqWf6OJ72%&%g#UR|SRwtB!9T@r4Ct4Olq-a^LVA`Ku?Omf z8{Y12Li-oe^BM#S;rA4==c`4^6)mFYIT%t%|E)#rzo!U(RuTIHMeukL`(G-;UjsYc z_DTaiu85wENSjrFKTw4K30bZ)MYGSHBlT;EPZK+A_){9U^HW_;5o5#w8nlL^X?Kd4 zAbM>^J%#d45#vRN#wV~$Fu1)v9t(CRLy2TCD1wn#Bq@Sz2t=@9)4E`5I1%0+=}d+b zo7UAu#Iw)BKZK`0uz28@@luj;N@bjh}z;g)1oWm7bM^_p<9AqIuu zSRDyRTm8uD^7U)MR^#tcc=e^BXjjaH#c? zSaerYN2n#Na`CroF|RieinT_=O)c?`u(zr%5r(9K{2SIc1ueCUwN{d(s%W_?*s|lQ zU|T2>)vB1oTM6syx)OD>sGPJE$ZJ)`zdo zWrStbjq#RHv;i^iqSalomSiLzV*$Uvn5rsoldWp&;$5&))-S4;P4OxF#{F;q&dCG5{JZ86JQ1{JP|MY49n{tX4&rM}9lN2~es>tq9W1>KXpi|j@9 zM{7WrMaFAzS5shqX@pQ&Li$pNo8cK#Re{JjR zRMR=2SZiK|1h++Et>{o5(kIq5Hms@(R(YyC)mD5VzZ+~}iH$By(hAXG{8L;GQ6h$o zcY4>1$QZer#3GX3Wv53XcqNsH@p{qA>v&#&?>|%NIi}b7jPvh|6E?hA^H(f)OF`zZ zy-4Y)wBfz;6kcP)o98OL)`s_KX}00L8sA~Vk7&HZ zhBsF!Jv}!3M5V%eZMe{S_So@0_sV-`4zGPuwow z)p)tCKgNHk@kuuPCmNq-!ynbS+lC+1c!do=r144{{&S7j*zhMcUTecgG#;?wPiuUG z4gYtIZ?WOO)_AiGKdSK^HvA2Zci8aXYP`pWkJjzdYs1HAe2)#Etnqy|oa_H~8-BLt z-*3a`X#6f4zChy#Z1{4G583d5#)obAMvWh`;jJ1UvEkeg58Lph=09S?`!t@i;a|}B zF&loT#!uMr2Q)5t-$4y4@g(Cuw?w%A3r$zr@O$+-zQ%@+Oq1dwV8fr*{D)V%B?C>f zn2s%X#K2t^it%pXXB+r213%Zmr`5V8H5yO+6ttY%z|Hqag@MzXgI%S80tRl?DH1mrI9^1S+hX8jEmVkR10QGLI}Cihfp-|V^;-++JqA9};O{kX z^LO$d1D|a0?=$cz27bGNpJw3u4cz?6c$a~nVelU?aJ`i$Q-=&(zhWgmY~XVYJ%fZWJzWuu=~;S zM=Xv^brq5_a~9(1npuk&(K{$TeIx@nXCBcGqDLe>i)iZ7>0wFFAey>z`hcXT5KUb; zyPx>?dYiKZ@--XQ61L{nEu*Gl?wqN$6dD*UWk$kUW57u$6t5*p{3CXL35a%+U(fWhQLR9LWl8eS~^RmWF%-$qiPo zl4|C@2l>EH-*W~AjsmdNk zV9)r#-W4|hPo0Ajqyl&xEPD#HgT#BOG{1iYDp4L{-4%ol^lVfdT(v?{LH3&&+nO8;s6&2llSXxbCYRH}LRgdT#MrvpnIG8Wr9h0)j?cU=gv_cB` zhXMmz4+I9U9sa%RI{yLJRR54`u7B8XT5I?n3c(y)^FKer9Shr@xw7t}}dnF!lF9_sROWOw~x^V0&*< z!@%2t!L9pIGds*`IpiHqZGZrbZWwqpFmNz63ltUNwbWt69;6uoHlWa{p?A?p=K%~1 zya3L?Kz|Q4+gpGGdu5#JDIvAJO{&h9MiFmnzKW8Xx4^Kj|G2BK0=m(`yy)JP-7e^n zwH_FFxN+d^)DrORBnCGab_&0D*!wfz{i<1hM*@c+0J};3FJz`vgw$<_rmiKM2CEO2 z3*mkGeppHMn0lMg{^83%;p%$>dLT$@LQ>6ZGC!UF6r z^({(2F3bK}>enDrLnJv^JvO%xRV;YW)i;#{Z&hs9Vs0_YI*!>MbM?(6ww=Q7hPxkR+FrIPfC0OVydwg^Dfp7#J`X4q0Qt)qgW}xWVvYJsx~P8WAFO6(rJ6q8F+0 zpSptRucK#ZdM(lSW$9%^AF*gI^K8Jn%;}TR#`9Hb9PvMA@u%K}W$6p4e}5b?HJ&c@ z4IKAvu6Nz{TQ$wp?>#?rSw)*~_j~8MZhA-d<_X`&EAZl$)9(&Ap2)m}z9D;5rm4Js z?|GmyO%=-CzF}8?1>T;%-6tztechOZ5S#1jTduJAuD%I)_X6{{`ksSk#4d96(N_S( zmb&_?RcwW;51S2yHM{!mQd-(veSK(fVC}BHZ=g02`?RZXt-`LwxFgMj^|RlW^WGMe z5gZd-ed|@s?dq$Su{V6cr@L-)BL~>-J#H35&qKc5ue{*f&78-PM;@nS85$?&5y{(D zKTubiX_`dZyGPO!VRiwblW|x7Hw)`K+3M=wTO_H=)!$JhDeCIqTqG&%>R)Oksg@c- zxyiCNW$q9dgf&aE#fo*`5UrGKystmaOlITvfl;;zEIp`%a%&dV5_9$6V0^s5F|f{a_5B2O=j?P23w~ykR#sq~`|hVDAQ@6W zur^!B{sO$cU=+R|(-Kqhw`BP@gI~T!k*(X+zr0WnzMmG0B&jmu5z+lDWF~YSeEmtP zN2JTvK}ciQT4W8CvasyRswrNO6G|^qNG@;WLoY`7<){M0FkVl953y^LU$OE&M0qD4 z#?zhrF`*CbJ~7>O<8^qWV3dV`V?5G&lkLjZ?*n60wy3x!Il3S{viroC?q9N=?k8AB z_i*}laHGCik1C(G(a^>~bdC4>kyU5i)%P>qSl=VXT%x*QLUX@0@ zK1l0$$!2uyTft`aPb3=r-eJ4WRxszcm+wb-ck1$7ku49co2>ckWOMTKtlg^32dus! z>yoKPHm7WXEwtdHSBUd%wAz)*=C5{hvb5U8VcOxamq+a)Wz(rVC0707%Z)8Rw~bc2R+hXoSHGi_ zwhr*U2xU@ksSL8T+TF_5gIn``B&Qx6B?@ObN0~hzDn~XS$7rHQ8TmpVaaeY!T`8s= z4qH8y=IR$>flYq7jjqn29VKd4DqAkzrTSQIxklyM>5z1(VW--Cwd^d*txrdpt=uK{ z_D6njSvz<)7v(`+Sb9rr`8e^j369foLMDe+c9vP`juKmaO1rY}Ukdf~OuvvquwrD|{z>AN=3Ie-r*b_{ZR%fqxPHE%)`jm-v)m>{MX>`g8vTu58xk!KLr0I{9*Y2fPV%4 zDEu+_ci`!l)@bsY6TyRU*zryeucpCAr^^V{!qGQk++%FW9HyDa09gI`IB+ipe-r zb(SrMGm%!RZEzN}VYcF);b_r}XE}P7YM*Vul|2rO zM$A000P~Y*v*J#CHz2v4cxL6INH0Zx)K_DObD26MZ$k3U!t-2sv&^Pl%aBHPDVd~{ znI~nOq8p)8^x!#GP_LnKeHsYccdZp?`>sb?xjc(a{qD0!SM}o%yA9rcq&dY+c(Pun z7yva|+>B?rQ29H=E#Ok+<96C7C2R4do`0LA(;>cyIM?Bq4E%P)S%=E;D^kZ?JgGci zwRlT(>n#LIrHPf+TLeG@1SlRoCQW*6z6{9DOv#eA7i#X}+FbbY#)q)PJ#9ipW z#F3yGpd)cD@peLlI!uSz@mkT=6~lXVzL+bzLy3qy z;_RXGbIC|@SFi(TqcJ-)i%2XQiG_nZL*1dymPDi@8BE5n3dg)+spv?=wY+y3WoqYaG=?% zi(!$Rtp#um$m}iD$lb!IhAcuj&T=jbplRqA`+pt5J_o`_U&>_YOT#Y_y3y9Zd^wZ3 z6Z9(xA0@t5GMQrt>rWR}Xc8$BbyjQH8v25Og*|U%=JI#=D|^beM#F6DHm3x74G)`egrRRPDB79i`K` znRzYvhxamZ5~Mvxa{T+2?U8Fk;FWq0k#}3C>I7PQkyE?cs^3bW)-3}qCid$HuV?v} zxB5B&d)4O(+2=`ci!M0ZIiwAvkIv*cKYZGg_E%_reBzTd*XuD&KdTMJXGfWiuU-GA zj{k1nZp5p)f{yEO6m8GLP1WH?b+|}}t95v(4%>9tt-~92_$3{FQ-}BJ@SqN#)#0l; zJg&o0>T`mas>6@!aFGsI>+n(?w&}22hd1i*OFC4g!PDoqqJ<(`Z6Kf9=X3g;%;)o& z=5S42-BNeO=56>h&Mx<2PqnA=!UbKD@?Phy@l-CHt5D{DzmRsPXs_PxXrF+`jhRM! z20UJJ@ltD?=i+68`)4jbN^rl<#YbD?BNs2X#!)Vw|M$+6?!=D32oFd@z=?f={r2{f z{Nt_rDGYY#$^W})N_S$XVgD?XQ^jdN@OeESnyF6gN>nT~5$2z4&2MI^6JHT{UdzQ# z!v_(!3CXw}s_8XwlU{7nw*>l){AA%A}Zdq(5D?vTH;fgOi;V86%hb0dc0 z$*20xRmh%mU?|x$V(Sld#FOwzJb`OH^nHwQUgv07ek-HhW3C@6KRG(G>L}2T^!<$V z?6>LvoaE2%4|fAEWdHZH9$w$by#(Y-=XxFZ{=)s_2pI$SxWp$~>#jZpi)S^?>o9p9 z3u&)woY!TOK$9yiA^j5tuhT~K`|AveBVWC4E7$yUG|uZdx6~rULam3_b^QLOZ+ud} zUf<2v{9857>%JC^cW9i~fvYrroyK`x2vWM+HO}kAZ5pS0Eht}JH`2FJa#Ii%s((7u zNM~s}suiF4EX03M@}tpxZj)6!Bk}z4`#f+QEX$iu-qd=UeQsi~+`AIbAJ>zy;O2F> z#f*rr2;Nf!FLuAj55ey?73=s@MfCik2tKQ{u$@aKo_{}vuL%E@Mex4^Ug#c-Z%919 z01p+>L-z<3s?V<#!Ra24LiO`T5&lJ(7z^pYya;}q#Pjb7`En8d=QO{)|GZp;--88h zA$#aAk_zE;uDuZcW#EPG8@a0p|F4SRr(@w%I^;18Q_KP zSNYc>dIbMfeM<}dX}`BBxTf)vRldexaJ{;j!H=6I7OW4&irp=N>p8NQ7(fH@E{L>u zG*&I(OA+`oipvtAj*f7GG(xJFLfnjyqcGQ`g$?+a;3s+OLWatqzRUoZKQt}C4F!D3 zK+t}t0$(AJU(&|K`i26(Xu(0tWLI08r$uD%kO?N+gDrH6OeZcXXpINAN8{T<(O@g? z#^?-&x_ao-Oh+`F47Yj~FIrMlm`UDF6AUF1pGe zwQq|@gY=C@(rt9%jh%#WurnHIF+TrKqHT+bzq_`uiW*xy`5JNjSfQX}-b+!3F>?23Ei z2fUGprYe3R=ibCtuvtD>pTs6i+8z6Mek_Wde2@fA6DX@V26Cv8~#u6BN1wlwH0D7}W`WmPyCoNjS7^AIZEls|-5vH060e)Cz4C&cCTR zyv`=i`=%VSy__f09NuJ;=lwbkf59JEv;xkT^$ptO`Tj}{`FjcTQ(c?x3m~Y7+a(oF>z>2c=s!VR~ov`#vt)?Ocd zemolPnqw5(iNlFQiIJ>Y`=>hlb}YT{Kwe$wxPKd5S8K{Oc`>!{^(~S8b#qHZT^MSF z&kwAvUD^@pkfhmn+QO$E2f6WYzT4Rmo_iFk7crW2?Js|Z6X?Ih&dfrp_TozYDU0bk z6Y^3^Nx7ibM$f7BZ!G>j{D^Wcyk5Bw-mWYr8oyH)lxuml+l{W8R%b8AzLfZKVl?rU z(dWZmd%^R<$u8kKU0Y(+8`Vam5$<{nBT6q!Y-nA7gIARcZ`E1#49mw6HzVnK@v&^G z_7Al_`a{UfBu&f9@*-1!pi{NWYVAeV!cP2&)h@QX-G@%IHv3a+*FjRP%}+x>E?Ho8 zk*72`;|i{EXH02|0O*_1%rd)ePzcWHLOrUMNDA{QH`! zy%3)3YKndEz`dES-6V;D-my47C>Zc^1tQ?Ry^d>yPXIBL>DnLCwKth*K4-XTSPL&V z*Ft#yG?-EA#x=ek5*n@u*YJ(syx(Yyv-QCo-FO;i25q1Bv|nwueJ1OT_rRLiKU{mi zZ_2yv9b$f`b!(!kPZ(0MU^$Yd7Y)gnE|+YlB1NM+#|l=yU`5IE_X5WQ%WC{f+}?SrJ$c*e1PDNL8ypWJ zhY|+)=JlZ`LiLW*t7ccXKX(g=4z87?Pr>C$6ohgh1b@Po`kl}d9rabGSF5vYLKoUm zelN&JK;$eOSnj|-CjU^=H=>||p>#+$8-CYAzIPf)3c=5>gus%w+zOzb*kQQ=mf^gU zE3lmKdPrKuYpv7MP(?ct3>XT_i(7?ggjEjU^a>p9gtNQ=TY{rax&{8-G9W5&4oNst zD@%yT)2kurHri~~L(=Wdx~QyUaj)#x2F^b$1o`=1&b^j4aek*q9-AQvv%S1*1$mKU zdgZ|YJ{G_q4&cuOaJ+B$`F%ft-vjqJKlz~m{$v2Z6u{pI;G1D8`}ut+fR6?6Qvv*9 z06z&!#n12g0KOE!H^Y?jvojXJe-^-h6~J!>@Vj8i`S~3Q;AQ|n6~HBa2f(|7b~Gc$ zwW0KZJ&ClYWi+`vW1LhD?#py%bSoYktXeszP_mM`X^!c+6De!Fl*+`X`g;!RX4Oy> z1udX#ccEBL$Gg1>M{K=ZHf*#AT0sW0vbN0N@{o3=tb(I3ujx`wH&dBxOzS-`cHGE0 z5J9$ElQi3yC{*wk7kIl{(bIIFRxIVKrlCmDbTWp2GXBN!uUisHIWRbwRYtUt#GbSQ zj*em++<82fHA^Rl3@2rQYfCo=3x=6j3MjP?#QK$Km-Eg|arJ(<4Kw-fo>Zk|>W(pJ zmx>u<%CHX_dj5cA&ScAa&fr}vay402bt`Wg*<7h?$nm6YfToL-;Y?O*n(gCO70}cw z4vd?Yn>?Y7>jjgW5)yI@qEA+B+pru(gcpw~m7HGI$4qXWIZVpTiO^&N4}Fw(xlxW7 z#WMDU%^!@WDG2o*F>adND`tpL;B&~wR9wz_QkyKnqlBAZkQW~0zE&raB}nabt1sU0 zWEtjn%7Ua=IYU_%TA$E$Cp9?mPed=vj-d?uj?3P7Gmp*TUzw9(k!wDa#>Zh%j?9!HJ?MIOQVh44FTGjEhUZi^4mj%%Iph7yC)V)3 z9NNSFxU$R~TU5Rsm*bGTq^Vab8F(fpJpn7+8<}G(@+S9+>Cl{!VsKU_S(ag{HM;~3 zS~J@-ec1XJlKwoA3>Ui_)fyVN;vg9%{j)8@0ue1ZxeYM|5?JRou3d+@mdxl*wRZxB+{Dmg}UD065Bd+XrR#-uiG}+3#^i z_aKxz!}Tv77advh)^LB$Z z;5Iv}Y!FM0HN><^Y-4C`3~g*(ts>FX692H&w(38vYojS!O@m28iAA@+bMHNG-n%Mv<20u#P zksLgkY;JU4_-k_GhNi)PH14@#^v>G$Wd9czyAOR9A!^!N!)ZSKIHGgS4s1Knq+%DMy1XQ;}! z1FHj7a0fFrgnqMU?b_WT2+&>0yOW!f_iTP$Jl3N7hA^hK?8k45P;l~#5L9ylPv6ju z!Xt}e$+-j12CB4;WzCQ8DZwAo?Zt)e2;o5-@dxjzZ z6Ud90I8MnI$NQbUsnp4VGO~RTq~yz0zIa51WJmPA zgEloiZ+!d~k7L-u_JluPShV(hkG%gmTkS&)SB=^E(2E`ZH4Fht*srG`htf{(3E%cn zw(Y%!Jnp^B=&SvwX1EXTI?a3ZlQeMb$9;jpD2?w+clKT5a7CTW1@D$Ie&s7u9}$?ke?Xr4sH#m6{3fTjGsBnlJflLyaXb z+24<3upMOn(c$rKaYMNcV)dEZ{$^x8B-{6u)=zWOUf#{<^hcXt=fZzU;uyz?!x<+z zG98?OL7qst@7EJuZPnLWJc0(2=p$;d_*oXeD8xICZJ%d0sP8h1pBLhth}Iu59Tc7j zdVr0^(I4RAuM?TA^p)f^PlSGj+6#{U1=|J5m;{zq=&xIC0EyO#H-JhveJ@+T#k1x^rp?adY#ZM0L zPBg6FiA_Ph6VSIhBu~Wk!Fi4=p6HU$I5-iF`}1C5+u?qc>^N1-R|f1tA4_0tb(*0b z!aI&NPO-3lqGcg@qBR!3BE&n9If^gMujUE&+u-~?M9}D<-aaeCfcs!j7tKSiO z{$UTPoV%w!_9`>@p&g=$w$LHk$MC0<%w2>+7n%A@qFTz^y8wUl8hIPiM!WX^(!r& z?@#3u@1VILUSS+PHh|hd1yB+69ndqN7eK!R{TB2A=u^;VpbE_66wq|g#h_ZyQqUUE z^`IuuEuc-Hdq8cV9LNLh0__Gp3fd2P5_Ays9O!w_VbD>~TcGzqe*}F9`U~g;=ra(% z=~RIxfF^@31kDD`1t4pn`miVi)z8-;_hT#LMt)**LkA@cJTG6NcJ zQZ-+OOce9LG|0LT>Il-HzM-D1H>n4_sdb*2EK~6BQLef zqCN(DyjF84OP{)xY+lLEMSd|T*yo^MUqT)GrQ3L_%>vaXO1*eSX$SK0#H)t;bw3dC zZ>L`t{~kbHHD*xv>zk<89<qWO_=M6iA368uyS{A1%-(XKye}U%tHGfs)eQ4~KVYzk zi4RMF@htW#iSfvv26rA^gZx6!5B!!brlo`U%Ik%-9R%@c{s_cT=f@zP%jZCh9|H0C z{S?Hp>3PsZ(9b~=KtmuNVV!t4h5xv%{^QcQQxvO?-=)u#lBm~r{-DHIBv?DPtou~* zNO+c%vOLGO)(F>2I-6`zj^%A$blA^wazQLuw%eYI=eBZFKbP!(vK}`ktW0&ps@2Dw z#(0(K66d_nN=dITmgLi+62wupY=S6Dm;0x1ROni?=7M6l$r=8YHF7pkM{16(m00K1 z*i+-N?%!$HzQ9l2~rE|c1x?oAh3^Bvt@%Imr}ldGfE z)Sd6znooBUknU7A)0@e%&Q`CZD@Wo-D%(-;d=9QC?aH@;m-aHssWCQ`->J4tdq=KA zsWYZh`Al~v?bVrX_^g=qfslD04OsUv9wDEhbqx)xIXfmfvnEtk??cR3h&3efwUJ+~k`pIA7-^`fy#A5s+P$%L z4_EY8M!#^zLp;fEnk>5>#7VumDft^~DwB}VaM>KD5c57AEmz5>cexafoh1prqu7bx z;yB()QhhNDpVW5ZcRRjANg9>{o_sU16MrS(TX((wtfSulSSDfcKGS5#xYl6s7X7+P zlZklD6^k^2Iu+Z^fM6S z!v=3vDBd9r-l9LBsrOv2ddJ|W^y|5b%Z#5eI1T}ow&({%;jhwf#)sc|B}H*|luJ>Z zC*@KUr%bsN#R+659@i)ke4>@S0`~e2%BFK$d(vAoiKTT{FJ({( zq&yWzz!o~w+3Y#NRA;)o)HtnTM}dLDeVtpnvMCM}if`}8WZP^OjZ=keM{7`oG3@hv zhX#$F&Wx9COMB^nYGXOql}mYphvAF@cV!5J6dWK9flm zIy^K@p{*z5INucb+~py}mwuHtn(<_u_qE_Cs>C?cZJPCWq~J|vA4p6Pd^#WONHW8M z&olc#?gE0}Zshe>BW;uGo-*r8e+?_)e>1r32hsBfgU8u8lHhx|fOMID`1oT+zShEb z7PnGWc=}f6eq)f9)#y(`E2Ami$&TAN3Z#-1yUI;cW(QvhYo2Ue;Uq zuZ_ISr}XP8215`NU^X|r&d-)$By>nCgBZyGHEmSn`{UKQiw;eJm<*U*=bEiTg5-f=k@5H~IzdGrY_TY!Ka({a_$NqH@KWnf?r|qI0Hz6OMI-gaQ#)9 zXo-dEU#aj-)xz~xajYW?=WolLBu;QO_e=k3f%Ra?>t7A@H)C!m^7YIhwOH~uYnZlK z_^k%-w(#2xzQe+|8@$iLWgqUgaM^GBEIe-X?6>d-41U1EWt|I@!7nUlmf&6VPb;Brr*1a2C*{NU;3^>dq)@|kQp;bnGslu&n&#Fj#V5(>?CX+$wx zWH^!UN@TlQ(^&|qde&K&sH23u#U*lGUM8{bmgYrxiE6#qD9db1wc~v(BfkDS&o~NV@<$IZ{vOANx-Uba(hc!@KY8{8Zprk3b?mR+eZ z(_06FmqDbs%1ar?r*i$DZhn?LZWMF>`KYz~-vEs5 z+y1xkB1NjU9E&TolyO`uXJ0-N9Wv)Q+vis;+x{KE*uMT>11OlZ%}mg>Tp38h%99r% zmt~$s^cns0DZa9YleCj(4%Jc)N**)qgBX`>*?xmr!$i`4o25YdFYqoD%8lQld0ImH z#pB0EwX~P@%l_E5x#cSTb35%emAs4?vfJ|;o;~+~=!m(9Ut)FGV(~SxeEVVJ|6W!W INOt>w0+VB^FaQ7m literal 0 HcmV?d00001 diff --git a/grammar/build/Release/tree_sitter_mint_binding.node b/grammar/build/Release/tree_sitter_mint_binding.node new file mode 100755 index 0000000000000000000000000000000000000000..481a98cb8039b27568d4d725efa5194c9a3125eb GIT binary patch literal 23624 zcmeHP4S3YWnV-!j5Iz@B5%7a8LJf#(HV_D3B}=lfk${wdQY~(lWCM$v-E^~w!B$Nr zQBsUW+iQJ#y_U0HAFaI}{nBV#P5nUXwO-U#xjTE}M|BsyitQDta_;@!nR)*^``=x$ zy{EnBp2vat&%D2R-*?{m{LjvRGS~YXSC=>(f}K-*Ob~ToszPdYLiuJLK~O7d#ArOv z5ob%@vTRabELp7}4ux<_fbtjxpIRnKgl-w(utzKHwUn#$5^#}R`Nt$XLWOfUqKm>| zxndKg2+1GP>Gp88=Hrlf$!+*evX$b`FOXzj*r;H^AQM8yxmPj|0twqWf6OJ72%&%g#UR|SRwtB!9T@r4Ct4Olq-a^LVA`Ku?Omf z8{Y12Li-oe^BM#S;rA4==c`4^6)mFYIT%t%|E)#rzo!U(RuTIHMeukL`(G-;UjsYc z_DTaiu85wENSjrFKTw4K30bZ)MYGSHBlT;EPZK+A_){9U^HW_;5o5#w8nlL^X?Kd4 zAbM>^J%#d45#vRN#wV~$Fu1)v9t(CRLy2TCD1wn#Bq@Sz2t=@9)4E`5I1%0+=}d+b zo7UAu#Iw)BKZK`0uz28@@luj;N@bjh}z;g)1oWm7bM^_p<9AqIuu zSRDyRTm8uD^7U)MR^#tcc=e^BXjjaH#c? zSaerYN2n#Na`CroF|RieinT_=O)c?`u(zr%5r(9K{2SIc1ueCUwN{d(s%W_?*s|lQ zU|T2>)vB1oTM6syx)OD>sGPJE$ZJ)`zdo zWrStbjq#RHv;i^iqSalomSiLzV*$Uvn5rsoldWp&;$5&))-S4;P4OxF#{F;q&dCG5{JZ86JQ1{JP|MY49n{tX4&rM}9lN2~es>tq9W1>KXpi|j@9 zM{7WrMaFAzS5shqX@pQ&Li$pNo8cK#Re{JjR zRMR=2SZiK|1h++Et>{o5(kIq5Hms@(R(YyC)mD5VzZ+~}iH$By(hAXG{8L;GQ6h$o zcY4>1$QZer#3GX3Wv53XcqNsH@p{qA>v&#&?>|%NIi}b7jPvh|6E?hA^H(f)OF`zZ zy-4Y)wBfz;6kcP)o98OL)`s_KX}00L8sA~Vk7&HZ zhBsF!Jv}!3M5V%eZMe{S_So@0_sV-`4zGPuwow z)p)tCKgNHk@kuuPCmNq-!ynbS+lC+1c!do=r144{{&S7j*zhMcUTecgG#;?wPiuUG z4gYtIZ?WOO)_AiGKdSK^HvA2Zci8aXYP`pWkJjzdYs1HAe2)#Etnqy|oa_H~8-BLt z-*3a`X#6f4zChy#Z1{4G583d5#)obAMvWh`;jJ1UvEkeg58Lph=09S?`!t@i;a|}B zF&loT#!uMr2Q)5t-$4y4@g(Cuw?w%A3r$zr@O$+-zQ%@+Oq1dwV8fr*{D)V%B?C>f zn2s%X#K2t^it%pXXB+r213%Zmr`5V8H5yO+6ttY%z|Hqag@MzXgI%S80tRl?DH1mrI9^1S+hX8jEmVkR10QGLI}Cihfp-|V^;-++JqA9};O{kX z^LO$d1D|a0?=$cz27bGNpJw3u4cz?6c$a~nVelU?aJ`i$Q-=&(zhWgmY~XVYJ%fZWJzWuu=~;S zM=Xv^brq5_a~9(1npuk&(K{$TeIx@nXCBcGqDLe>i)iZ7>0wFFAey>z`hcXT5KUb; zyPx>?dYiKZ@--XQ61L{nEu*Gl?wqN$6dD*UWk$kUW57u$6t5*p{3CXL35a%+U(fWhQLR9LWl8eS~^RmWF%-$qiPo zl4|C@2l>EH-*W~AjsmdNk zV9)r#-W4|hPo0Ajqyl&xEPD#HgT#BOG{1iYDp4L{-4%ol^lVfdT(v?{LH3&&+nO8;s6&2llSXxbCYRH}LRgdT#MrvpnIG8Wr9h0)j?cU=gv_cB` zhXMmz4+I9U9sa%RI{yLJRR54`u7B8XT5I?n3c(y)^FKer9Shr@xw7t}}dnF!lF9_sROWOw~x^V0&*< z!@%2t!L9pIGds*`IpiHqZGZrbZWwqpFmNz63ltUNwbWt69;6uoHlWa{p?A?p=K%~1 zya3L?Kz|Q4+gpGGdu5#JDIvAJO{&h9MiFmnzKW8Xx4^Kj|G2BK0=m(`yy)JP-7e^n zwH_FFxN+d^)DrORBnCGab_&0D*!wfz{i<1hM*@c+0J};3FJz`vgw$<_rmiKM2CEO2 z3*mkGeppHMn0lMg{^83%;p%$>dLT$@LQ>6ZGC!UF6r z^({(2F3bK}>enDrLnJv^JvO%xRV;YW)i;#{Z&hs9Vs0_YI*!>MbM?(6ww=Q7hPxkR+FrIPfC0OVydwg^Dfp7#J`X4q0Qt)qgW}xWVvYJsx~P8WAFO6(rJ6q8F+0 zpSptRucK#ZdM(lSW$9%^AF*gI^K8Jn%;}TR#`9Hb9PvMA@u%K}W$6p4e}5b?HJ&c@ z4IKAvu6Nz{TQ$wp?>#?rSw)*~_j~8MZhA-d<_X`&EAZl$)9(&Ap2)m}z9D;5rm4Js z?|GmyO%=-CzF}8?1>T;%-6tztechOZ5S#1jTduJAuD%I)_X6{{`ksSk#4d96(N_S( zmb&_?RcwW;51S2yHM{!mQd-(veSK(fVC}BHZ=g02`?RZXt-`LwxFgMj^|RlW^WGMe z5gZd-ed|@s?dq$Su{V6cr@L-)BL~>-J#H35&qKc5ue{*f&78-PM;@nS85$?&5y{(D zKTubiX_`dZyGPO!VRiwblW|x7Hw)`K+3M=wTO_H=)!$JhDeCIqTqG&%>R)Oksg@c- zxyiCNW$q9dgf&aE#fo*`5UrGKystmaOlITvfl;;zEIp`%a%&dV5_9$6V0^s5F|f{a_5B2O=j?P23w~ykR#sq~`|hVDAQ@6W zur^!B{sO$cU=+R|(-Kqhw`BP@gI~T!k*(X+zr0WnzMmG0B&jmu5z+lDWF~YSeEmtP zN2JTvK}ciQT4W8CvasyRswrNO6G|^qNG@;WLoY`7<){M0FkVl953y^LU$OE&M0qD4 z#?zhrF`*CbJ~7>O<8^qWV3dV`V?5G&lkLjZ?*n60wy3x!Il3S{viroC?q9N=?k8AB z_i*}laHGCik1C(G(a^>~bdC4>kyU5i)%P>qSl=VXT%x*QLUX@0@ zK1l0$$!2uyTft`aPb3=r-eJ4WRxszcm+wb-ck1$7ku49co2>ckWOMTKtlg^32dus! z>yoKPHm7WXEwtdHSBUd%wAz)*=C5{hvb5U8VcOxamq+a)Wz(rVC0707%Z)8Rw~bc2R+hXoSHGi_ zwhr*U2xU@ksSL8T+TF_5gIn``B&Qx6B?@ObN0~hzDn~XS$7rHQ8TmpVaaeY!T`8s= z4qH8y=IR$>flYq7jjqn29VKd4DqAkzrTSQIxklyM>5z1(VW--Cwd^d*txrdpt=uK{ z_D6njSvz<)7v(`+Sb9rr`8e^j369foLMDe+c9vP`juKmaO1rY}Ukdf~OuvvquwrD|{z>AN=3Ie-r*b_{ZR%fqxPHE%)`jm-v)m>{MX>`g8vTu58xk!KLr0I{9*Y2fPV%4 zDEu+_ci`!l)@bsY6TyRU*zryeucpCAr^^V{!qGQk++%FW9HyDa09gI`IB+ipe-r zb(SrMGm%!RZEzN}VYcF);b_r}XE}P7YM*Vul|2rO zM$A000P~Y*v*J#CHz2v4cxL6INH0Zx)K_DObD26MZ$k3U!t-2sv&^Pl%aBHPDVd~{ znI~nOq8p)8^x!#GP_LnKeHsYccdZp?`>sb?xjc(a{qD0!SM}o%yA9rcq&dY+c(Pun z7yva|+>B?rQ29H=E#Ok+<96C7C2R4do`0LA(;>cyIM?Bq4E%P)S%=E;D^kZ?JgGci zwRlT(>n#LIrHPf+TLeG@1SlRoCQW*6z6{9DOv#eA7i#X}+FbbY#)q)PJ#9ipW z#F3yGpd)cD@peLlI!uSz@mkT=6~lXVzL+bzLy3qy z;_RXGbIC|@SFi(TqcJ-)i%2XQiG_nZL*1dymPDi@8BE5n3dg)+spv?=wY+y3WoqYaG=?% zi(!$Rtp#um$m}iD$lb!IhAcuj&T=jbplRqA`+pt5J_o`_U&>_YOT#Y_y3y9Zd^wZ3 z6Z9(xA0@t5GMQrt>rWR}Xc8$BbyjQH8v25Og*|U%=JI#=D|^beM#F6DHm3x74G)`egrRRPDB79i`K` znRzYvhxamZ5~Mvxa{T+2?U8Fk;FWq0k#}3C>I7PQkyE?cs^3bW)-3}qCid$HuV?v} zxB5B&d)4O(+2=`ci!M0ZIiwAvkIv*cKYZGg_E%_reBzTd*XuD&KdTMJXGfWiuU-GA zj{k1nZp5p)f{yEO6m8GLP1WH?b+|}}t95v(4%>9tt-~92_$3{FQ-}BJ@SqN#)#0l; zJg&o0>T`mas>6@!aFGsI>+n(?w&}22hd1i*OFC4g!PDoqqJ<(`Z6Kf9=X3g;%;)o& z=5S42-BNeO=56>h&Mx<2PqnA=!UbKD@?Phy@l-CHt5D{DzmRsPXs_PxXrF+`jhRM! z20UJJ@ltD?=i+68`)4jbN^rl<#YbD?BNs2X#!)Vw|M$+6?!=D32oFd@z=?f={r2{f z{Nt_rDGYY#$^W})N_S$XVgD?XQ^jdN@OeESnyF6gN>nT~5$2z4&2MI^6JHT{UdzQ# z!v_(!3CXw}s_8XwlU{7nw*>l){AA%A}Zdq(5D?vTH;fgOi;V86%hb0dc0 z$*20xRmh%mU?|x$V(Sld#FOwzJb`OH^nHwQUgv07ek-HhW3C@6KRG(G>L}2T^!<$V z?6>LvoaE2%4|fAEWdHZH9$w$by#(Y-=XxFZ{=)s_2pI$SxWp$~>#jZpi)S^?>o9p9 z3u&)woY!TOK$9yiA^j5tuhT~K`|AveBVWC4E7$yUG|uZdx6~rULam3_b^QLOZ+ud} zUf<2v{9857>%JC^cW9i~fvYrroyK`x2vWM+HO}kAZ5pS0Eht}JH`2FJa#Ii%s((7u zNM~s}suiF4EX03M@}tpxZj)6!Bk}z4`#f+QEX$iu-qd=UeQsi~+`AIbAJ>zy;O2F> z#f*rr2;Nf!FLuAj55ey?73=s@MfCik2tKQ{u$@aKo_{}vuL%E@Mex4^Ug#c-Z%919 z01p+>L-z<3s?V<#!Ra24LiO`T5&lJ(7z^pYya;}q#Pjb7`En8d=QO{)|GZp;--88h zA$#aAk_zE;uDuZcW#EPG8@a0p|F4SRr(@w%I^;18Q_KP zSNYc>dIbMfeM<}dX}`BBxTf)vRldexaJ{;j!H=6I7OW4&irp=N>p8NQ7(fH@E{L>u zG*&I(OA+`oipvtAj*f7GG(xJFLfnjyqcGQ`g$?+a;3s+OLWatqzRUoZKQt}C4F!D3 zK+t}t0$(AJU(&|K`i26(Xu(0tWLI08r$uD%kO?N+gDrH6OeZcXXpINAN8{T<(O@g? z#^?-&x_ao-Oh+`F47Yj~FIrMlm`UDF6AUF1pGe zwQq|@gY=C@(rt9%jh%#WurnHIF+TrKqHT+bzq_`uiW*xy`5JNjSfQX}-b+!3F>?23Ei z2fUGprYe3R=ibCtuvtD>pTs6i+8z6Mek_Wde2@fA6DX@V26Cv8~#u6BN1wlwH0D7}W`WmPyCoNjS7^AIZEls|-5vH060e)Cz4C&cCTR zyv`=i`=%VSy__f09NuJ;=lwbkf59JEv;xkT^$ptO`Tj}{`FjcTQ(c?x3m~Y7+ [ + [$.entity_name], + [$.statement, $.call], + [$.case_branch, $.call], + [$._basic_expression, $.tuple_destructuring], + [$.array, $.call], + [$.statement, $.record_field], + [$.call, $.negation], + [$.member, $.negation], + [$.operation, $.negation], + [$.tuple, $.block], + [$.tuple, $.statement], + [$.access, $.statement], + [$.access, $.array], + [$.access, $.negation], + [$.access, $.case_branch] + ], + externals: $ => [ + $.string_chars, + $.javascript_chars + ], rules: { program: $ => repeat($._top_level), + + variable: $ => /[a-z][a-zA-Z0-9]*/, + constant: $ => /[A-Z][A-Z0-9_]*/, + _top_level: $ => choice( + $.record_definition, + $.enum_definition, + $.component, $.comment, - $.module + $.module, ), + comment: $ => token(choice( seq('//', /.*/), seq( @@ -14,16 +43,79 @@ module.exports = grammar({ '/' ) )), + + property: $ => seq( + 'property', + $.variable, + optional($.type_definition), + "=", + $._expression + ), + + record_definition_field: $ => seq( + $.variable, + $.type_definition + ), + + record_definition: $ => seq( + 'record', + field('name', $.entity_name), + '{', + commaSep1($.record_definition_field), + '}' + ), + + record_update: $ => seq( + '{', + $.variable, + '|', + commaSep($.record_field), + '}' + ), + + enum_definition: $ => seq( + 'enum', + field('name', $.entity_name), + optional(seq('(',commaSep($.variable),')')), + '{', + repeat(choice( + $.comment, + $.type)), + '}' + ), + + component: $ => seq( + 'component', + $.entity_name, + '{', + repeat(choice( + $.property, + $.function, + $.comment, + $.const, + )), + '}' + ), + module: $ => seq( 'module', field('name', $.entity_name), '{', repeat(choice( $.comment, - $.function + $.function, + $.const )), '}' ), + + const: $ => seq( + 'const', + $.constant, + '=', + $._expression + ), + function: $ => seq( 'fun', field('name', $.variable), @@ -33,45 +125,248 @@ module.exports = grammar({ repeat($.statement), '}' ), + argument_list: $ => seq( '(', commaSep($.argument), ')' ), + argument: $ => seq( field('name', $.variable), field('type', optional($.type_definition)) ), - variable: $ => /[a-z][a-zA-Z0-9]*/, + entity_name: $ => seq( $._entity_part, optional(repeat(seq('.', $._entity_part))) ), + _entity_part: $ => /[A-Z][a-zA-Z]+/, + statement: $ => seq( optional(seq( - field('name', $.variable), + field('name', choice($.variable, $.tuple_destructuring)), "=" )), - choice($.inline_javascript, $.module_access) + $._expression + ), + + array: $ => seq( + '[', + repeat($._expression), + ']' ), - module_access: $ => seq( + + tuple: $ => seq( + '{', + commaSep($._expression), + '}' + ), + + inline_function: $ => seq( + $.argument_list, + optional($.type_definition), + $.block + ), + + number: $ => { + const decimal_digits = /\d(_?\d)*/ + + const decimal_integer_literal = choice( + '0', + seq(optional('0'), /[1-9]/, optional(seq(optional('_'), decimal_digits))) + ) + + return token(choice( + seq(decimal_integer_literal, '.', optional(decimal_digits)), + seq(decimal_integer_literal), + seq(decimal_digits), + )) + }, + + _basic_expression: $ => choice( + $.string, + $.bool, + $.variable, $.entity_name, + $.record, + $.record_update, + $.inline_javascript, + $.inline_function, + $.enum, + $.tuple, + $.number, + $.case, + $.constant, + $.negation, + $.operation, + $.array, + $.if, + $.block, + ), + + bool: $ => choice('true', 'false'), + + enum: $ => seq( + $.entity_name, + '::', + $.entity_name, + ), + + record_field: $ => seq( + $.variable, + '=', + $._expression, + ), + + record: $ => seq( + '{', + commaSep1($.record_field), + '}' + ), + + case_branch: $ => seq( + optional($._expression), + '=>', + $._expression + ), + + case: $ => seq( + 'case', + '(', + $._expression, + ')', + '{', + repeat($.case_branch), + '}' + ), + + if: $ => seq( + 'if', + '(', + $._expression, + ')', + '{', + $._expression, + '}', + optional($.else) + ), + + else: $ => seq( + 'else', + '{', + $._expression, + '}' + ), + + arguments: $ => seq( + '(', + commaSep(optional($._expression)), + ')' + ), + + _expression: $ => choice( + $.call, + $.member, + $.access, + $._basic_expression, + ), + + tuple_destructuring: $ => seq( + '{', commaSep($.variable), '}' + ), + + block: $ => seq( + '{', + repeat($.statement), + '}' + ), + + parenthesized_expression: $ => seq( + '(', + $._expression, + ')' + ), + + negation: $ => seq( + '!', + $._expression, + ), + + operation: $ => choice( + ...[ + ["|>", 0], + ["or", 0], + ["!=", 10], + ["==", 10], + ["<=", 11], + ["<", 11], + [">=", 11], + [">", 11], + ["-", 13], + ["+", 13], + ["*", 14], + ["/", 14], + ["%", 14], + ["**", 15], + ["&&", 6], + ["||", 5], + ].map(([operator, precedence]) => + prec.left(precedence, seq( + field('left', $._expression), + field('operator', operator), + field('right', $._expression) + )) + ) + ), + + member: $ => seq( + field('entity', $._expression), ".", - $.variable + field('variable', $.variable) + ), + + access: $ => seq( + field('entity', $._expression), + "[", + field('variable', $._expression), + "]" + ), + + call: $ => seq( + field('epxression', $._expression), + field('arguments', $.arguments) ), + + interpolation: $ => seq( + "#{", + $._expression, + "}" + ), + inline_javascript: $ => seq( '`', - /[^`]*/, - '`'), + repeat(choice($.javascript_chars, $.interpolation)), + '`' + ), + type_definition: $ => seq( - ':', + ':', $.type ), + + string: $ => seq( + '"', + repeat(choice($.string_chars, $.interpolation)), + '"', + optional(seq("\\", $.string)) + ), + type: $ => choice( $.variable, seq( - $._entity_part, + $.entity_name, optional(seq( "(", commaSep($.type), diff --git a/grammar/package.json b/grammar/package.json index e5dc2b4da..ea8a2b0bc 100644 --- a/grammar/package.json +++ b/grammar/package.json @@ -1,7 +1,8 @@ { "private": true, "dependencies": { - "tree-sitter-cli": "^0.20.0" + "nan": "^2.15.0", + "tree-sitter-cli": "^0.20.1" }, "main": "bindings/node" } diff --git a/grammar/src/grammar.json b/grammar/src/grammar.json index e3698e48e..2f321796c 100644 --- a/grammar/src/grammar.json +++ b/grammar/src/grammar.json @@ -8,9 +8,29 @@ "name": "_top_level" } }, + "variable": { + "type": "PATTERN", + "value": "[a-z][a-zA-Z0-9]*" + }, + "constant": { + "type": "PATTERN", + "value": "[A-Z][A-Z0-9_]*" + }, "_top_level": { "type": "CHOICE", "members": [ + { + "type": "SYMBOL", + "name": "record_definition" + }, + { + "type": "SYMBOL", + "name": "enum_definition" + }, + { + "type": "SYMBOL", + "name": "component" + }, { "type": "SYMBOL", "name": "comment" @@ -59,12 +79,162 @@ ] } }, - "module": { + "property": { "type": "SEQ", "members": [ { "type": "STRING", - "value": "module" + "value": "property" + }, + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "type_definition" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + }, + "record_definition_field": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "SYMBOL", + "name": "type_definition" + } + ] + }, + "record_definition": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "record" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "entity_name" + } + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "record_definition_field" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "record_definition_field" + } + ] + } + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "record_update": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "STRING", + "value": "|" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "record_field" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "record_field" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "enum_definition": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "enum" }, { "type": "FIELD", @@ -74,6 +244,60 @@ "name": "entity_name" } }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "variable" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + { + "type": "BLANK" + } + ] + }, { "type": "STRING", "value": "{" @@ -87,9 +311,54 @@ "type": "SYMBOL", "name": "comment" }, + { + "type": "SYMBOL", + "name": "type" + } + ] + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "component": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "component" + }, + { + "type": "SYMBOL", + "name": "entity_name" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "property" + }, { "type": "SYMBOL", "name": "function" + }, + { + "type": "SYMBOL", + "name": "comment" + }, + { + "type": "SYMBOL", + "name": "const" } ] } @@ -100,273 +369,1725 @@ } ] }, - "function": { + "module": { "type": "SEQ", "members": [ { "type": "STRING", - "value": "fun" + "value": "module" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", - "name": "variable" + "name": "entity_name" + } + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "comment" + }, + { + "type": "SYMBOL", + "name": "function" + }, + { + "type": "SYMBOL", + "name": "const" + } + ] + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "const": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "const" + }, + { + "type": "SYMBOL", + "name": "constant" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + }, + "function": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "fun" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "variable" + } + }, + { + "type": "FIELD", + "name": "arguments", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "argument_list" + }, + { + "type": "BLANK" + } + ] + } + }, + { + "type": "FIELD", + "name": "type", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "type_definition" + }, + { + "type": "BLANK" + } + ] + } + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "statement" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "argument_list": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "argument" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "argument" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "argument": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "variable" + } + }, + { + "type": "FIELD", + "name": "type", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "type_definition" + }, + { + "type": "BLANK" + } + ] + } + } + ] + }, + "entity_name": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_entity_part" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "." + }, + { + "type": "SYMBOL", + "name": "_entity_part" + } + ] + } + }, + { + "type": "BLANK" + } + ] + } + ] + }, + "_entity_part": { + "type": "PATTERN", + "value": "[A-Z][a-zA-Z]+" + }, + "statement": { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "SYMBOL", + "name": "tuple_destructuring" + } + ] + } + }, + { + "type": "STRING", + "value": "=" + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + }, + "array": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "[" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "STRING", + "value": "]" + } + ] + }, + "tuple": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "inline_function": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "argument_list" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "type_definition" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "SYMBOL", + "name": "block" + } + ] + }, + "number": { + "type": "TOKEN", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "0" + }, + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "0" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "PATTERN", + "value": "[1-9]" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "_" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "PATTERN", + "value": "\\d(_?\\d)*" + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + } + ] + }, + { + "type": "STRING", + "value": "." + }, + { + "type": "CHOICE", + "members": [ + { + "type": "PATTERN", + "value": "\\d(_?\\d)*" + }, + { + "type": "BLANK" + } + ] + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "0" + }, + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "0" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "PATTERN", + "value": "[1-9]" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "_" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "PATTERN", + "value": "\\d(_?\\d)*" + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "PATTERN", + "value": "\\d(_?\\d)*" + } + ] + } + ] + } + }, + "_basic_expression": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "string" + }, + { + "type": "SYMBOL", + "name": "bool" + }, + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "SYMBOL", + "name": "entity_name" + }, + { + "type": "SYMBOL", + "name": "record" + }, + { + "type": "SYMBOL", + "name": "record_update" + }, + { + "type": "SYMBOL", + "name": "inline_javascript" + }, + { + "type": "SYMBOL", + "name": "inline_function" + }, + { + "type": "SYMBOL", + "name": "enum" + }, + { + "type": "SYMBOL", + "name": "tuple" + }, + { + "type": "SYMBOL", + "name": "number" + }, + { + "type": "SYMBOL", + "name": "case" + }, + { + "type": "SYMBOL", + "name": "constant" + }, + { + "type": "SYMBOL", + "name": "negation" + }, + { + "type": "SYMBOL", + "name": "operation" + }, + { + "type": "SYMBOL", + "name": "array" + }, + { + "type": "SYMBOL", + "name": "if" + }, + { + "type": "SYMBOL", + "name": "block" + } + ] + }, + "bool": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "true" + }, + { + "type": "STRING", + "value": "false" + } + ] + }, + "enum": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "entity_name" + }, + { + "type": "STRING", + "value": "::" + }, + { + "type": "SYMBOL", + "name": "entity_name" + } + ] + }, + "record_field": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + }, + "record": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "record_field" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "record_field" + } + ] + } + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "case_branch": { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "=>" + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + }, + "case": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "case" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "case_branch" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "if": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "if" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "STRING", + "value": "}" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "else" + }, + { + "type": "BLANK" + } + ] + } + ] + }, + "else": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "else" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "arguments": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "BLANK" + } + ] + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "_expression": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "call" + }, + { + "type": "SYMBOL", + "name": "member" + }, + { + "type": "SYMBOL", + "name": "access" + }, + { + "type": "SYMBOL", + "name": "_basic_expression" + } + ] + }, + "tuple_destructuring": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "variable" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "variable" + } + ] + } + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "block": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "statement" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "parenthesized_expression": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "SYMBOL", + "name": "_expression" + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "negation": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "!" + }, + { + "type": "SYMBOL", + "name": "_expression" + } + ] + }, + "operation": { + "type": "CHOICE", + "members": [ + { + "type": "PREC_LEFT", + "value": 0, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "|>" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 0, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "or" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 10, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "!=" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 10, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "==" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 11, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "<=" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 11, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "<" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 11, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": ">=" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 11, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": ">" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 13, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "-" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 13, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "+" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 14, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "*" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 14, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "/" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 14, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "%" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] + } + }, + { + "type": "PREC_LEFT", + "value": 15, + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, + { + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "**" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + } + ] } }, { - "type": "FIELD", - "name": "arguments", + "type": "PREC_LEFT", + "value": 6, "content": { - "type": "CHOICE", + "type": "SEQ", "members": [ { - "type": "SYMBOL", - "name": "argument_list" + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } }, { - "type": "BLANK" + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "&&" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } } ] } }, { - "type": "FIELD", - "name": "type", + "type": "PREC_LEFT", + "value": 5, "content": { - "type": "CHOICE", + "type": "SEQ", "members": [ { - "type": "SYMBOL", - "name": "type_definition" + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "_expression" + } }, { - "type": "BLANK" + "type": "FIELD", + "name": "operator", + "content": { + "type": "STRING", + "value": "||" + } + }, + { + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "_expression" + } } ] } + } + ] + }, + "member": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "entity", + "content": { + "type": "SYMBOL", + "name": "_expression" + } }, { "type": "STRING", - "value": "{" + "value": "." }, { - "type": "REPEAT", + "type": "FIELD", + "name": "variable", "content": { "type": "SYMBOL", - "name": "statement" + "name": "variable" } - }, - { - "type": "STRING", - "value": "}" } ] }, - "argument_list": { + "access": { "type": "SEQ", "members": [ + { + "type": "FIELD", + "name": "entity", + "content": { + "type": "SYMBOL", + "name": "_expression" + } + }, { "type": "STRING", - "value": "(" + "value": "[" }, { - "type": "CHOICE", - "members": [ - { - "type": "SEQ", - "members": [ - { - "type": "SYMBOL", - "name": "argument" - }, - { - "type": "REPEAT", - "content": { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "," - }, - { - "type": "SYMBOL", - "name": "argument" - } - ] - } - } - ] - }, - { - "type": "BLANK" - } - ] + "type": "FIELD", + "name": "variable", + "content": { + "type": "SYMBOL", + "name": "_expression" + } }, { "type": "STRING", - "value": ")" + "value": "]" } ] }, - "argument": { + "call": { "type": "SEQ", "members": [ { "type": "FIELD", - "name": "name", + "name": "epxression", "content": { "type": "SYMBOL", - "name": "variable" + "name": "_expression" } }, { "type": "FIELD", - "name": "type", + "name": "arguments", "content": { - "type": "CHOICE", - "members": [ - { - "type": "SYMBOL", - "name": "type_definition" - }, - { - "type": "BLANK" - } - ] + "type": "SYMBOL", + "name": "arguments" } } ] }, - "variable": { - "type": "PATTERN", - "value": "[a-z][a-zA-Z0-9]*" - }, - "entity_name": { + "interpolation": { "type": "SEQ", "members": [ + { + "type": "STRING", + "value": "#{" + }, { "type": "SYMBOL", - "name": "_entity_part" + "name": "_expression" }, { - "type": "CHOICE", - "members": [ - { - "type": "REPEAT", - "content": { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "." - }, - { - "type": "SYMBOL", - "name": "_entity_part" - } - ] - } - }, - { - "type": "BLANK" - } - ] + "type": "STRING", + "value": "}" } ] }, - "_entity_part": { - "type": "PATTERN", - "value": "[A-Z][a-zA-Z]+" - }, - "statement": { + "inline_javascript": { "type": "SEQ", "members": [ { - "type": "CHOICE", - "members": [ - { - "type": "SEQ", - "members": [ - { - "type": "FIELD", - "name": "name", - "content": { - "type": "SYMBOL", - "name": "variable" - } - }, - { - "type": "STRING", - "value": "=" - } - ] - }, - { - "type": "BLANK" - } - ] + "type": "STRING", + "value": "`" }, { - "type": "CHOICE", - "members": [ - { - "type": "SYMBOL", - "name": "inline_javascript" - }, - { - "type": "SYMBOL", - "name": "module_access" - } - ] + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "javascript_chars" + }, + { + "type": "SYMBOL", + "name": "interpolation" + } + ] + } + }, + { + "type": "STRING", + "value": "`" } ] }, - "module_access": { + "type_definition": { "type": "SEQ", "members": [ - { - "type": "SYMBOL", - "name": "entity_name" - }, { "type": "STRING", - "value": "." + "value": ":" }, { "type": "SYMBOL", - "name": "variable" + "name": "type" } ] }, - "inline_javascript": { + "string": { "type": "SEQ", "members": [ { "type": "STRING", - "value": "`" + "value": "\"" }, { - "type": "PATTERN", - "value": "[^`]*" + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "string_chars" + }, + { + "type": "SYMBOL", + "name": "interpolation" + } + ] + } }, { "type": "STRING", - "value": "`" - } - ] - }, - "type_definition": { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": ":" + "value": "\"" }, { - "type": "SYMBOL", - "name": "type" + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "\\" + }, + { + "type": "SYMBOL", + "name": "string" + } + ] + }, + { + "type": "BLANK" + } + ] } ] }, @@ -382,7 +2103,7 @@ "members": [ { "type": "SYMBOL", - "name": "_entity_part" + "name": "entity_name" }, { "type": "CHOICE", @@ -449,9 +2170,78 @@ "value": "\\s" } ], - "conflicts": [], + "conflicts": [ + [ + "entity_name" + ], + [ + "statement", + "call" + ], + [ + "case_branch", + "call" + ], + [ + "_basic_expression", + "tuple_destructuring" + ], + [ + "array", + "call" + ], + [ + "statement", + "record_field" + ], + [ + "call", + "negation" + ], + [ + "member", + "negation" + ], + [ + "operation", + "negation" + ], + [ + "tuple", + "block" + ], + [ + "tuple", + "statement" + ], + [ + "access", + "statement" + ], + [ + "access", + "array" + ], + [ + "access", + "negation" + ], + [ + "access", + "case_branch" + ] + ], "precedences": [], - "externals": [], + "externals": [ + { + "type": "SYMBOL", + "name": "string_chars" + }, + { + "type": "SYMBOL", + "name": "javascript_chars" + } + ], "inline": [], "supertypes": [] } diff --git a/grammar/src/node-types.json b/grammar/src/node-types.json index f52d60c8a..7d8b673a3 100644 --- a/grammar/src/node-types.json +++ b/grammar/src/node-types.json @@ -1,4 +1,190 @@ [ + { + "type": "access", + "named": true, + "fields": { + "entity": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + }, + "variable": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + } + }, { "type": "argument", "named": true, @@ -41,93 +227,2002 @@ } }, { - "type": "entity_name", + "type": "arguments", "named": true, - "fields": {} + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } }, { - "type": "function", + "type": "array", "named": true, - "fields": { - "arguments": { - "multiple": false, - "required": false, - "types": [ - { - "type": "argument_list", - "named": true - } - ] - }, - "name": { - "multiple": false, - "required": true, - "types": [ - { - "type": "variable", - "named": true - } - ] - }, - "type": { - "multiple": false, - "required": false, - "types": [ - { - "type": "type_definition", - "named": true - } - ] - } - }, + "fields": {}, "children": { "multiple": true, "required": false, "types": [ { - "type": "statement", + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "block", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "statement", + "named": true + } + ] + } + }, + { + "type": "bool", + "named": true, + "fields": {} + }, + { + "type": "call", + "named": true, + "fields": { + "arguments": { + "multiple": false, + "required": true, + "types": [ + { + "type": "arguments", + "named": true + } + ] + }, + "epxression": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + } + }, + { + "type": "case", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "case_branch", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "case_branch", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "component", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "comment", + "named": true + }, + { + "type": "const", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "function", + "named": true + }, + { + "type": "property", + "named": true + } + ] + } + }, + { + "type": "const", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "else", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "entity_name", + "named": true, + "fields": {} + }, + { + "type": "enum", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "entity_name", + "named": true + } + ] + } + }, + { + "type": "enum_definition", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "entity_name", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "comment", + "named": true + }, + { + "type": "type", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "function", + "named": true, + "fields": { + "arguments": { + "multiple": false, + "required": false, + "types": [ + { + "type": "argument_list", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "variable", + "named": true + } + ] + }, + "type": { + "multiple": false, + "required": false, + "types": [ + { + "type": "type_definition", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "statement", + "named": true + } + ] + } + }, + { + "type": "if", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "else", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "inline_function", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "argument_list", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "type_definition", + "named": true + } + ] + } + }, + { + "type": "inline_javascript", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "interpolation", + "named": true + }, + { + "type": "javascript_chars", + "named": true + } + ] + } + }, + { + "type": "interpolation", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "member", + "named": true, + "fields": { + "entity": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + }, + "variable": { + "multiple": false, + "required": true, + "types": [ + { + "type": "variable", + "named": true + } + ] + } + } + }, + { + "type": "module", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "entity_name", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "comment", + "named": true + }, + { + "type": "const", + "named": true + }, + { + "type": "function", + "named": true + } + ] + } + }, + { + "type": "negation", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "operation", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + }, + "operator": { + "multiple": false, + "required": true, + "types": [ + { + "type": "!=", + "named": false + }, + { + "type": "%", + "named": false + }, + { + "type": "&&", + "named": false + }, + { + "type": "*", + "named": false + }, + { + "type": "**", + "named": false + }, + { + "type": "+", + "named": false + }, + { + "type": "-", + "named": false + }, + { + "type": "/", + "named": false + }, + { + "type": "<", + "named": false + }, + { + "type": "<=", + "named": false + }, + { + "type": "==", + "named": false + }, + { + "type": ">", + "named": false + }, + { + "type": ">=", + "named": false + }, + { + "type": "or", + "named": false + }, + { + "type": "|>", + "named": false + }, + { + "type": "||", + "named": false + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + } + }, + { + "type": "program", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "comment", + "named": true + }, + { + "type": "component", + "named": true + }, + { + "type": "enum_definition", + "named": true + }, + { + "type": "module", + "named": true + }, + { + "type": "record_definition", + "named": true + } + ] + } + }, + { + "type": "property", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "type_definition", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "record", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "record_field", + "named": true + } + ] + } + }, + { + "type": "record_definition", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "entity_name", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "record_definition_field", + "named": true + } + ] + } + }, + { + "type": "record_definition_field", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "type_definition", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "record_field", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "record_update", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "record_field", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + { + "type": "statement", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": false, + "types": [ + { + "type": "tuple_destructuring", + "named": true + }, + { + "type": "variable", + "named": true + } + ] + } + }, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "access", + "named": true + }, + { + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", "named": true } ] } }, { - "type": "inline_javascript", - "named": true, - "fields": {} - }, - { - "type": "module", + "type": "string", "named": true, - "fields": { - "name": { - "multiple": false, - "required": true, - "types": [ - { - "type": "entity_name", - "named": true - } - ] - } - }, + "fields": {}, "children": { "multiple": true, "required": false, "types": [ { - "type": "comment", + "type": "interpolation", "named": true }, { - "type": "function", + "type": "string", + "named": true + }, + { + "type": "string_chars", "named": true } ] } }, { - "type": "program", + "type": "tuple", "named": true, "fields": {}, "children": { @@ -135,37 +2230,102 @@ "required": false, "types": [ { - "type": "comment", + "type": "access", "named": true }, { - "type": "module", + "type": "array", + "named": true + }, + { + "type": "block", + "named": true + }, + { + "type": "bool", + "named": true + }, + { + "type": "call", + "named": true + }, + { + "type": "case", + "named": true + }, + { + "type": "constant", + "named": true + }, + { + "type": "entity_name", + "named": true + }, + { + "type": "enum", + "named": true + }, + { + "type": "if", + "named": true + }, + { + "type": "inline_function", + "named": true + }, + { + "type": "inline_javascript", + "named": true + }, + { + "type": "member", + "named": true + }, + { + "type": "negation", + "named": true + }, + { + "type": "number", + "named": true + }, + { + "type": "operation", + "named": true + }, + { + "type": "record", + "named": true + }, + { + "type": "record_update", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "tuple", + "named": true + }, + { + "type": "variable", "named": true } ] } }, { - "type": "statement", + "type": "tuple_destructuring", "named": true, - "fields": { - "name": { - "multiple": false, - "required": false, - "types": [ - { - "type": "variable", - "named": true - } - ] - } - }, + "fields": {}, "children": { - "multiple": false, - "required": true, + "multiple": true, + "required": false, "types": [ { - "type": "inline_javascript", + "type": "variable", "named": true } ] @@ -177,8 +2337,12 @@ "fields": {}, "children": { "multiple": true, - "required": false, + "required": true, "types": [ + { + "type": "entity_name", + "named": true + }, { "type": "type", "named": true @@ -205,6 +2369,30 @@ ] } }, + { + "type": "!", + "named": false + }, + { + "type": "!=", + "named": false + }, + { + "type": "\"", + "named": false + }, + { + "type": "#{", + "named": false + }, + { + "type": "%", + "named": false + }, + { + "type": "&&", + "named": false + }, { "type": "(", "named": false @@ -213,38 +2401,158 @@ "type": ")", "named": false }, + { + "type": "*", + "named": false + }, + { + "type": "**", + "named": false + }, + { + "type": "+", + "named": false + }, { "type": ",", "named": false }, + { + "type": "-", + "named": false + }, { "type": ".", "named": false }, + { + "type": "/", + "named": false + }, { "type": ":", "named": false }, + { + "type": "::", + "named": false + }, + { + "type": "<", + "named": false + }, + { + "type": "<=", + "named": false + }, { "type": "=", "named": false }, + { + "type": "==", + "named": false + }, + { + "type": "=>", + "named": false + }, + { + "type": ">", + "named": false + }, + { + "type": ">=", + "named": false + }, + { + "type": "[", + "named": false + }, + { + "type": "\\", + "named": false + }, + { + "type": "]", + "named": false + }, { "type": "`", "named": false }, + { + "type": "case", + "named": false + }, { "type": "comment", "named": true }, + { + "type": "component", + "named": false + }, + { + "type": "const", + "named": false + }, + { + "type": "constant", + "named": true + }, + { + "type": "else", + "named": false + }, + { + "type": "enum", + "named": false + }, + { + "type": "false", + "named": false + }, { "type": "fun", "named": false }, + { + "type": "if", + "named": false + }, + { + "type": "javascript_chars", + "named": true + }, { "type": "module", "named": false }, + { + "type": "number", + "named": true + }, + { + "type": "or", + "named": false + }, + { + "type": "property", + "named": false + }, + { + "type": "record", + "named": false + }, + { + "type": "string_chars", + "named": true + }, + { + "type": "true", + "named": false + }, { "type": "variable", "named": true @@ -253,6 +2561,18 @@ "type": "{", "named": false }, + { + "type": "|", + "named": false + }, + { + "type": "|>", + "named": false + }, + { + "type": "||", + "named": false + }, { "type": "}", "named": false diff --git a/grammar/src/parser.c b/grammar/src/parser.c index dacd1def6..6f9fc8092 100644 --- a/grammar/src/parser.c +++ b/grammar/src/parser.c @@ -6,120 +6,357 @@ #endif #define LANGUAGE_VERSION 13 -#define STATE_COUNT 70 +#define STATE_COUNT 362 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 33 +#define SYMBOL_COUNT 112 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 16 -#define EXTERNAL_TOKEN_COUNT 0 -#define FIELD_COUNT 3 -#define MAX_ALIAS_SEQUENCE_LENGTH 7 -#define PRODUCTION_ID_COUNT 7 +#define TOKEN_COUNT 54 +#define EXTERNAL_TOKEN_COUNT 2 +#define FIELD_COUNT 9 +#define MAX_ALIAS_SEQUENCE_LENGTH 9 +#define PRODUCTION_ID_COUNT 10 enum { - sym_comment = 1, - anon_sym_module = 2, - anon_sym_LBRACE = 3, - anon_sym_RBRACE = 4, - anon_sym_fun = 5, - anon_sym_LPAREN = 6, - anon_sym_COMMA = 7, - anon_sym_RPAREN = 8, - sym_variable = 9, - anon_sym_DOT = 10, - sym__entity_part = 11, - anon_sym_EQ = 12, - anon_sym_BQUOTE = 13, - aux_sym_inline_javascript_token1 = 14, - anon_sym_COLON = 15, - sym_program = 16, - sym__top_level = 17, - sym_module = 18, - sym_function = 19, - sym_argument_list = 20, - sym_argument = 21, - sym_entity_name = 22, - sym_statement = 23, - sym_inline_javascript = 24, - sym_type_definition = 25, - sym_type = 26, - aux_sym_program_repeat1 = 27, - aux_sym_module_repeat1 = 28, - aux_sym_function_repeat1 = 29, - aux_sym_argument_list_repeat1 = 30, - aux_sym_entity_name_repeat1 = 31, - aux_sym_type_repeat1 = 32, + sym_variable = 1, + sym_constant = 2, + sym_comment = 3, + anon_sym_property = 4, + anon_sym_EQ = 5, + anon_sym_record = 6, + anon_sym_LBRACE = 7, + anon_sym_COMMA = 8, + anon_sym_RBRACE = 9, + anon_sym_PIPE = 10, + anon_sym_enum = 11, + anon_sym_LPAREN = 12, + anon_sym_RPAREN = 13, + anon_sym_component = 14, + anon_sym_module = 15, + anon_sym_const = 16, + anon_sym_fun = 17, + anon_sym_DOT = 18, + sym__entity_part = 19, + anon_sym_LBRACK = 20, + anon_sym_RBRACK = 21, + sym_number = 22, + anon_sym_true = 23, + anon_sym_false = 24, + anon_sym_COLON_COLON = 25, + anon_sym_EQ_GT = 26, + anon_sym_case = 27, + anon_sym_if = 28, + anon_sym_else = 29, + anon_sym_BANG = 30, + anon_sym_PIPE_GT = 31, + anon_sym_or = 32, + anon_sym_BANG_EQ = 33, + anon_sym_EQ_EQ = 34, + anon_sym_LT_EQ = 35, + anon_sym_LT = 36, + anon_sym_GT_EQ = 37, + anon_sym_GT = 38, + anon_sym_DASH = 39, + anon_sym_PLUS = 40, + anon_sym_STAR = 41, + anon_sym_SLASH = 42, + anon_sym_PERCENT = 43, + anon_sym_STAR_STAR = 44, + anon_sym_AMP_AMP = 45, + anon_sym_PIPE_PIPE = 46, + anon_sym_POUND_LBRACE = 47, + anon_sym_BQUOTE = 48, + anon_sym_COLON = 49, + anon_sym_DQUOTE = 50, + anon_sym_BSLASH = 51, + sym_string_chars = 52, + sym_javascript_chars = 53, + sym_program = 54, + sym__top_level = 55, + sym_property = 56, + sym_record_definition_field = 57, + sym_record_definition = 58, + sym_record_update = 59, + sym_enum_definition = 60, + sym_component = 61, + sym_module = 62, + sym_const = 63, + sym_function = 64, + sym_argument_list = 65, + sym_argument = 66, + sym_entity_name = 67, + sym_statement = 68, + sym_array = 69, + sym_tuple = 70, + sym_inline_function = 71, + sym__basic_expression = 72, + sym_bool = 73, + sym_enum = 74, + sym_record_field = 75, + sym_record = 76, + sym_case_branch = 77, + sym_case = 78, + sym_if = 79, + sym_else = 80, + sym_arguments = 81, + sym__expression = 82, + sym_tuple_destructuring = 83, + sym_block = 84, + sym_negation = 85, + sym_operation = 86, + sym_member = 87, + sym_access = 88, + sym_call = 89, + sym_interpolation = 90, + sym_inline_javascript = 91, + sym_type_definition = 92, + sym_string = 93, + sym_type = 94, + aux_sym_program_repeat1 = 95, + aux_sym_record_definition_repeat1 = 96, + aux_sym_record_update_repeat1 = 97, + aux_sym_enum_definition_repeat1 = 98, + aux_sym_enum_definition_repeat2 = 99, + aux_sym_component_repeat1 = 100, + aux_sym_module_repeat1 = 101, + aux_sym_function_repeat1 = 102, + aux_sym_argument_list_repeat1 = 103, + aux_sym_entity_name_repeat1 = 104, + aux_sym_array_repeat1 = 105, + aux_sym_tuple_repeat1 = 106, + aux_sym_case_repeat1 = 107, + aux_sym_arguments_repeat1 = 108, + aux_sym_inline_javascript_repeat1 = 109, + aux_sym_string_repeat1 = 110, + aux_sym_type_repeat1 = 111, }; static const char * const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", + [sym_variable] = "variable", + [sym_constant] = "constant", [sym_comment] = "comment", - [anon_sym_module] = "module", + [anon_sym_property] = "property", + [anon_sym_EQ] = "=", + [anon_sym_record] = "record", [anon_sym_LBRACE] = "{", + [anon_sym_COMMA] = ",", [anon_sym_RBRACE] = "}", - [anon_sym_fun] = "fun", + [anon_sym_PIPE] = "|", + [anon_sym_enum] = "enum", [anon_sym_LPAREN] = "(", - [anon_sym_COMMA] = ",", [anon_sym_RPAREN] = ")", - [sym_variable] = "variable", + [anon_sym_component] = "component", + [anon_sym_module] = "module", + [anon_sym_const] = "const", + [anon_sym_fun] = "fun", [anon_sym_DOT] = ".", [sym__entity_part] = "_entity_part", - [anon_sym_EQ] = "=", + [anon_sym_LBRACK] = "[", + [anon_sym_RBRACK] = "]", + [sym_number] = "number", + [anon_sym_true] = "true", + [anon_sym_false] = "false", + [anon_sym_COLON_COLON] = "::", + [anon_sym_EQ_GT] = "=>", + [anon_sym_case] = "case", + [anon_sym_if] = "if", + [anon_sym_else] = "else", + [anon_sym_BANG] = "!", + [anon_sym_PIPE_GT] = "|>", + [anon_sym_or] = "or", + [anon_sym_BANG_EQ] = "!=", + [anon_sym_EQ_EQ] = "==", + [anon_sym_LT_EQ] = "<=", + [anon_sym_LT] = "<", + [anon_sym_GT_EQ] = ">=", + [anon_sym_GT] = ">", + [anon_sym_DASH] = "-", + [anon_sym_PLUS] = "+", + [anon_sym_STAR] = "*", + [anon_sym_SLASH] = "/", + [anon_sym_PERCENT] = "%", + [anon_sym_STAR_STAR] = "**", + [anon_sym_AMP_AMP] = "&&", + [anon_sym_PIPE_PIPE] = "||", + [anon_sym_POUND_LBRACE] = "#{", [anon_sym_BQUOTE] = "`", - [aux_sym_inline_javascript_token1] = "inline_javascript_token1", [anon_sym_COLON] = ":", + [anon_sym_DQUOTE] = "\"", + [anon_sym_BSLASH] = "\\", + [sym_string_chars] = "string_chars", + [sym_javascript_chars] = "javascript_chars", [sym_program] = "program", [sym__top_level] = "_top_level", + [sym_property] = "property", + [sym_record_definition_field] = "record_definition_field", + [sym_record_definition] = "record_definition", + [sym_record_update] = "record_update", + [sym_enum_definition] = "enum_definition", + [sym_component] = "component", [sym_module] = "module", + [sym_const] = "const", [sym_function] = "function", [sym_argument_list] = "argument_list", [sym_argument] = "argument", [sym_entity_name] = "entity_name", [sym_statement] = "statement", + [sym_array] = "array", + [sym_tuple] = "tuple", + [sym_inline_function] = "inline_function", + [sym__basic_expression] = "_basic_expression", + [sym_bool] = "bool", + [sym_enum] = "enum", + [sym_record_field] = "record_field", + [sym_record] = "record", + [sym_case_branch] = "case_branch", + [sym_case] = "case", + [sym_if] = "if", + [sym_else] = "else", + [sym_arguments] = "arguments", + [sym__expression] = "_expression", + [sym_tuple_destructuring] = "tuple_destructuring", + [sym_block] = "block", + [sym_negation] = "negation", + [sym_operation] = "operation", + [sym_member] = "member", + [sym_access] = "access", + [sym_call] = "call", + [sym_interpolation] = "interpolation", [sym_inline_javascript] = "inline_javascript", [sym_type_definition] = "type_definition", + [sym_string] = "string", [sym_type] = "type", [aux_sym_program_repeat1] = "program_repeat1", + [aux_sym_record_definition_repeat1] = "record_definition_repeat1", + [aux_sym_record_update_repeat1] = "record_update_repeat1", + [aux_sym_enum_definition_repeat1] = "enum_definition_repeat1", + [aux_sym_enum_definition_repeat2] = "enum_definition_repeat2", + [aux_sym_component_repeat1] = "component_repeat1", [aux_sym_module_repeat1] = "module_repeat1", [aux_sym_function_repeat1] = "function_repeat1", [aux_sym_argument_list_repeat1] = "argument_list_repeat1", [aux_sym_entity_name_repeat1] = "entity_name_repeat1", + [aux_sym_array_repeat1] = "array_repeat1", + [aux_sym_tuple_repeat1] = "tuple_repeat1", + [aux_sym_case_repeat1] = "case_repeat1", + [aux_sym_arguments_repeat1] = "arguments_repeat1", + [aux_sym_inline_javascript_repeat1] = "inline_javascript_repeat1", + [aux_sym_string_repeat1] = "string_repeat1", [aux_sym_type_repeat1] = "type_repeat1", }; static const TSSymbol ts_symbol_map[] = { [ts_builtin_sym_end] = ts_builtin_sym_end, + [sym_variable] = sym_variable, + [sym_constant] = sym_constant, [sym_comment] = sym_comment, - [anon_sym_module] = anon_sym_module, + [anon_sym_property] = anon_sym_property, + [anon_sym_EQ] = anon_sym_EQ, + [anon_sym_record] = anon_sym_record, [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_RBRACE] = anon_sym_RBRACE, - [anon_sym_fun] = anon_sym_fun, + [anon_sym_PIPE] = anon_sym_PIPE, + [anon_sym_enum] = anon_sym_enum, [anon_sym_LPAREN] = anon_sym_LPAREN, - [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_RPAREN] = anon_sym_RPAREN, - [sym_variable] = sym_variable, + [anon_sym_component] = anon_sym_component, + [anon_sym_module] = anon_sym_module, + [anon_sym_const] = anon_sym_const, + [anon_sym_fun] = anon_sym_fun, [anon_sym_DOT] = anon_sym_DOT, [sym__entity_part] = sym__entity_part, - [anon_sym_EQ] = anon_sym_EQ, + [anon_sym_LBRACK] = anon_sym_LBRACK, + [anon_sym_RBRACK] = anon_sym_RBRACK, + [sym_number] = sym_number, + [anon_sym_true] = anon_sym_true, + [anon_sym_false] = anon_sym_false, + [anon_sym_COLON_COLON] = anon_sym_COLON_COLON, + [anon_sym_EQ_GT] = anon_sym_EQ_GT, + [anon_sym_case] = anon_sym_case, + [anon_sym_if] = anon_sym_if, + [anon_sym_else] = anon_sym_else, + [anon_sym_BANG] = anon_sym_BANG, + [anon_sym_PIPE_GT] = anon_sym_PIPE_GT, + [anon_sym_or] = anon_sym_or, + [anon_sym_BANG_EQ] = anon_sym_BANG_EQ, + [anon_sym_EQ_EQ] = anon_sym_EQ_EQ, + [anon_sym_LT_EQ] = anon_sym_LT_EQ, + [anon_sym_LT] = anon_sym_LT, + [anon_sym_GT_EQ] = anon_sym_GT_EQ, + [anon_sym_GT] = anon_sym_GT, + [anon_sym_DASH] = anon_sym_DASH, + [anon_sym_PLUS] = anon_sym_PLUS, + [anon_sym_STAR] = anon_sym_STAR, + [anon_sym_SLASH] = anon_sym_SLASH, + [anon_sym_PERCENT] = anon_sym_PERCENT, + [anon_sym_STAR_STAR] = anon_sym_STAR_STAR, + [anon_sym_AMP_AMP] = anon_sym_AMP_AMP, + [anon_sym_PIPE_PIPE] = anon_sym_PIPE_PIPE, + [anon_sym_POUND_LBRACE] = anon_sym_POUND_LBRACE, [anon_sym_BQUOTE] = anon_sym_BQUOTE, - [aux_sym_inline_javascript_token1] = aux_sym_inline_javascript_token1, [anon_sym_COLON] = anon_sym_COLON, + [anon_sym_DQUOTE] = anon_sym_DQUOTE, + [anon_sym_BSLASH] = anon_sym_BSLASH, + [sym_string_chars] = sym_string_chars, + [sym_javascript_chars] = sym_javascript_chars, [sym_program] = sym_program, [sym__top_level] = sym__top_level, + [sym_property] = sym_property, + [sym_record_definition_field] = sym_record_definition_field, + [sym_record_definition] = sym_record_definition, + [sym_record_update] = sym_record_update, + [sym_enum_definition] = sym_enum_definition, + [sym_component] = sym_component, [sym_module] = sym_module, + [sym_const] = sym_const, [sym_function] = sym_function, [sym_argument_list] = sym_argument_list, [sym_argument] = sym_argument, [sym_entity_name] = sym_entity_name, [sym_statement] = sym_statement, + [sym_array] = sym_array, + [sym_tuple] = sym_tuple, + [sym_inline_function] = sym_inline_function, + [sym__basic_expression] = sym__basic_expression, + [sym_bool] = sym_bool, + [sym_enum] = sym_enum, + [sym_record_field] = sym_record_field, + [sym_record] = sym_record, + [sym_case_branch] = sym_case_branch, + [sym_case] = sym_case, + [sym_if] = sym_if, + [sym_else] = sym_else, + [sym_arguments] = sym_arguments, + [sym__expression] = sym__expression, + [sym_tuple_destructuring] = sym_tuple_destructuring, + [sym_block] = sym_block, + [sym_negation] = sym_negation, + [sym_operation] = sym_operation, + [sym_member] = sym_member, + [sym_access] = sym_access, + [sym_call] = sym_call, + [sym_interpolation] = sym_interpolation, [sym_inline_javascript] = sym_inline_javascript, [sym_type_definition] = sym_type_definition, + [sym_string] = sym_string, [sym_type] = sym_type, [aux_sym_program_repeat1] = aux_sym_program_repeat1, + [aux_sym_record_definition_repeat1] = aux_sym_record_definition_repeat1, + [aux_sym_record_update_repeat1] = aux_sym_record_update_repeat1, + [aux_sym_enum_definition_repeat1] = aux_sym_enum_definition_repeat1, + [aux_sym_enum_definition_repeat2] = aux_sym_enum_definition_repeat2, + [aux_sym_component_repeat1] = aux_sym_component_repeat1, [aux_sym_module_repeat1] = aux_sym_module_repeat1, [aux_sym_function_repeat1] = aux_sym_function_repeat1, [aux_sym_argument_list_repeat1] = aux_sym_argument_list_repeat1, [aux_sym_entity_name_repeat1] = aux_sym_entity_name_repeat1, + [aux_sym_array_repeat1] = aux_sym_array_repeat1, + [aux_sym_tuple_repeat1] = aux_sym_tuple_repeat1, + [aux_sym_case_repeat1] = aux_sym_case_repeat1, + [aux_sym_arguments_repeat1] = aux_sym_arguments_repeat1, + [aux_sym_inline_javascript_repeat1] = aux_sym_inline_javascript_repeat1, + [aux_sym_string_repeat1] = aux_sym_string_repeat1, [aux_sym_type_repeat1] = aux_sym_type_repeat1, }; @@ -128,11 +365,27 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = true, }, + [sym_variable] = { + .visible = true, + .named = true, + }, + [sym_constant] = { + .visible = true, + .named = true, + }, [sym_comment] = { .visible = true, .named = true, }, - [anon_sym_module] = { + [anon_sym_property] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_record] = { .visible = true, .named = false, }, @@ -140,19 +393,23 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [anon_sym_COMMA] = { + .visible = true, + .named = false, + }, [anon_sym_RBRACE] = { .visible = true, .named = false, }, - [anon_sym_fun] = { + [anon_sym_PIPE] = { .visible = true, .named = false, }, - [anon_sym_LPAREN] = { + [anon_sym_enum] = { .visible = true, .named = false, }, - [anon_sym_COMMA] = { + [anon_sym_LPAREN] = { .visible = true, .named = false, }, @@ -160,9 +417,21 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [sym_variable] = { + [anon_sym_component] = { .visible = true, - .named = true, + .named = false, + }, + [anon_sym_module] = { + .visible = true, + .named = false, + }, + [anon_sym_const] = { + .visible = true, + .named = false, + }, + [anon_sym_fun] = { + .visible = true, + .named = false, }, [anon_sym_DOT] = { .visible = true, @@ -172,22 +441,142 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = true, }, - [anon_sym_EQ] = { + [anon_sym_LBRACK] = { .visible = true, .named = false, }, - [anon_sym_BQUOTE] = { + [anon_sym_RBRACK] = { .visible = true, .named = false, }, - [aux_sym_inline_javascript_token1] = { - .visible = false, + [sym_number] = { + .visible = true, + .named = true, + }, + [anon_sym_true] = { + .visible = true, + .named = false, + }, + [anon_sym_false] = { + .visible = true, + .named = false, + }, + [anon_sym_COLON_COLON] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ_GT] = { + .visible = true, + .named = false, + }, + [anon_sym_case] = { + .visible = true, + .named = false, + }, + [anon_sym_if] = { + .visible = true, + .named = false, + }, + [anon_sym_else] = { + .visible = true, + .named = false, + }, + [anon_sym_BANG] = { + .visible = true, + .named = false, + }, + [anon_sym_PIPE_GT] = { + .visible = true, + .named = false, + }, + [anon_sym_or] = { + .visible = true, + .named = false, + }, + [anon_sym_BANG_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_LT_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_LT] = { + .visible = true, + .named = false, + }, + [anon_sym_GT_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_GT] = { + .visible = true, + .named = false, + }, + [anon_sym_DASH] = { + .visible = true, + .named = false, + }, + [anon_sym_PLUS] = { + .visible = true, + .named = false, + }, + [anon_sym_STAR] = { + .visible = true, + .named = false, + }, + [anon_sym_SLASH] = { + .visible = true, + .named = false, + }, + [anon_sym_PERCENT] = { + .visible = true, + .named = false, + }, + [anon_sym_STAR_STAR] = { + .visible = true, + .named = false, + }, + [anon_sym_AMP_AMP] = { + .visible = true, + .named = false, + }, + [anon_sym_PIPE_PIPE] = { + .visible = true, + .named = false, + }, + [anon_sym_POUND_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_BQUOTE] = { + .visible = true, .named = false, }, [anon_sym_COLON] = { .visible = true, .named = false, }, + [anon_sym_DQUOTE] = { + .visible = true, + .named = false, + }, + [anon_sym_BSLASH] = { + .visible = true, + .named = false, + }, + [sym_string_chars] = { + .visible = true, + .named = true, + }, + [sym_javascript_chars] = { + .visible = true, + .named = true, + }, [sym_program] = { .visible = true, .named = true, @@ -196,10 +585,38 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = true, }, + [sym_property] = { + .visible = true, + .named = true, + }, + [sym_record_definition_field] = { + .visible = true, + .named = true, + }, + [sym_record_definition] = { + .visible = true, + .named = true, + }, + [sym_record_update] = { + .visible = true, + .named = true, + }, + [sym_enum_definition] = { + .visible = true, + .named = true, + }, + [sym_component] = { + .visible = true, + .named = true, + }, [sym_module] = { .visible = true, .named = true, }, + [sym_const] = { + .visible = true, + .named = true, + }, [sym_function] = { .visible = true, .named = true, @@ -220,6 +637,94 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_array] = { + .visible = true, + .named = true, + }, + [sym_tuple] = { + .visible = true, + .named = true, + }, + [sym_inline_function] = { + .visible = true, + .named = true, + }, + [sym__basic_expression] = { + .visible = false, + .named = true, + }, + [sym_bool] = { + .visible = true, + .named = true, + }, + [sym_enum] = { + .visible = true, + .named = true, + }, + [sym_record_field] = { + .visible = true, + .named = true, + }, + [sym_record] = { + .visible = true, + .named = true, + }, + [sym_case_branch] = { + .visible = true, + .named = true, + }, + [sym_case] = { + .visible = true, + .named = true, + }, + [sym_if] = { + .visible = true, + .named = true, + }, + [sym_else] = { + .visible = true, + .named = true, + }, + [sym_arguments] = { + .visible = true, + .named = true, + }, + [sym__expression] = { + .visible = false, + .named = true, + }, + [sym_tuple_destructuring] = { + .visible = true, + .named = true, + }, + [sym_block] = { + .visible = true, + .named = true, + }, + [sym_negation] = { + .visible = true, + .named = true, + }, + [sym_operation] = { + .visible = true, + .named = true, + }, + [sym_member] = { + .visible = true, + .named = true, + }, + [sym_access] = { + .visible = true, + .named = true, + }, + [sym_call] = { + .visible = true, + .named = true, + }, + [sym_interpolation] = { + .visible = true, + .named = true, + }, [sym_inline_javascript] = { .visible = true, .named = true, @@ -228,6 +733,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_string] = { + .visible = true, + .named = true, + }, [sym_type] = { .visible = true, .named = true, @@ -236,39 +745,95 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, - [aux_sym_module_repeat1] = { + [aux_sym_record_definition_repeat1] = { .visible = false, .named = false, }, - [aux_sym_function_repeat1] = { + [aux_sym_record_update_repeat1] = { .visible = false, .named = false, }, - [aux_sym_argument_list_repeat1] = { + [aux_sym_enum_definition_repeat1] = { .visible = false, .named = false, }, - [aux_sym_entity_name_repeat1] = { + [aux_sym_enum_definition_repeat2] = { .visible = false, .named = false, }, - [aux_sym_type_repeat1] = { + [aux_sym_component_repeat1] = { .visible = false, .named = false, }, -}; - -enum { - field_arguments = 1, - field_name = 2, - field_type = 3, -}; - -static const char * const ts_field_names[] = { - [0] = NULL, - [field_arguments] = "arguments", + [aux_sym_module_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_function_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_argument_list_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_entity_name_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_array_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_tuple_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_case_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_arguments_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_inline_javascript_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_string_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_type_repeat1] = { + .visible = false, + .named = false, + }, +}; + +enum { + field_arguments = 1, + field_entity = 2, + field_epxression = 3, + field_left = 4, + field_name = 5, + field_operator = 6, + field_right = 7, + field_type = 8, + field_variable = 9, +}; + +static const char * const ts_field_names[] = { + [0] = NULL, + [field_arguments] = "arguments", + [field_entity] = "entity", + [field_epxression] = "epxression", + [field_left] = "left", [field_name] = "name", + [field_operator] = "operator", + [field_right] = "right", [field_type] = "type", + [field_variable] = "variable", }; static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { @@ -277,7 +842,10 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [3] = {.index = 2, .length = 2}, [4] = {.index = 4, .length = 2}, [5] = {.index = 6, .length = 2}, - [6] = {.index = 8, .length = 3}, + [6] = {.index = 8, .length = 2}, + [7] = {.index = 10, .length = 2}, + [8] = {.index = 12, .length = 3}, + [9] = {.index = 15, .length = 3}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -286,15 +854,25 @@ static const TSFieldMapEntry ts_field_map_entries[] = { [1] = {field_name, 0}, [2] = + {field_arguments, 1}, + {field_epxression, 0}, + [4] = {field_name, 0}, {field_type, 1}, - [4] = + [6] = {field_arguments, 2}, {field_name, 1}, - [6] = + [8] = {field_name, 1}, {field_type, 2}, - [8] = + [10] = + {field_entity, 0}, + {field_variable, 2}, + [12] = + {field_left, 0}, + {field_operator, 1}, + {field_right, 2}, + [15] = {field_arguments, 2}, {field_name, 1}, {field_type, 3}, @@ -313,864 +891,11903 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(13); - if (lookahead == '(') ADVANCE(20); - if (lookahead == ')') ADVANCE(22); - if (lookahead == ',') ADVANCE(21); - if (lookahead == '.') ADVANCE(24); - if (lookahead == '/') ADVANCE(2); - if (lookahead == ':') ADVANCE(30); - if (lookahead == '=') ADVANCE(26); - if (lookahead == '`') ADVANCE(27); - if (lookahead == 'f') ADVANCE(10); - if (lookahead == 'm') ADVANCE(9); - if (lookahead == '{') ADVANCE(17); - if (lookahead == '}') ADVANCE(18); + if (eof) ADVANCE(69); + if (lookahead == '!') ADVANCE(127); + if (lookahead == '"') ADVANCE(150); + if (lookahead == '#') ADVANCE(64); + if (lookahead == '%') ADVANCE(142); + if (lookahead == '&') ADVANCE(6); + if (lookahead == '(') ADVANCE(100); + if (lookahead == ')') ADVANCE(101); + if (lookahead == '*') ADVANCE(139); + if (lookahead == '+') ADVANCE(138); + if (lookahead == ',') ADVANCE(96); + if (lookahead == '-') ADVANCE(137); + if (lookahead == '.') ADVANCE(106); + if (lookahead == '/') ADVANCE(141); + if (lookahead == '0') ADVANCE(110); + if (lookahead == ':') ADVANCE(149); + if (lookahead == '<') ADVANCE(134); + if (lookahead == '=') ADVANCE(93); + if (lookahead == '>') ADVANCE(136); + if (lookahead == '[') ADVANCE(108); + if (lookahead == '\\') ADVANCE(151); + if (lookahead == ']') ADVANCE(109); + if (lookahead == '`') ADVANCE(147); + if (lookahead == 'c') ADVANCE(16); + if (lookahead == 'e') ADVANCE(32); + if (lookahead == 'f') ADVANCE(17); + if (lookahead == 'i') ADVANCE(29); + if (lookahead == 'm') ADVANCE(40); + if (lookahead == 'o') ADVANCE(47); + if (lookahead == 'p') ADVANCE(48); + if (lookahead == 'r') ADVANCE(21); + if (lookahead == 't') ADVANCE(49); + if (lookahead == '{') ADVANCE(95); + if (lookahead == '|') ADVANCE(98); + if (lookahead == '}') ADVANCE(97); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) - if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(12); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111); + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(86); END_STATE(); case 1: - if (lookahead == ')') ADVANCE(22); - if (lookahead == '`') ADVANCE(27); - if (lookahead == '}') ADVANCE(18); + if (lookahead == '!') ADVANCE(127); + if (lookahead == '"') ADVANCE(150); + if (lookahead == '%') ADVANCE(142); + if (lookahead == '&') ADVANCE(6); + if (lookahead == '(') ADVANCE(100); + if (lookahead == ')') ADVANCE(101); + if (lookahead == '*') ADVANCE(139); + if (lookahead == '+') ADVANCE(138); + if (lookahead == ',') ADVANCE(96); + if (lookahead == '-') ADVANCE(137); + if (lookahead == '.') ADVANCE(106); + if (lookahead == '/') ADVANCE(140); + if (lookahead == '0') ADVANCE(110); + if (lookahead == ':') ADVANCE(148); + if (lookahead == '<') ADVANCE(134); + if (lookahead == '=') ADVANCE(92); + if (lookahead == '>') ADVANCE(136); + if (lookahead == '[') ADVANCE(108); + if (lookahead == '`') ADVANCE(147); + if (lookahead == 'c') ADVANCE(70); + if (lookahead == 'f') ADVANCE(71); + if (lookahead == 'i') ADVANCE(76); + if (lookahead == 'o') ADVANCE(80); + if (lookahead == 't') ADVANCE(79); + if (lookahead == '{') ADVANCE(95); + if (lookahead == '|') ADVANCE(98); + if (lookahead == '}') ADVANCE(97); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(1) - if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(12); - if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111); + if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(86); END_STATE(); case 2: - if (lookahead == '*') ADVANCE(4); - if (lookahead == '/') ADVANCE(15); + if (lookahead == '!') ADVANCE(127); + if (lookahead == '"') ADVANCE(150); + if (lookahead == '%') ADVANCE(142); + if (lookahead == '&') ADVANCE(6); + if (lookahead == '(') ADVANCE(100); + if (lookahead == '*') ADVANCE(139); + if (lookahead == '+') ADVANCE(138); + if (lookahead == ',') ADVANCE(96); + if (lookahead == '-') ADVANCE(137); + if (lookahead == '.') ADVANCE(106); + if (lookahead == '/') ADVANCE(140); + if (lookahead == '0') ADVANCE(110); + if (lookahead == ':') ADVANCE(11); + if (lookahead == '<') ADVANCE(134); + if (lookahead == '=') ADVANCE(13); + if (lookahead == '>') ADVANCE(136); + if (lookahead == '[') ADVANCE(108); + if (lookahead == '\\') ADVANCE(151); + if (lookahead == ']') ADVANCE(109); + if (lookahead == '`') ADVANCE(147); + if (lookahead == 'c') ADVANCE(70); + if (lookahead == 'f') ADVANCE(71); + if (lookahead == 'i') ADVANCE(76); + if (lookahead == 'o') ADVANCE(80); + if (lookahead == 't') ADVANCE(79); + if (lookahead == '{') ADVANCE(95); + if (lookahead == '|') ADVANCE(15); + if (lookahead == '}') ADVANCE(97); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(2) + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111); + if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(86); END_STATE(); case 3: - if (lookahead == '*') ADVANCE(3); - if (lookahead == '/') ADVANCE(14); - if (lookahead != 0) ADVANCE(4); + if (lookahead == '!') ADVANCE(127); + if (lookahead == '"') ADVANCE(150); + if (lookahead == '%') ADVANCE(142); + if (lookahead == '&') ADVANCE(6); + if (lookahead == '(') ADVANCE(100); + if (lookahead == '*') ADVANCE(139); + if (lookahead == '+') ADVANCE(138); + if (lookahead == ',') ADVANCE(96); + if (lookahead == '-') ADVANCE(137); + if (lookahead == '.') ADVANCE(106); + if (lookahead == '/') ADVANCE(140); + if (lookahead == '0') ADVANCE(110); + if (lookahead == '<') ADVANCE(134); + if (lookahead == '=') ADVANCE(13); + if (lookahead == '>') ADVANCE(136); + if (lookahead == '[') ADVANCE(108); + if (lookahead == ']') ADVANCE(109); + if (lookahead == '`') ADVANCE(147); + if (lookahead == 'c') ADVANCE(70); + if (lookahead == 'e') ADVANCE(78); + if (lookahead == 'f') ADVANCE(71); + if (lookahead == 'i') ADVANCE(76); + if (lookahead == 'o') ADVANCE(80); + if (lookahead == 't') ADVANCE(79); + if (lookahead == '{') ADVANCE(95); + if (lookahead == '|') ADVANCE(15); + if (lookahead == '}') ADVANCE(97); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(3) + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111); + if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(86); END_STATE(); case 4: - if (lookahead == '*') ADVANCE(3); - if (lookahead != 0) ADVANCE(4); + if (lookahead == '!') ADVANCE(126); + if (lookahead == '"') ADVANCE(150); + if (lookahead == '(') ADVANCE(100); + if (lookahead == ')') ADVANCE(101); + if (lookahead == ',') ADVANCE(96); + if (lookahead == '0') ADVANCE(110); + if (lookahead == ':') ADVANCE(148); + if (lookahead == '=') ADVANCE(14); + if (lookahead == '[') ADVANCE(108); + if (lookahead == ']') ADVANCE(109); + if (lookahead == '`') ADVANCE(147); + if (lookahead == 'c') ADVANCE(70); + if (lookahead == 'f') ADVANCE(71); + if (lookahead == 'i') ADVANCE(76); + if (lookahead == 't') ADVANCE(79); + if (lookahead == '{') ADVANCE(95); + if (lookahead == '}') ADVANCE(97); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(4) + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111); + if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(86); END_STATE(); case 5: - if (lookahead == 'd') ADVANCE(11); + if (lookahead == '!') ADVANCE(12); + if (lookahead == '%') ADVANCE(142); + if (lookahead == '&') ADVANCE(6); + if (lookahead == '(') ADVANCE(100); + if (lookahead == ')') ADVANCE(101); + if (lookahead == '*') ADVANCE(139); + if (lookahead == '+') ADVANCE(138); + if (lookahead == ',') ADVANCE(96); + if (lookahead == '-') ADVANCE(137); + if (lookahead == '.') ADVANCE(106); + if (lookahead == '/') ADVANCE(141); + if (lookahead == ':') ADVANCE(11); + if (lookahead == '<') ADVANCE(134); + if (lookahead == '=') ADVANCE(13); + if (lookahead == '>') ADVANCE(136); + if (lookahead == '[') ADVANCE(108); + if (lookahead == '\\') ADVANCE(151); + if (lookahead == ']') ADVANCE(109); + if (lookahead == 'c') ADVANCE(44); + if (lookahead == 'e') ADVANCE(31); + if (lookahead == 'f') ADVANCE(59); + if (lookahead == 'o') ADVANCE(47); + if (lookahead == 'p') ADVANCE(48); + if (lookahead == '|') ADVANCE(15); + if (lookahead == '}') ADVANCE(97); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(5) + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(68); END_STATE(); case 6: - if (lookahead == 'e') ADVANCE(16); + if (lookahead == '&') ADVANCE(144); END_STATE(); case 7: - if (lookahead == 'l') ADVANCE(6); + if (lookahead == '(') ADVANCE(100); + if (lookahead == ')') ADVANCE(101); + if (lookahead == ',') ADVANCE(96); + if (lookahead == '.') ADVANCE(106); + if (lookahead == '/') ADVANCE(8); + if (lookahead == '=') ADVANCE(91); + if (lookahead == '{') ADVANCE(95); + if (lookahead == '}') ADVANCE(97); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(7) + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(68); + if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); END_STATE(); case 8: - if (lookahead == 'n') ADVANCE(19); + if (lookahead == '*') ADVANCE(10); + if (lookahead == '/') ADVANCE(89); END_STATE(); case 9: - if (lookahead == 'o') ADVANCE(5); + if (lookahead == '*') ADVANCE(9); + if (lookahead == '/') ADVANCE(88); + if (lookahead != 0) ADVANCE(10); END_STATE(); case 10: - if (lookahead == 'u') ADVANCE(8); + if (lookahead == '*') ADVANCE(9); + if (lookahead != 0) ADVANCE(10); END_STATE(); case 11: - if (lookahead == 'u') ADVANCE(7); + if (lookahead == ':') ADVANCE(118); END_STATE(); case 12: - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(25); + if (lookahead == '=') ADVANCE(131); END_STATE(); case 13: - ACCEPT_TOKEN(ts_builtin_sym_end); + if (lookahead == '=') ADVANCE(132); + if (lookahead == '>') ADVANCE(119); END_STATE(); case 14: - ACCEPT_TOKEN(sym_comment); + if (lookahead == '>') ADVANCE(119); END_STATE(); case 15: - ACCEPT_TOKEN(sym_comment); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(15); + if (lookahead == '>') ADVANCE(128); + if (lookahead == '|') ADVANCE(145); END_STATE(); case 16: - ACCEPT_TOKEN(anon_sym_module); + if (lookahead == 'a') ADVANCE(53); + if (lookahead == 'o') ADVANCE(34); END_STATE(); case 17: - ACCEPT_TOKEN(anon_sym_LBRACE); + if (lookahead == 'a') ADVANCE(33); + if (lookahead == 'u') ADVANCE(36); END_STATE(); case 18: - ACCEPT_TOKEN(anon_sym_RBRACE); + if (lookahead == 'c') ADVANCE(43); END_STATE(); case 19: - ACCEPT_TOKEN(anon_sym_fun); + if (lookahead == 'd') ADVANCE(94); END_STATE(); case 20: - ACCEPT_TOKEN(anon_sym_LPAREN); + if (lookahead == 'd') ADVANCE(61); END_STATE(); case 21: - ACCEPT_TOKEN(anon_sym_COMMA); + if (lookahead == 'e') ADVANCE(18); END_STATE(); case 22: - ACCEPT_TOKEN(anon_sym_RPAREN); + if (lookahead == 'e') ADVANCE(120); END_STATE(); case 23: - ACCEPT_TOKEN(sym_variable); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); + if (lookahead == 'e') ADVANCE(124); END_STATE(); case 24: - ACCEPT_TOKEN(anon_sym_DOT); + if (lookahead == 'e') ADVANCE(114); END_STATE(); case 25: - ACCEPT_TOKEN(sym__entity_part); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(25); + if (lookahead == 'e') ADVANCE(116); END_STATE(); case 26: - ACCEPT_TOKEN(anon_sym_EQ); + if (lookahead == 'e') ADVANCE(103); END_STATE(); case 27: - ACCEPT_TOKEN(anon_sym_BQUOTE); + if (lookahead == 'e') ADVANCE(38); END_STATE(); case 28: - ACCEPT_TOKEN(aux_sym_inline_javascript_token1); + if (lookahead == 'e') ADVANCE(51); + END_STATE(); + case 29: + if (lookahead == 'f') ADVANCE(122); + END_STATE(); + case 30: + if (lookahead == 'l') ADVANCE(26); + END_STATE(); + case 31: + if (lookahead == 'l') ADVANCE(54); + END_STATE(); + case 32: + if (lookahead == 'l') ADVANCE(54); + if (lookahead == 'n') ADVANCE(60); + END_STATE(); + case 33: + if (lookahead == 'l') ADVANCE(55); + END_STATE(); + case 34: + if (lookahead == 'm') ADVANCE(45); + if (lookahead == 'n') ADVANCE(52); + END_STATE(); + case 35: + if (lookahead == 'm') ADVANCE(99); + END_STATE(); + case 36: + if (lookahead == 'n') ADVANCE(105); + END_STATE(); + case 37: + if (lookahead == 'n') ADVANCE(52); + END_STATE(); + case 38: + if (lookahead == 'n') ADVANCE(58); + END_STATE(); + case 39: + if (lookahead == 'n') ADVANCE(27); + END_STATE(); + case 40: + if (lookahead == 'o') ADVANCE(20); + END_STATE(); + case 41: + if (lookahead == 'o') ADVANCE(39); + END_STATE(); + case 42: + if (lookahead == 'o') ADVANCE(46); + END_STATE(); + case 43: + if (lookahead == 'o') ADVANCE(50); + END_STATE(); + case 44: + if (lookahead == 'o') ADVANCE(37); + END_STATE(); + case 45: + if (lookahead == 'p') ADVANCE(41); + END_STATE(); + case 46: + if (lookahead == 'p') ADVANCE(28); + END_STATE(); + case 47: + if (lookahead == 'r') ADVANCE(129); + END_STATE(); + case 48: + if (lookahead == 'r') ADVANCE(42); + END_STATE(); + case 49: + if (lookahead == 'r') ADVANCE(62); + END_STATE(); + case 50: + if (lookahead == 'r') ADVANCE(19); + END_STATE(); + case 51: + if (lookahead == 'r') ADVANCE(57); + END_STATE(); + case 52: + if (lookahead == 's') ADVANCE(56); + END_STATE(); + case 53: + if (lookahead == 's') ADVANCE(22); + END_STATE(); + case 54: + if (lookahead == 's') ADVANCE(23); + END_STATE(); + case 55: + if (lookahead == 's') ADVANCE(25); + END_STATE(); + case 56: + if (lookahead == 't') ADVANCE(104); + END_STATE(); + case 57: + if (lookahead == 't') ADVANCE(63); + END_STATE(); + case 58: + if (lookahead == 't') ADVANCE(102); + END_STATE(); + case 59: + if (lookahead == 'u') ADVANCE(36); + END_STATE(); + case 60: + if (lookahead == 'u') ADVANCE(35); + END_STATE(); + case 61: + if (lookahead == 'u') ADVANCE(30); + END_STATE(); + case 62: + if (lookahead == 'u') ADVANCE(24); + END_STATE(); + case 63: + if (lookahead == 'y') ADVANCE(90); + END_STATE(); + case 64: + if (lookahead == '{') ADVANCE(146); + END_STATE(); + case 65: if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || - lookahead == ' ') ADVANCE(28); - if (lookahead != 0 && - lookahead != '`') ADVANCE(29); + lookahead == ' ') SKIP(65) + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(87); END_STATE(); - case 29: - ACCEPT_TOKEN(aux_sym_inline_javascript_token1); + case 66: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(111); + END_STATE(); + case 67: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(112); + END_STATE(); + case 68: + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(107); + END_STATE(); + case 69: + ACCEPT_TOKEN(ts_builtin_sym_end); + END_STATE(); + case 70: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'a') ADVANCE(81); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 71: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'a') ADVANCE(77); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 72: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'e') ADVANCE(121); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 73: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'e') ADVANCE(115); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 74: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'e') ADVANCE(117); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 75: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'e') ADVANCE(125); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 76: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'f') ADVANCE(123); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 77: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'l') ADVANCE(82); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 78: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'l') ADVANCE(83); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 79: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'r') ADVANCE(84); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 80: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'r') ADVANCE(130); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 81: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 's') ADVANCE(72); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 82: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 's') ADVANCE(74); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 83: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 's') ADVANCE(75); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 84: + ACCEPT_TOKEN(sym_variable); + if (lookahead == 'u') ADVANCE(73); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 85: + ACCEPT_TOKEN(sym_variable); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 86: + ACCEPT_TOKEN(sym_constant); + if (('0' <= lookahead && lookahead <= '9') || + lookahead == '_') ADVANCE(87); + if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(86); + if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(107); + END_STATE(); + case 87: + ACCEPT_TOKEN(sym_constant); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_') ADVANCE(87); + END_STATE(); + case 88: + ACCEPT_TOKEN(sym_comment); + END_STATE(); + case 89: + ACCEPT_TOKEN(sym_comment); if (lookahead != 0 && - lookahead != '`') ADVANCE(29); + lookahead != '\n') ADVANCE(89); END_STATE(); - case 30: - ACCEPT_TOKEN(anon_sym_COLON); + case 90: + ACCEPT_TOKEN(anon_sym_property); END_STATE(); - default: - return false; - } -} - -static const TSLexMode ts_lex_modes[STATE_COUNT] = { - [0] = {.lex_state = 0}, - [1] = {.lex_state = 0}, - [2] = {.lex_state = 1}, - [3] = {.lex_state = 1}, - [4] = {.lex_state = 1}, - [5] = {.lex_state = 0}, - [6] = {.lex_state = 1}, - [7] = {.lex_state = 1}, - [8] = {.lex_state = 0}, - [9] = {.lex_state = 1}, - [10] = {.lex_state = 1}, - [11] = {.lex_state = 1}, - [12] = {.lex_state = 1}, - [13] = {.lex_state = 0}, - [14] = {.lex_state = 0}, - [15] = {.lex_state = 0}, - [16] = {.lex_state = 0}, - [17] = {.lex_state = 0}, - [18] = {.lex_state = 0}, - [19] = {.lex_state = 1}, - [20] = {.lex_state = 0}, - [21] = {.lex_state = 0}, - [22] = {.lex_state = 1}, - [23] = {.lex_state = 1}, - [24] = {.lex_state = 0}, - [25] = {.lex_state = 0}, - [26] = {.lex_state = 0}, - [27] = {.lex_state = 0}, - [28] = {.lex_state = 0}, - [29] = {.lex_state = 1}, - [30] = {.lex_state = 0}, - [31] = {.lex_state = 0}, - [32] = {.lex_state = 0}, - [33] = {.lex_state = 1}, - [34] = {.lex_state = 0}, - [35] = {.lex_state = 0}, - [36] = {.lex_state = 0}, - [37] = {.lex_state = 0}, - [38] = {.lex_state = 0}, - [39] = {.lex_state = 0}, - [40] = {.lex_state = 0}, - [41] = {.lex_state = 0}, - [42] = {.lex_state = 0}, - [43] = {.lex_state = 1}, - [44] = {.lex_state = 0}, - [45] = {.lex_state = 0}, - [46] = {.lex_state = 0}, - [47] = {.lex_state = 0}, - [48] = {.lex_state = 1}, - [49] = {.lex_state = 0}, - [50] = {.lex_state = 0}, - [51] = {.lex_state = 1}, - [52] = {.lex_state = 0}, - [53] = {.lex_state = 0}, - [54] = {.lex_state = 0}, - [55] = {.lex_state = 0}, - [56] = {.lex_state = 0}, - [57] = {.lex_state = 0}, - [58] = {.lex_state = 0}, - [59] = {.lex_state = 0}, - [60] = {.lex_state = 0}, - [61] = {.lex_state = 0}, - [62] = {.lex_state = 0}, - [63] = {.lex_state = 0}, - [64] = {.lex_state = 0}, - [65] = {.lex_state = 0}, - [66] = {.lex_state = 1}, - [67] = {.lex_state = 28}, - [68] = {.lex_state = 0}, - [69] = {.lex_state = 0}, -}; - -static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { - [0] = { - [ts_builtin_sym_end] = ACTIONS(1), - [sym_comment] = ACTIONS(1), - [anon_sym_module] = ACTIONS(1), - [anon_sym_LBRACE] = ACTIONS(1), - [anon_sym_RBRACE] = ACTIONS(1), - [anon_sym_fun] = ACTIONS(1), - [anon_sym_LPAREN] = ACTIONS(1), - [anon_sym_COMMA] = ACTIONS(1), - [anon_sym_RPAREN] = ACTIONS(1), - [anon_sym_DOT] = ACTIONS(1), - [sym__entity_part] = ACTIONS(1), - [anon_sym_EQ] = ACTIONS(1), - [anon_sym_BQUOTE] = ACTIONS(1), - [anon_sym_COLON] = ACTIONS(1), - }, - [1] = { - [sym_program] = STATE(65), - [sym__top_level] = STATE(5), - [sym_module] = STATE(5), - [aux_sym_program_repeat1] = STATE(5), - [ts_builtin_sym_end] = ACTIONS(3), - [sym_comment] = ACTIONS(5), - [anon_sym_module] = ACTIONS(7), - }, -}; - -static const uint16_t ts_small_parse_table[] = { - [0] = 5, - ACTIONS(9), 1, - anon_sym_RBRACE, - ACTIONS(11), 1, - sym_variable, - ACTIONS(13), 1, - anon_sym_BQUOTE, - STATE(29), 1, - sym_inline_javascript, - STATE(9), 2, - sym_statement, - aux_sym_function_repeat1, - [17] = 5, - ACTIONS(11), 1, - sym_variable, - ACTIONS(13), 1, - anon_sym_BQUOTE, + case 91: + ACCEPT_TOKEN(anon_sym_EQ); + END_STATE(); + case 92: + ACCEPT_TOKEN(anon_sym_EQ); + if (lookahead == '=') ADVANCE(132); + END_STATE(); + case 93: + ACCEPT_TOKEN(anon_sym_EQ); + if (lookahead == '=') ADVANCE(132); + if (lookahead == '>') ADVANCE(119); + END_STATE(); + case 94: + ACCEPT_TOKEN(anon_sym_record); + END_STATE(); + case 95: + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 96: + ACCEPT_TOKEN(anon_sym_COMMA); + END_STATE(); + case 97: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 98: + ACCEPT_TOKEN(anon_sym_PIPE); + if (lookahead == '>') ADVANCE(128); + if (lookahead == '|') ADVANCE(145); + END_STATE(); + case 99: + ACCEPT_TOKEN(anon_sym_enum); + END_STATE(); + case 100: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 101: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 102: + ACCEPT_TOKEN(anon_sym_component); + END_STATE(); + case 103: + ACCEPT_TOKEN(anon_sym_module); + END_STATE(); + case 104: + ACCEPT_TOKEN(anon_sym_const); + END_STATE(); + case 105: + ACCEPT_TOKEN(anon_sym_fun); + END_STATE(); + case 106: + ACCEPT_TOKEN(anon_sym_DOT); + END_STATE(); + case 107: + ACCEPT_TOKEN(sym__entity_part); + if (('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(107); + END_STATE(); + case 108: + ACCEPT_TOKEN(anon_sym_LBRACK); + END_STATE(); + case 109: + ACCEPT_TOKEN(anon_sym_RBRACK); + END_STATE(); + case 110: + ACCEPT_TOKEN(sym_number); + if (lookahead == '.') ADVANCE(113); + if (lookahead == '0') ADVANCE(112); + if (lookahead == '_') ADVANCE(67); + if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111); + END_STATE(); + case 111: + ACCEPT_TOKEN(sym_number); + if (lookahead == '.') ADVANCE(113); + if (lookahead == '_') ADVANCE(66); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(111); + END_STATE(); + case 112: + ACCEPT_TOKEN(sym_number); + if (lookahead == '_') ADVANCE(67); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(112); + END_STATE(); + case 113: + ACCEPT_TOKEN(sym_number); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(112); + END_STATE(); + case 114: + ACCEPT_TOKEN(anon_sym_true); + END_STATE(); + case 115: + ACCEPT_TOKEN(anon_sym_true); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 116: + ACCEPT_TOKEN(anon_sym_false); + END_STATE(); + case 117: + ACCEPT_TOKEN(anon_sym_false); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 118: + ACCEPT_TOKEN(anon_sym_COLON_COLON); + END_STATE(); + case 119: + ACCEPT_TOKEN(anon_sym_EQ_GT); + END_STATE(); + case 120: + ACCEPT_TOKEN(anon_sym_case); + END_STATE(); + case 121: + ACCEPT_TOKEN(anon_sym_case); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 122: + ACCEPT_TOKEN(anon_sym_if); + END_STATE(); + case 123: + ACCEPT_TOKEN(anon_sym_if); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 124: + ACCEPT_TOKEN(anon_sym_else); + END_STATE(); + case 125: + ACCEPT_TOKEN(anon_sym_else); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 126: + ACCEPT_TOKEN(anon_sym_BANG); + END_STATE(); + case 127: + ACCEPT_TOKEN(anon_sym_BANG); + if (lookahead == '=') ADVANCE(131); + END_STATE(); + case 128: + ACCEPT_TOKEN(anon_sym_PIPE_GT); + END_STATE(); + case 129: + ACCEPT_TOKEN(anon_sym_or); + END_STATE(); + case 130: + ACCEPT_TOKEN(anon_sym_or); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(85); + END_STATE(); + case 131: + ACCEPT_TOKEN(anon_sym_BANG_EQ); + END_STATE(); + case 132: + ACCEPT_TOKEN(anon_sym_EQ_EQ); + END_STATE(); + case 133: + ACCEPT_TOKEN(anon_sym_LT_EQ); + END_STATE(); + case 134: + ACCEPT_TOKEN(anon_sym_LT); + if (lookahead == '=') ADVANCE(133); + END_STATE(); + case 135: + ACCEPT_TOKEN(anon_sym_GT_EQ); + END_STATE(); + case 136: + ACCEPT_TOKEN(anon_sym_GT); + if (lookahead == '=') ADVANCE(135); + END_STATE(); + case 137: + ACCEPT_TOKEN(anon_sym_DASH); + END_STATE(); + case 138: + ACCEPT_TOKEN(anon_sym_PLUS); + END_STATE(); + case 139: + ACCEPT_TOKEN(anon_sym_STAR); + if (lookahead == '*') ADVANCE(143); + END_STATE(); + case 140: + ACCEPT_TOKEN(anon_sym_SLASH); + END_STATE(); + case 141: + ACCEPT_TOKEN(anon_sym_SLASH); + if (lookahead == '*') ADVANCE(10); + if (lookahead == '/') ADVANCE(89); + END_STATE(); + case 142: + ACCEPT_TOKEN(anon_sym_PERCENT); + END_STATE(); + case 143: + ACCEPT_TOKEN(anon_sym_STAR_STAR); + END_STATE(); + case 144: + ACCEPT_TOKEN(anon_sym_AMP_AMP); + END_STATE(); + case 145: + ACCEPT_TOKEN(anon_sym_PIPE_PIPE); + END_STATE(); + case 146: + ACCEPT_TOKEN(anon_sym_POUND_LBRACE); + END_STATE(); + case 147: + ACCEPT_TOKEN(anon_sym_BQUOTE); + END_STATE(); + case 148: + ACCEPT_TOKEN(anon_sym_COLON); + END_STATE(); + case 149: + ACCEPT_TOKEN(anon_sym_COLON); + if (lookahead == ':') ADVANCE(118); + END_STATE(); + case 150: + ACCEPT_TOKEN(anon_sym_DQUOTE); + END_STATE(); + case 151: + ACCEPT_TOKEN(anon_sym_BSLASH); + END_STATE(); + default: + return false; + } +} + +static const TSLexMode ts_lex_modes[STATE_COUNT] = { + [0] = {.lex_state = 0, .external_lex_state = 1}, + [1] = {.lex_state = 0}, + [2] = {.lex_state = 4}, + [3] = {.lex_state = 4}, + [4] = {.lex_state = 4}, + [5] = {.lex_state = 4}, + [6] = {.lex_state = 4}, + [7] = {.lex_state = 4}, + [8] = {.lex_state = 4}, + [9] = {.lex_state = 4}, + [10] = {.lex_state = 4}, + [11] = {.lex_state = 4}, + [12] = {.lex_state = 4}, + [13] = {.lex_state = 4}, + [14] = {.lex_state = 4}, + [15] = {.lex_state = 4}, + [16] = {.lex_state = 4}, + [17] = {.lex_state = 4}, + [18] = {.lex_state = 4}, + [19] = {.lex_state = 4}, + [20] = {.lex_state = 4}, + [21] = {.lex_state = 4}, + [22] = {.lex_state = 4}, + [23] = {.lex_state = 4}, + [24] = {.lex_state = 4}, + [25] = {.lex_state = 4}, + [26] = {.lex_state = 4}, + [27] = {.lex_state = 4}, + [28] = {.lex_state = 2}, + [29] = {.lex_state = 3}, + [30] = {.lex_state = 4}, + [31] = {.lex_state = 2}, + [32] = {.lex_state = 4}, + [33] = {.lex_state = 2}, + [34] = {.lex_state = 4}, + [35] = {.lex_state = 2}, + [36] = {.lex_state = 1}, + [37] = {.lex_state = 2}, + [38] = {.lex_state = 2}, + [39] = {.lex_state = 2}, + [40] = {.lex_state = 2}, + [41] = {.lex_state = 2}, + [42] = {.lex_state = 2}, + [43] = {.lex_state = 2}, + [44] = {.lex_state = 2}, + [45] = {.lex_state = 2}, + [46] = {.lex_state = 2}, + [47] = {.lex_state = 2}, + [48] = {.lex_state = 2}, + [49] = {.lex_state = 4}, + [50] = {.lex_state = 4}, + [51] = {.lex_state = 2}, + [52] = {.lex_state = 2}, + [53] = {.lex_state = 2}, + [54] = {.lex_state = 2}, + [55] = {.lex_state = 2}, + [56] = {.lex_state = 2}, + [57] = {.lex_state = 2}, + [58] = {.lex_state = 2}, + [59] = {.lex_state = 2}, + [60] = {.lex_state = 4}, + [61] = {.lex_state = 4}, + [62] = {.lex_state = 4}, + [63] = {.lex_state = 4}, + [64] = {.lex_state = 4}, + [65] = {.lex_state = 4}, + [66] = {.lex_state = 4}, + [67] = {.lex_state = 4}, + [68] = {.lex_state = 2}, + [69] = {.lex_state = 2}, + [70] = {.lex_state = 4}, + [71] = {.lex_state = 2}, + [72] = {.lex_state = 4}, + [73] = {.lex_state = 2}, + [74] = {.lex_state = 4}, + [75] = {.lex_state = 4}, + [76] = {.lex_state = 2}, + [77] = {.lex_state = 4}, + [78] = {.lex_state = 4}, + [79] = {.lex_state = 4}, + [80] = {.lex_state = 4}, + [81] = {.lex_state = 4}, + [82] = {.lex_state = 2}, + [83] = {.lex_state = 2}, + [84] = {.lex_state = 4}, + [85] = {.lex_state = 4}, + [86] = {.lex_state = 2}, + [87] = {.lex_state = 4}, + [88] = {.lex_state = 4}, + [89] = {.lex_state = 4}, + [90] = {.lex_state = 2}, + [91] = {.lex_state = 4}, + [92] = {.lex_state = 4}, + [93] = {.lex_state = 4}, + [94] = {.lex_state = 4}, + [95] = {.lex_state = 4}, + [96] = {.lex_state = 2}, + [97] = {.lex_state = 2}, + [98] = {.lex_state = 4}, + [99] = {.lex_state = 2}, + [100] = {.lex_state = 2}, + [101] = {.lex_state = 4}, + [102] = {.lex_state = 2}, + [103] = {.lex_state = 4}, + [104] = {.lex_state = 2}, + [105] = {.lex_state = 4}, + [106] = {.lex_state = 2}, + [107] = {.lex_state = 4}, + [108] = {.lex_state = 4}, + [109] = {.lex_state = 1}, + [110] = {.lex_state = 4}, + [111] = {.lex_state = 2}, + [112] = {.lex_state = 1}, + [113] = {.lex_state = 2}, + [114] = {.lex_state = 2}, + [115] = {.lex_state = 2}, + [116] = {.lex_state = 2}, + [117] = {.lex_state = 2}, + [118] = {.lex_state = 4}, + [119] = {.lex_state = 2}, + [120] = {.lex_state = 4}, + [121] = {.lex_state = 4}, + [122] = {.lex_state = 1}, + [123] = {.lex_state = 2}, + [124] = {.lex_state = 2}, + [125] = {.lex_state = 2}, + [126] = {.lex_state = 2}, + [127] = {.lex_state = 2}, + [128] = {.lex_state = 1}, + [129] = {.lex_state = 2}, + [130] = {.lex_state = 5}, + [131] = {.lex_state = 5}, + [132] = {.lex_state = 5}, + [133] = {.lex_state = 5}, + [134] = {.lex_state = 5}, + [135] = {.lex_state = 5}, + [136] = {.lex_state = 5}, + [137] = {.lex_state = 5}, + [138] = {.lex_state = 5}, + [139] = {.lex_state = 5}, + [140] = {.lex_state = 5}, + [141] = {.lex_state = 5}, + [142] = {.lex_state = 5}, + [143] = {.lex_state = 5}, + [144] = {.lex_state = 5}, + [145] = {.lex_state = 5}, + [146] = {.lex_state = 5}, + [147] = {.lex_state = 5}, + [148] = {.lex_state = 5}, + [149] = {.lex_state = 5}, + [150] = {.lex_state = 5}, + [151] = {.lex_state = 5}, + [152] = {.lex_state = 5}, + [153] = {.lex_state = 5}, + [154] = {.lex_state = 5}, + [155] = {.lex_state = 5}, + [156] = {.lex_state = 5}, + [157] = {.lex_state = 5}, + [158] = {.lex_state = 5}, + [159] = {.lex_state = 5}, + [160] = {.lex_state = 5}, + [161] = {.lex_state = 5}, + [162] = {.lex_state = 5}, + [163] = {.lex_state = 5}, + [164] = {.lex_state = 5}, + [165] = {.lex_state = 5}, + [166] = {.lex_state = 5}, + [167] = {.lex_state = 5}, + [168] = {.lex_state = 5}, + [169] = {.lex_state = 5}, + [170] = {.lex_state = 5}, + [171] = {.lex_state = 5}, + [172] = {.lex_state = 5}, + [173] = {.lex_state = 5}, + [174] = {.lex_state = 5}, + [175] = {.lex_state = 5}, + [176] = {.lex_state = 5}, + [177] = {.lex_state = 0}, + [178] = {.lex_state = 0}, + [179] = {.lex_state = 0}, + [180] = {.lex_state = 0}, + [181] = {.lex_state = 0}, + [182] = {.lex_state = 0}, + [183] = {.lex_state = 0}, + [184] = {.lex_state = 0}, + [185] = {.lex_state = 0}, + [186] = {.lex_state = 0}, + [187] = {.lex_state = 0}, + [188] = {.lex_state = 0}, + [189] = {.lex_state = 0}, + [190] = {.lex_state = 0}, + [191] = {.lex_state = 0}, + [192] = {.lex_state = 0}, + [193] = {.lex_state = 0}, + [194] = {.lex_state = 0}, + [195] = {.lex_state = 0}, + [196] = {.lex_state = 0}, + [197] = {.lex_state = 5}, + [198] = {.lex_state = 0}, + [199] = {.lex_state = 0}, + [200] = {.lex_state = 7}, + [201] = {.lex_state = 7}, + [202] = {.lex_state = 7}, + [203] = {.lex_state = 7}, + [204] = {.lex_state = 0}, + [205] = {.lex_state = 0}, + [206] = {.lex_state = 7}, + [207] = {.lex_state = 0}, + [208] = {.lex_state = 7}, + [209] = {.lex_state = 7}, + [210] = {.lex_state = 7}, + [211] = {.lex_state = 7}, + [212] = {.lex_state = 0}, + [213] = {.lex_state = 7}, + [214] = {.lex_state = 7}, + [215] = {.lex_state = 7}, + [216] = {.lex_state = 7}, + [217] = {.lex_state = 7}, + [218] = {.lex_state = 7}, + [219] = {.lex_state = 0}, + [220] = {.lex_state = 7}, + [221] = {.lex_state = 7}, + [222] = {.lex_state = 7}, + [223] = {.lex_state = 0}, + [224] = {.lex_state = 0}, + [225] = {.lex_state = 0}, + [226] = {.lex_state = 0}, + [227] = {.lex_state = 0}, + [228] = {.lex_state = 0}, + [229] = {.lex_state = 0}, + [230] = {.lex_state = 0}, + [231] = {.lex_state = 0}, + [232] = {.lex_state = 0}, + [233] = {.lex_state = 0}, + [234] = {.lex_state = 0}, + [235] = {.lex_state = 0}, + [236] = {.lex_state = 7}, + [237] = {.lex_state = 0, .external_lex_state = 2}, + [238] = {.lex_state = 0, .external_lex_state = 2}, + [239] = {.lex_state = 0, .external_lex_state = 2}, + [240] = {.lex_state = 0}, + [241] = {.lex_state = 0, .external_lex_state = 3}, + [242] = {.lex_state = 0}, + [243] = {.lex_state = 0}, + [244] = {.lex_state = 0}, + [245] = {.lex_state = 0, .external_lex_state = 3}, + [246] = {.lex_state = 0}, + [247] = {.lex_state = 4}, + [248] = {.lex_state = 0}, + [249] = {.lex_state = 0, .external_lex_state = 2}, + [250] = {.lex_state = 0, .external_lex_state = 3}, + [251] = {.lex_state = 0, .external_lex_state = 2}, + [252] = {.lex_state = 1}, + [253] = {.lex_state = 0, .external_lex_state = 3}, + [254] = {.lex_state = 0}, + [255] = {.lex_state = 0, .external_lex_state = 3}, + [256] = {.lex_state = 0}, + [257] = {.lex_state = 0}, + [258] = {.lex_state = 7}, + [259] = {.lex_state = 4}, + [260] = {.lex_state = 4}, + [261] = {.lex_state = 7}, + [262] = {.lex_state = 4}, + [263] = {.lex_state = 4}, + [264] = {.lex_state = 0}, + [265] = {.lex_state = 0}, + [266] = {.lex_state = 0}, + [267] = {.lex_state = 0}, + [268] = {.lex_state = 0}, + [269] = {.lex_state = 7}, + [270] = {.lex_state = 0}, + [271] = {.lex_state = 0}, + [272] = {.lex_state = 0}, + [273] = {.lex_state = 0}, + [274] = {.lex_state = 0}, + [275] = {.lex_state = 0}, + [276] = {.lex_state = 0}, + [277] = {.lex_state = 0}, + [278] = {.lex_state = 0}, + [279] = {.lex_state = 0}, + [280] = {.lex_state = 7}, + [281] = {.lex_state = 7}, + [282] = {.lex_state = 1}, + [283] = {.lex_state = 0}, + [284] = {.lex_state = 0}, + [285] = {.lex_state = 0}, + [286] = {.lex_state = 0}, + [287] = {.lex_state = 0}, + [288] = {.lex_state = 0}, + [289] = {.lex_state = 0}, + [290] = {.lex_state = 0}, + [291] = {.lex_state = 0, .external_lex_state = 3}, + [292] = {.lex_state = 0}, + [293] = {.lex_state = 0}, + [294] = {.lex_state = 0}, + [295] = {.lex_state = 0}, + [296] = {.lex_state = 0}, + [297] = {.lex_state = 0, .external_lex_state = 2}, + [298] = {.lex_state = 0}, + [299] = {.lex_state = 0}, + [300] = {.lex_state = 5}, + [301] = {.lex_state = 5}, + [302] = {.lex_state = 7}, + [303] = {.lex_state = 5}, + [304] = {.lex_state = 4}, + [305] = {.lex_state = 5}, + [306] = {.lex_state = 5}, + [307] = {.lex_state = 0}, + [308] = {.lex_state = 0}, + [309] = {.lex_state = 4}, + [310] = {.lex_state = 0}, + [311] = {.lex_state = 0}, + [312] = {.lex_state = 7}, + [313] = {.lex_state = 4}, + [314] = {.lex_state = 5}, + [315] = {.lex_state = 7}, + [316] = {.lex_state = 0}, + [317] = {.lex_state = 0}, + [318] = {.lex_state = 4}, + [319] = {.lex_state = 0}, + [320] = {.lex_state = 0}, + [321] = {.lex_state = 7}, + [322] = {.lex_state = 7}, + [323] = {.lex_state = 0}, + [324] = {.lex_state = 0}, + [325] = {.lex_state = 0}, + [326] = {.lex_state = 0}, + [327] = {.lex_state = 0}, + [328] = {.lex_state = 5}, + [329] = {.lex_state = 1}, + [330] = {.lex_state = 7}, + [331] = {.lex_state = 0}, + [332] = {.lex_state = 1}, + [333] = {.lex_state = 7}, + [334] = {.lex_state = 7}, + [335] = {.lex_state = 1}, + [336] = {.lex_state = 5}, + [337] = {.lex_state = 0}, + [338] = {.lex_state = 0}, + [339] = {.lex_state = 7}, + [340] = {.lex_state = 0}, + [341] = {.lex_state = 1}, + [342] = {.lex_state = 0}, + [343] = {.lex_state = 0}, + [344] = {.lex_state = 0}, + [345] = {.lex_state = 0}, + [346] = {.lex_state = 0}, + [347] = {.lex_state = 5}, + [348] = {.lex_state = 0}, + [349] = {.lex_state = 65}, + [350] = {.lex_state = 0}, + [351] = {.lex_state = 0}, + [352] = {.lex_state = 0}, + [353] = {.lex_state = 0}, + [354] = {.lex_state = 1}, + [355] = {.lex_state = 0}, + [356] = {.lex_state = 0}, + [357] = {.lex_state = 1}, + [358] = {.lex_state = 7}, + [359] = {.lex_state = 0}, + [360] = {.lex_state = 0}, + [361] = {.lex_state = 0}, +}; + +enum { + ts_external_token_string_chars = 0, + ts_external_token_javascript_chars = 1, +}; + +static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = { + [ts_external_token_string_chars] = sym_string_chars, + [ts_external_token_javascript_chars] = sym_javascript_chars, +}; + +static const bool ts_external_scanner_states[4][EXTERNAL_TOKEN_COUNT] = { + [1] = { + [ts_external_token_string_chars] = true, + [ts_external_token_javascript_chars] = true, + }, + [2] = { + [ts_external_token_string_chars] = true, + }, + [3] = { + [ts_external_token_javascript_chars] = true, + }, +}; + +static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { + [0] = { + [ts_builtin_sym_end] = ACTIONS(1), + [sym_constant] = ACTIONS(1), + [sym_comment] = ACTIONS(1), + [anon_sym_property] = ACTIONS(1), + [anon_sym_EQ] = ACTIONS(1), + [anon_sym_record] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_COMMA] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), + [anon_sym_PIPE] = ACTIONS(1), + [anon_sym_enum] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), + [anon_sym_component] = ACTIONS(1), + [anon_sym_module] = ACTIONS(1), + [anon_sym_const] = ACTIONS(1), + [anon_sym_fun] = ACTIONS(1), + [anon_sym_DOT] = ACTIONS(1), + [sym__entity_part] = ACTIONS(1), + [anon_sym_LBRACK] = ACTIONS(1), + [anon_sym_RBRACK] = ACTIONS(1), + [sym_number] = ACTIONS(1), + [anon_sym_true] = ACTIONS(1), + [anon_sym_false] = ACTIONS(1), + [anon_sym_COLON_COLON] = ACTIONS(1), + [anon_sym_EQ_GT] = ACTIONS(1), + [anon_sym_case] = ACTIONS(1), + [anon_sym_if] = ACTIONS(1), + [anon_sym_else] = ACTIONS(1), + [anon_sym_BANG] = ACTIONS(1), + [anon_sym_PIPE_GT] = ACTIONS(1), + [anon_sym_or] = ACTIONS(1), + [anon_sym_BANG_EQ] = ACTIONS(1), + [anon_sym_EQ_EQ] = ACTIONS(1), + [anon_sym_LT_EQ] = ACTIONS(1), + [anon_sym_LT] = ACTIONS(1), + [anon_sym_GT_EQ] = ACTIONS(1), + [anon_sym_GT] = ACTIONS(1), + [anon_sym_DASH] = ACTIONS(1), + [anon_sym_PLUS] = ACTIONS(1), + [anon_sym_STAR] = ACTIONS(1), + [anon_sym_SLASH] = ACTIONS(1), + [anon_sym_PERCENT] = ACTIONS(1), + [anon_sym_STAR_STAR] = ACTIONS(1), + [anon_sym_AMP_AMP] = ACTIONS(1), + [anon_sym_PIPE_PIPE] = ACTIONS(1), + [anon_sym_POUND_LBRACE] = ACTIONS(1), + [anon_sym_BQUOTE] = ACTIONS(1), + [anon_sym_COLON] = ACTIONS(1), + [anon_sym_DQUOTE] = ACTIONS(1), + [anon_sym_BSLASH] = ACTIONS(1), + [sym_string_chars] = ACTIONS(1), + [sym_javascript_chars] = ACTIONS(1), + }, + [1] = { + [sym_program] = STATE(352), + [sym__top_level] = STATE(198), + [sym_record_definition] = STATE(198), + [sym_enum_definition] = STATE(198), + [sym_component] = STATE(198), + [sym_module] = STATE(198), + [aux_sym_program_repeat1] = STATE(198), + [ts_builtin_sym_end] = ACTIONS(3), + [sym_comment] = ACTIONS(5), + [anon_sym_record] = ACTIONS(7), + [anon_sym_enum] = ACTIONS(9), + [anon_sym_component] = ACTIONS(11), + [anon_sym_module] = ACTIONS(13), + }, +}; + +static const uint16_t ts_small_parse_table[] = { + [0] = 20, ACTIONS(15), 1, - anon_sym_RBRACE, - STATE(29), 1, - sym_inline_javascript, - STATE(9), 2, - sym_statement, - aux_sym_function_repeat1, - [34] = 5, - ACTIONS(11), 1, sym_variable, - ACTIONS(13), 1, - anon_sym_BQUOTE, ACTIONS(17), 1, - anon_sym_RBRACE, - STATE(29), 1, - sym_inline_javascript, - STATE(9), 2, - sym_statement, - aux_sym_function_repeat1, - [51] = 4, - ACTIONS(7), 1, - anon_sym_module, + sym_constant, ACTIONS(19), 1, - ts_builtin_sym_end, + anon_sym_LBRACE, ACTIONS(21), 1, - sym_comment, - STATE(8), 3, - sym__top_level, - sym_module, - aux_sym_program_repeat1, - [66] = 5, - ACTIONS(11), 1, - sym_variable, - ACTIONS(13), 1, - anon_sym_BQUOTE, - ACTIONS(23), 1, anon_sym_RBRACE, - STATE(29), 1, - sym_inline_javascript, - STATE(3), 2, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(29), 1, + sym_number, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(285), 1, + sym_record_field, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(13), 2, sym_statement, aux_sym_function_repeat1, - [83] = 5, - ACTIONS(11), 1, - sym_variable, - ACTIONS(13), 1, - anon_sym_BQUOTE, + STATE(111), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [81] = 20, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(43), 1, + sym_variable, + ACTIONS(45), 1, + sym_constant, + ACTIONS(47), 1, anon_sym_RBRACE, - STATE(29), 1, - sym_inline_javascript, - STATE(9), 2, + ACTIONS(49), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(296), 1, + sym_record_field, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(19), 2, sym_statement, aux_sym_function_repeat1, - [100] = 4, + STATE(115), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [162] = 20, + ACTIONS(17), 1, + sym_constant, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, ACTIONS(27), 1, - ts_builtin_sym_end, + anon_sym_LBRACK, ACTIONS(29), 1, - sym_comment, - ACTIONS(32), 1, - anon_sym_module, - STATE(8), 3, - sym__top_level, - sym_module, - aux_sym_program_repeat1, - [115] = 5, + sym_number, + ACTIONS(33), 1, + anon_sym_case, ACTIONS(35), 1, - anon_sym_RBRACE, + anon_sym_if, ACTIONS(37), 1, - sym_variable, - ACTIONS(40), 1, + anon_sym_BANG, + ACTIONS(39), 1, anon_sym_BQUOTE, - STATE(29), 1, - sym_inline_javascript, - STATE(9), 2, - sym_statement, - aux_sym_function_repeat1, - [132] = 5, - ACTIONS(11), 1, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(51), 1, sym_variable, - ACTIONS(13), 1, - anon_sym_BQUOTE, - ACTIONS(43), 1, + ACTIONS(53), 1, anon_sym_RBRACE, - STATE(29), 1, - sym_inline_javascript, - STATE(4), 2, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(285), 1, + sym_record_field, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(13), 2, sym_statement, aux_sym_function_repeat1, - [149] = 5, - ACTIONS(11), 1, - sym_variable, - ACTIONS(13), 1, + STATE(111), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [243] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, anon_sym_BQUOTE, - ACTIONS(45), 1, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(59), 1, anon_sym_RBRACE, - STATE(29), 1, - sym_inline_javascript, - STATE(7), 2, + ACTIONS(61), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(13), 2, sym_statement, aux_sym_function_repeat1, - [166] = 5, - ACTIONS(11), 1, - sym_variable, - ACTIONS(13), 1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [321] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, anon_sym_BQUOTE, - ACTIONS(47), 1, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(63), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(18), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [399] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(65), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(20), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [477] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(67), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(19), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [555] = 18, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(73), 1, + anon_sym_RBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(79), 1, + sym_number, + ACTIONS(83), 1, + anon_sym_EQ_GT, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(69), 2, + sym_variable, + sym_constant, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + STATE(12), 2, + sym_case_branch, + aux_sym_case_repeat1, + STATE(197), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [631] = 18, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(79), 1, + sym_number, + ACTIONS(83), 1, + anon_sym_EQ_GT, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(95), 1, + anon_sym_RBRACE, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(69), 2, + sym_variable, + sym_constant, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + STATE(9), 2, + sym_case_branch, + aux_sym_case_repeat1, + STATE(197), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [707] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(97), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(21), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [785] = 18, + ACTIONS(102), 1, + anon_sym_LBRACE, + ACTIONS(105), 1, + anon_sym_RBRACE, + ACTIONS(107), 1, + anon_sym_LPAREN, + ACTIONS(110), 1, + sym__entity_part, + ACTIONS(113), 1, + anon_sym_LBRACK, + ACTIONS(116), 1, + sym_number, + ACTIONS(122), 1, + anon_sym_EQ_GT, + ACTIONS(125), 1, + anon_sym_case, + ACTIONS(128), 1, + anon_sym_if, + ACTIONS(131), 1, + anon_sym_BANG, + ACTIONS(134), 1, + anon_sym_BQUOTE, + ACTIONS(137), 1, + anon_sym_DQUOTE, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(99), 2, + sym_variable, + sym_constant, + ACTIONS(119), 2, + anon_sym_true, + anon_sym_false, + STATE(12), 2, + sym_case_branch, + aux_sym_case_repeat1, + STATE(197), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [861] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(140), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(14), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [939] = 19, + ACTIONS(142), 1, + sym_variable, + ACTIONS(145), 1, + sym_constant, + ACTIONS(148), 1, + anon_sym_LBRACE, + ACTIONS(151), 1, + anon_sym_RBRACE, + ACTIONS(153), 1, + anon_sym_LPAREN, + ACTIONS(156), 1, + sym__entity_part, + ACTIONS(159), 1, + anon_sym_LBRACK, + ACTIONS(162), 1, + sym_number, + ACTIONS(168), 1, + anon_sym_case, + ACTIONS(171), 1, + anon_sym_if, + ACTIONS(174), 1, + anon_sym_BANG, + ACTIONS(177), 1, + anon_sym_BQUOTE, + ACTIONS(180), 1, + anon_sym_DQUOTE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(165), 2, + anon_sym_true, + anon_sym_false, + STATE(14), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1017] = 18, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(79), 1, + sym_number, + ACTIONS(83), 1, + anon_sym_EQ_GT, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(183), 1, + anon_sym_RBRACE, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(69), 2, + sym_variable, + sym_constant, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + STATE(12), 2, + sym_case_branch, + aux_sym_case_repeat1, + STATE(197), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1093] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(185), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(14), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1171] = 18, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(79), 1, + sym_number, + ACTIONS(83), 1, + anon_sym_EQ_GT, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(187), 1, + anon_sym_RBRACE, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(69), 2, + sym_variable, + sym_constant, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + STATE(15), 2, + sym_case_branch, + aux_sym_case_repeat1, + STATE(197), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1247] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(189), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(14), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1325] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(191), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(14), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1403] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(193), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(14), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1481] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(195), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(14), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1559] = 19, + ACTIONS(19), 1, + anon_sym_LBRACE, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(55), 1, + sym_variable, + ACTIONS(57), 1, + sym_constant, + ACTIONS(61), 1, + sym_number, + ACTIONS(197), 1, + anon_sym_RBRACE, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + STATE(357), 1, + sym_tuple_destructuring, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + STATE(16), 2, + sym_statement, + aux_sym_function_repeat1, + STATE(129), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1637] = 18, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(201), 1, + anon_sym_COMMA, + ACTIONS(203), 1, + anon_sym_RPAREN, + ACTIONS(205), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + STATE(295), 1, + aux_sym_arguments_repeat1, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(199), 2, + sym_variable, + sym_constant, + STATE(181), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1712] = 18, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(201), 1, + anon_sym_COMMA, + ACTIONS(209), 1, + anon_sym_RPAREN, + ACTIONS(211), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + STATE(272), 1, + aux_sym_arguments_repeat1, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(207), 2, + sym_variable, + sym_constant, + STATE(180), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1787] = 17, + ACTIONS(216), 1, + anon_sym_LBRACE, + ACTIONS(219), 1, + anon_sym_LPAREN, + ACTIONS(222), 1, + sym__entity_part, + ACTIONS(225), 1, + anon_sym_LBRACK, + ACTIONS(228), 1, + anon_sym_RBRACK, + ACTIONS(230), 1, + sym_number, + ACTIONS(236), 1, + anon_sym_case, + ACTIONS(239), 1, + anon_sym_if, + ACTIONS(242), 1, + anon_sym_BANG, + ACTIONS(245), 1, + anon_sym_BQUOTE, + ACTIONS(248), 1, + anon_sym_DQUOTE, + STATE(25), 1, + aux_sym_array_repeat1, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(213), 2, + sym_variable, + sym_constant, + ACTIONS(233), 2, + anon_sym_true, + anon_sym_false, + STATE(127), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1859] = 17, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(255), 1, + anon_sym_RBRACK, + ACTIONS(257), 1, + sym_number, + STATE(25), 1, + aux_sym_array_repeat1, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(251), 2, + sym_variable, + sym_constant, + STATE(127), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [1931] = 16, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(263), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(259), 2, + sym_variable, + sym_constant, + ACTIONS(261), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + STATE(184), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [2001] = 4, + ACTIONS(269), 1, + anon_sym_DOT, + STATE(31), 1, + aux_sym_entity_name_repeat1, + ACTIONS(265), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(267), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_COLON_COLON, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2047] = 4, + ACTIONS(276), 1, + anon_sym_else, + STATE(114), 1, + sym_else, + ACTIONS(272), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(274), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2093] = 17, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(257), 1, + sym_number, + ACTIONS(278), 1, + anon_sym_RBRACK, + STATE(25), 1, + aux_sym_array_repeat1, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(251), 2, + sym_variable, + sym_constant, + STATE(127), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [2165] = 4, + ACTIONS(284), 1, + anon_sym_DOT, + STATE(33), 1, + aux_sym_entity_name_repeat1, + ACTIONS(280), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(282), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_COLON_COLON, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2211] = 17, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(257), 1, + sym_number, + ACTIONS(287), 1, + anon_sym_RBRACK, + STATE(30), 1, + aux_sym_array_repeat1, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(251), 2, + sym_variable, + sym_constant, + STATE(127), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [2283] = 4, + ACTIONS(293), 1, + anon_sym_DOT, + STATE(33), 1, + aux_sym_entity_name_repeat1, + ACTIONS(289), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(291), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_COLON_COLON, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2329] = 17, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(257), 1, + sym_number, + ACTIONS(296), 1, + anon_sym_RBRACK, + STATE(26), 1, + aux_sym_array_repeat1, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(251), 2, + sym_variable, + sym_constant, + STATE(127), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [2401] = 2, + ACTIONS(289), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(291), 24, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_COLON_COLON, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2442] = 7, + ACTIONS(300), 1, + anon_sym_EQ, + ACTIONS(304), 1, + anon_sym_COMMA, + ACTIONS(307), 1, + anon_sym_RBRACE, + ACTIONS(310), 1, + anon_sym_PIPE, + STATE(276), 1, + aux_sym_enum_definition_repeat1, + ACTIONS(298), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(302), 19, + anon_sym_LBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + sym_number, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2493] = 11, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(312), 9, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + ACTIONS(314), 13, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2552] = 10, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(312), 9, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + ACTIONS(314), 14, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2609] = 3, + STATE(59), 1, + sym_arguments, + ACTIONS(312), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(314), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2652] = 4, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + STATE(59), 1, + sym_arguments, + ACTIONS(312), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(314), 22, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2697] = 6, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + STATE(59), 1, + sym_arguments, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(312), 11, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + ACTIONS(314), 20, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2746] = 7, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + STATE(59), 1, + sym_arguments, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(312), 11, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + ACTIONS(314), 18, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2797] = 9, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + STATE(59), 1, + sym_arguments, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(312), 9, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + ACTIONS(314), 16, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2852] = 17, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(336), 1, + anon_sym_LPAREN, + ACTIONS(339), 1, + anon_sym_DOT, + ACTIONS(342), 1, + anon_sym_LBRACK, + ACTIONS(345), 1, + anon_sym_PIPE_GT, + ACTIONS(348), 1, + anon_sym_or, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(332), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + ACTIONS(334), 8, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2923] = 3, + ACTIONS(353), 1, + anon_sym_COLON_COLON, + ACTIONS(298), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(302), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [2966] = 3, + ACTIONS(359), 1, + anon_sym_BSLASH, + ACTIONS(355), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(357), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3009] = 3, + ACTIONS(365), 1, + anon_sym_BSLASH, + ACTIONS(361), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(363), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3052] = 12, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(312), 9, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + ACTIONS(314), 12, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3113] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(369), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(367), 2, + sym_variable, + sym_constant, + STATE(177), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [3179] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(373), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(371), 2, + sym_variable, + sym_constant, + STATE(183), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [3245] = 2, + ACTIONS(375), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(377), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3285] = 2, + ACTIONS(379), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(381), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3325] = 2, + ACTIONS(383), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(385), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3365] = 2, + ACTIONS(387), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(389), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3405] = 2, + ACTIONS(391), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(393), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3445] = 2, + ACTIONS(395), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(397), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3485] = 2, + ACTIONS(399), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(401), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3525] = 2, + ACTIONS(403), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(405), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3565] = 2, + ACTIONS(407), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(409), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [3605] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(413), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(411), 2, + sym_variable, + sym_constant, + STATE(37), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [3671] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(417), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(415), 2, + sym_variable, + sym_constant, + STATE(38), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [3737] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(421), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(419), 2, + sym_variable, + sym_constant, + STATE(39), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [3803] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(425), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(423), 2, + sym_variable, + sym_constant, + STATE(40), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [3869] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(429), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(427), 2, + sym_variable, + sym_constant, + STATE(41), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [3935] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(433), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(431), 2, + sym_variable, + sym_constant, + STATE(42), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4001] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(437), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(435), 2, + sym_variable, + sym_constant, + STATE(43), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4067] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(441), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(439), 2, + sym_variable, + sym_constant, + STATE(48), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4133] = 2, + ACTIONS(443), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(445), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [4173] = 2, + ACTIONS(447), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(449), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [4213] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(453), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(451), 2, + sym_variable, + sym_constant, + STATE(179), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4279] = 2, + ACTIONS(455), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(457), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [4319] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(461), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(459), 2, + sym_variable, + sym_constant, + STATE(125), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4385] = 2, + ACTIONS(463), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(466), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [4425] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(471), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(469), 2, + sym_variable, + sym_constant, + STATE(189), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4491] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(475), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(473), 2, + sym_variable, + sym_constant, + STATE(44), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4557] = 2, + ACTIONS(477), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(479), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [4597] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(483), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(481), 2, + sym_variable, + sym_constant, + STATE(192), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4663] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(487), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(485), 2, + sym_variable, + sym_constant, + STATE(195), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4729] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(491), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(489), 2, + sym_variable, + sym_constant, + STATE(193), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4795] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(495), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(493), 2, + sym_variable, + sym_constant, + STATE(190), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4861] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(499), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(497), 2, + sym_variable, + sym_constant, + STATE(191), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [4927] = 2, + ACTIONS(501), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(503), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [4967] = 2, + ACTIONS(505), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(507), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [5007] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(511), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(509), 2, + sym_variable, + sym_constant, + STATE(188), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5073] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(515), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(513), 2, + sym_variable, + sym_constant, + STATE(126), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5139] = 2, + ACTIONS(517), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(519), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [5179] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(523), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(521), 2, + sym_variable, + sym_constant, + STATE(143), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5245] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(527), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(525), 2, + sym_variable, + sym_constant, + STATE(123), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5311] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(531), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(529), 2, + sym_variable, + sym_constant, + STATE(136), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5377] = 2, + ACTIONS(533), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(535), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [5417] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(539), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(537), 2, + sym_variable, + sym_constant, + STATE(135), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5483] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(25), 1, + sym__entity_part, + ACTIONS(27), 1, + anon_sym_LBRACK, + ACTIONS(33), 1, + anon_sym_case, + ACTIONS(35), 1, + anon_sym_if, + ACTIONS(37), 1, + anon_sym_BANG, + ACTIONS(39), 1, + anon_sym_BQUOTE, + ACTIONS(41), 1, + anon_sym_DQUOTE, + ACTIONS(253), 1, + anon_sym_LBRACE, + ACTIONS(543), 1, + sym_number, + STATE(45), 1, + sym_entity_name, + STATE(259), 1, + sym_argument_list, + ACTIONS(31), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(541), 2, + sym_variable, + sym_constant, + STATE(124), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5549] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(547), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(545), 2, + sym_variable, + sym_constant, + STATE(178), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5615] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(551), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(549), 2, + sym_variable, + sym_constant, + STATE(187), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5681] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(555), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(553), 2, + sym_variable, + sym_constant, + STATE(134), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5747] = 2, + ACTIONS(557), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(559), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [5787] = 2, + ACTIONS(561), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(563), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [5827] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(567), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(565), 2, + sym_variable, + sym_constant, + STATE(138), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [5893] = 2, + ACTIONS(569), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(571), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [5933] = 2, + ACTIONS(573), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(575), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [5973] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(579), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(577), 2, + sym_variable, + sym_constant, + STATE(139), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [6039] = 2, + ACTIONS(581), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(583), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6079] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(587), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(585), 2, + sym_variable, + sym_constant, + STATE(140), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [6145] = 2, + ACTIONS(589), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(591), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6185] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(595), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(593), 2, + sym_variable, + sym_constant, + STATE(142), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [6251] = 2, + ACTIONS(597), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(599), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6291] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(603), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(601), 2, + sym_variable, + sym_constant, + STATE(137), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [6357] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(607), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(605), 2, + sym_variable, + sym_constant, + STATE(185), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [6423] = 4, + ACTIONS(300), 1, + anon_sym_EQ, + ACTIONS(310), 1, + anon_sym_PIPE, + ACTIONS(298), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(302), 21, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + sym_number, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6467] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(611), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(609), 2, + sym_variable, + sym_constant, + STATE(182), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [6533] = 20, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + ACTIONS(617), 1, + anon_sym_COMMA, + ACTIONS(619), 1, + anon_sym_RBRACE, + ACTIONS(622), 1, + anon_sym_LPAREN, + ACTIONS(625), 1, + anon_sym_DOT, + ACTIONS(627), 1, + anon_sym_LBRACK, + ACTIONS(630), 1, + anon_sym_PIPE_GT, + ACTIONS(632), 1, + anon_sym_or, + STATE(59), 1, + sym_arguments, + STATE(278), 1, + aux_sym_tuple_repeat1, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(615), 4, + anon_sym_LBRACE, + sym_number, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + ACTIONS(613), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + [6609] = 4, + ACTIONS(300), 1, + anon_sym_EQ, + ACTIONS(634), 1, + anon_sym_PIPE, + ACTIONS(298), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(302), 21, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + sym_number, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6653] = 2, + ACTIONS(636), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(638), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6693] = 2, + ACTIONS(640), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(642), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6733] = 20, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + ACTIONS(617), 1, + anon_sym_COMMA, + ACTIONS(622), 1, + anon_sym_LPAREN, + ACTIONS(625), 1, + anon_sym_DOT, + ACTIONS(627), 1, + anon_sym_LBRACK, + ACTIONS(630), 1, + anon_sym_PIPE_GT, + ACTIONS(632), 1, + anon_sym_or, + ACTIONS(644), 1, + anon_sym_RBRACE, + STATE(59), 1, + sym_arguments, + STATE(264), 1, + aux_sym_tuple_repeat1, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(615), 4, + anon_sym_LBRACE, + sym_number, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + ACTIONS(613), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + [6809] = 2, + ACTIONS(647), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(649), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6849] = 2, + ACTIONS(651), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(653), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6889] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(657), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(655), 2, + sym_variable, + sym_constant, + STATE(196), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [6955] = 2, + ACTIONS(659), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(661), 23, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + sym_number, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [6995] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(665), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(663), 2, + sym_variable, + sym_constant, + STATE(186), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [7061] = 15, + ACTIONS(23), 1, + anon_sym_LPAREN, + ACTIONS(71), 1, + anon_sym_LBRACE, + ACTIONS(75), 1, + sym__entity_part, + ACTIONS(77), 1, + anon_sym_LBRACK, + ACTIONS(85), 1, + anon_sym_case, + ACTIONS(87), 1, + anon_sym_if, + ACTIONS(89), 1, + anon_sym_BANG, + ACTIONS(91), 1, + anon_sym_BQUOTE, + ACTIONS(93), 1, + anon_sym_DQUOTE, + ACTIONS(669), 1, + sym_number, + STATE(141), 1, + sym_entity_name, + STATE(260), 1, + sym_argument_list, + ACTIONS(81), 2, + anon_sym_true, + anon_sym_false, + ACTIONS(667), 2, + sym_variable, + sym_constant, + STATE(194), 19, + sym_record_update, + sym_array, + sym_tuple, + sym_inline_function, + sym__basic_expression, + sym_bool, + sym_enum, + sym_record, + sym_case, + sym_if, + sym__expression, + sym_block, + sym_negation, + sym_operation, + sym_member, + sym_access, + sym_call, + sym_inline_javascript, + sym_string, + [7127] = 3, + ACTIONS(671), 1, + anon_sym_EQ, + ACTIONS(463), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(466), 21, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + sym_number, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [7168] = 17, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + ACTIONS(625), 1, + anon_sym_DOT, + ACTIONS(630), 1, + anon_sym_PIPE_GT, + ACTIONS(632), 1, + anon_sym_or, + ACTIONS(677), 1, + anon_sym_LPAREN, + ACTIONS(680), 1, + anon_sym_LBRACK, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(675), 6, + anon_sym_LBRACE, + anon_sym_RBRACE, + sym_number, + anon_sym_EQ_GT, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + ACTIONS(673), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + [7237] = 17, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + ACTIONS(625), 1, + anon_sym_DOT, + ACTIONS(630), 1, + anon_sym_PIPE_GT, + ACTIONS(632), 1, + anon_sym_or, + ACTIONS(687), 1, + anon_sym_LPAREN, + ACTIONS(690), 1, + anon_sym_LBRACK, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(685), 6, + anon_sym_LBRACE, + anon_sym_RBRACE, + sym_number, + anon_sym_EQ_GT, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + ACTIONS(683), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + [7306] = 19, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + ACTIONS(625), 1, + anon_sym_DOT, + ACTIONS(630), 1, + anon_sym_PIPE_GT, + ACTIONS(632), 1, + anon_sym_or, + ACTIONS(697), 1, + anon_sym_COMMA, + ACTIONS(699), 1, + anon_sym_RBRACE, + ACTIONS(702), 1, + anon_sym_LPAREN, + ACTIONS(705), 1, + anon_sym_LBRACK, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(695), 4, + anon_sym_LBRACE, + sym_number, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + ACTIONS(693), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + [7379] = 17, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + ACTIONS(625), 1, + anon_sym_DOT, + ACTIONS(630), 1, + anon_sym_PIPE_GT, + ACTIONS(632), 1, + anon_sym_or, + ACTIONS(702), 1, + anon_sym_LPAREN, + ACTIONS(705), 1, + anon_sym_LBRACK, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(695), 5, + anon_sym_LBRACE, + anon_sym_RBRACE, + sym_number, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + ACTIONS(693), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + [7447] = 17, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + ACTIONS(625), 1, + anon_sym_DOT, + ACTIONS(630), 1, + anon_sym_PIPE_GT, + ACTIONS(632), 1, + anon_sym_or, + ACTIONS(712), 1, + anon_sym_LPAREN, + ACTIONS(715), 1, + anon_sym_LBRACK, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(710), 5, + anon_sym_LBRACE, + anon_sym_RBRACK, + sym_number, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + ACTIONS(708), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + [7515] = 3, + ACTIONS(718), 1, + anon_sym_EQ, + ACTIONS(298), 12, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + anon_sym_or, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + ACTIONS(302), 20, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_DOT, + anon_sym_LBRACK, + sym_number, + anon_sym_PIPE_GT, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_SLASH, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + [7555] = 17, + ACTIONS(324), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_STAR_STAR, + ACTIONS(330), 1, + anon_sym_AMP_AMP, + ACTIONS(351), 1, + anon_sym_PIPE_PIPE, + ACTIONS(622), 1, + anon_sym_LPAREN, + ACTIONS(625), 1, + anon_sym_DOT, + ACTIONS(627), 1, + anon_sym_LBRACK, + ACTIONS(630), 1, + anon_sym_PIPE_GT, + ACTIONS(632), 1, + anon_sym_or, + STATE(59), 1, + sym_arguments, + ACTIONS(316), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(318), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(320), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(322), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(326), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(615), 5, + anon_sym_LBRACE, + anon_sym_RBRACE, + sym_number, + anon_sym_BQUOTE, + anon_sym_DQUOTE, + ACTIONS(613), 8, + sym_variable, + sym_constant, + sym__entity_part, + anon_sym_true, + anon_sym_false, + anon_sym_case, + anon_sym_if, + anon_sym_BANG, + [7623] = 4, + ACTIONS(720), 1, + anon_sym_else, + STATE(162), 1, + sym_else, + ACTIONS(272), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(274), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [7662] = 4, + ACTIONS(722), 1, + anon_sym_DOT, + STATE(132), 1, + aux_sym_entity_name_repeat1, + ACTIONS(265), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(267), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_COLON_COLON, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [7701] = 4, + ACTIONS(725), 1, + anon_sym_DOT, + STATE(133), 1, + aux_sym_entity_name_repeat1, + ACTIONS(280), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(282), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_COLON_COLON, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [7740] = 4, + ACTIONS(728), 1, + anon_sym_DOT, + STATE(133), 1, + aux_sym_entity_name_repeat1, + ACTIONS(289), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(291), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_COLON_COLON, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [7779] = 3, + STATE(149), 1, + sym_arguments, + ACTIONS(312), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(314), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [7815] = 9, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(314), 16, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [7863] = 10, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(314), 15, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_PIPE_PIPE, + [7913] = 11, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(314), 14, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + [7965] = 4, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + STATE(149), 1, + sym_arguments, + ACTIONS(312), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(314), 23, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8003] = 6, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + STATE(149), 1, + sym_arguments, + ACTIONS(312), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(314), 22, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8045] = 7, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + STATE(149), 1, + sym_arguments, + ACTIONS(312), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(314), 20, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8089] = 3, + ACTIONS(749), 1, + anon_sym_COLON_COLON, + ACTIONS(298), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(302), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8125] = 8, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + STATE(149), 1, + sym_arguments, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(314), 18, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8171] = 15, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(751), 1, + anon_sym_LPAREN, + ACTIONS(754), 1, + anon_sym_DOT, + ACTIONS(757), 1, + anon_sym_LBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(760), 2, + anon_sym_PIPE_GT, + anon_sym_or, + ACTIONS(334), 9, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_RBRACK, + anon_sym_EQ_GT, + [8231] = 3, + ACTIONS(763), 1, + anon_sym_BSLASH, + ACTIONS(361), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(363), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8267] = 3, + ACTIONS(765), 1, + anon_sym_BSLASH, + ACTIONS(355), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(357), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8303] = 2, + ACTIONS(289), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(291), 25, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_COLON_COLON, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8337] = 2, + ACTIONS(379), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(381), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8370] = 2, + ACTIONS(581), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(583), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8403] = 2, + ACTIONS(407), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(409), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8436] = 2, + ACTIONS(561), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(563), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8469] = 2, + ACTIONS(636), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(638), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8502] = 2, + ACTIONS(557), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(559), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8535] = 2, + ACTIONS(651), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(653), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8568] = 2, + ACTIONS(647), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(649), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8601] = 2, + ACTIONS(597), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(599), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8634] = 2, + ACTIONS(533), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(535), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8667] = 2, + ACTIONS(589), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(591), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8700] = 2, + ACTIONS(517), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(519), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8733] = 2, + ACTIONS(477), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(479), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8766] = 2, + ACTIONS(505), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(507), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8799] = 2, + ACTIONS(659), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(661), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8832] = 2, + ACTIONS(640), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(642), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8865] = 2, + ACTIONS(403), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(405), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8898] = 2, + ACTIONS(573), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(575), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8931] = 2, + ACTIONS(463), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(466), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8964] = 2, + ACTIONS(399), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(401), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [8997] = 2, + ACTIONS(455), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(457), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9030] = 2, + ACTIONS(395), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(397), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9063] = 2, + ACTIONS(391), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(393), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9096] = 2, + ACTIONS(443), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(445), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9129] = 2, + ACTIONS(501), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(503), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9162] = 2, + ACTIONS(569), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(571), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9195] = 2, + ACTIONS(447), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(449), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9228] = 2, + ACTIONS(387), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(389), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9261] = 2, + ACTIONS(375), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(377), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9294] = 2, + ACTIONS(383), 4, + anon_sym_LT, + anon_sym_GT, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(385), 24, + sym_comment, + anon_sym_property, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_const, + anon_sym_fun, + anon_sym_DOT, + anon_sym_LBRACK, + anon_sym_RBRACK, + anon_sym_EQ_GT, + anon_sym_PIPE_GT, + anon_sym_or, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + anon_sym_DASH, + anon_sym_PLUS, + anon_sym_PERCENT, + anon_sym_STAR_STAR, + anon_sym_AMP_AMP, + anon_sym_PIPE_PIPE, + [9327] = 15, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + ACTIONS(767), 5, + sym_comment, + anon_sym_property, + anon_sym_RBRACE, + anon_sym_const, + anon_sym_fun, + [9383] = 15, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + ACTIONS(777), 5, + sym_comment, + anon_sym_property, + anon_sym_RBRACE, + anon_sym_const, + anon_sym_fun, + [9439] = 15, + ACTIONS(741), 1, + anon_sym_PERCENT, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(739), 2, + anon_sym_STAR, + anon_sym_SLASH, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + ACTIONS(779), 5, + sym_comment, + anon_sym_property, + anon_sym_RBRACE, + anon_sym_const, + anon_sym_fun, + [9495] = 17, + ACTIONS(201), 1, + anon_sym_COMMA, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(781), 1, + anon_sym_RPAREN, + STATE(149), 1, + sym_arguments, + STATE(270), 1, + aux_sym_arguments_repeat1, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [9553] = 17, + ACTIONS(201), 1, + anon_sym_COMMA, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(783), 1, + anon_sym_RPAREN, + STATE(149), 1, + sym_arguments, + STATE(293), 1, + aux_sym_arguments_repeat1, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [9611] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + ACTIONS(785), 2, + anon_sym_COMMA, + anon_sym_RBRACE, + [9664] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(697), 2, + anon_sym_COMMA, + anon_sym_RBRACE, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [9717] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + ACTIONS(787), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [9770] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(789), 1, + anon_sym_RBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [9822] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(791), 1, + anon_sym_RPAREN, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [9874] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(793), 1, + anon_sym_RBRACE, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [9926] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(795), 1, + anon_sym_RBRACE, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [9978] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(797), 1, + anon_sym_RPAREN, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10030] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(799), 1, + anon_sym_RBRACK, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10082] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(801), 1, + anon_sym_RBRACE, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10134] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(803), 1, + anon_sym_RPAREN, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10186] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(805), 1, + anon_sym_RBRACE, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10238] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(807), 1, + anon_sym_RPAREN, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10290] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(809), 1, + anon_sym_RBRACE, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10342] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(811), 1, + anon_sym_RBRACE, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10394] = 15, + ACTIONS(739), 1, + anon_sym_STAR, + ACTIONS(743), 1, + anon_sym_STAR_STAR, + ACTIONS(745), 1, + anon_sym_AMP_AMP, + ACTIONS(747), 1, + anon_sym_PIPE_PIPE, + ACTIONS(769), 1, + anon_sym_LPAREN, + ACTIONS(771), 1, + anon_sym_DOT, + ACTIONS(773), 1, + anon_sym_LBRACK, + ACTIONS(813), 1, + anon_sym_EQ_GT, + STATE(149), 1, + sym_arguments, + ACTIONS(731), 2, + anon_sym_BANG_EQ, + anon_sym_EQ_EQ, + ACTIONS(733), 2, + anon_sym_LT_EQ, + anon_sym_GT_EQ, + ACTIONS(735), 2, + anon_sym_LT, + anon_sym_GT, + ACTIONS(737), 2, + anon_sym_DASH, + anon_sym_PLUS, + ACTIONS(741), 2, + anon_sym_SLASH, + anon_sym_PERCENT, + ACTIONS(775), 2, + anon_sym_PIPE_GT, + anon_sym_or, + [10446] = 7, + ACTIONS(7), 1, + anon_sym_record, + ACTIONS(9), 1, + anon_sym_enum, + ACTIONS(11), 1, + anon_sym_component, + ACTIONS(13), 1, + anon_sym_module, + ACTIONS(815), 1, + ts_builtin_sym_end, + ACTIONS(817), 1, + sym_comment, + STATE(199), 6, + sym__top_level, + sym_record_definition, + sym_enum_definition, + sym_component, + sym_module, + aux_sym_program_repeat1, + [10473] = 7, + ACTIONS(819), 1, + ts_builtin_sym_end, + ACTIONS(821), 1, + sym_comment, + ACTIONS(824), 1, + anon_sym_record, + ACTIONS(827), 1, + anon_sym_enum, + ACTIONS(830), 1, + anon_sym_component, + ACTIONS(833), 1, + anon_sym_module, + STATE(199), 6, + sym__top_level, + sym_record_definition, + sym_enum_definition, + sym_component, + sym_module, + aux_sym_program_repeat1, + [10500] = 3, + ACTIONS(836), 1, + anon_sym_DOT, + STATE(201), 1, + aux_sym_entity_name_repeat1, + ACTIONS(267), 9, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + sym__entity_part, + [10518] = 3, + ACTIONS(836), 1, + anon_sym_DOT, + STATE(202), 1, + aux_sym_entity_name_repeat1, + ACTIONS(282), 9, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + sym__entity_part, + [10536] = 3, + ACTIONS(838), 1, + anon_sym_DOT, + STATE(202), 1, + aux_sym_entity_name_repeat1, + ACTIONS(291), 9, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + sym__entity_part, + [10554] = 1, + ACTIONS(291), 10, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_LPAREN, + anon_sym_RPAREN, + anon_sym_DOT, + sym__entity_part, + [10567] = 6, + ACTIONS(841), 1, + sym_comment, + ACTIONS(843), 1, + anon_sym_property, + ACTIONS(845), 1, + anon_sym_RBRACE, + ACTIONS(847), 1, + anon_sym_const, + ACTIONS(849), 1, + anon_sym_fun, + STATE(207), 4, + sym_property, + sym_const, + sym_function, + aux_sym_component_repeat1, + [10589] = 6, + ACTIONS(851), 1, + sym_comment, + ACTIONS(854), 1, + anon_sym_property, + ACTIONS(857), 1, + anon_sym_RBRACE, + ACTIONS(859), 1, + anon_sym_const, + ACTIONS(862), 1, + anon_sym_fun, + STATE(205), 4, + sym_property, + sym_const, + sym_function, + aux_sym_component_repeat1, + [10611] = 2, + ACTIONS(867), 1, + anon_sym_LPAREN, + ACTIONS(865), 8, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_RPAREN, + sym__entity_part, + [10625] = 6, + ACTIONS(843), 1, + anon_sym_property, + ACTIONS(847), 1, + anon_sym_const, + ACTIONS(849), 1, + anon_sym_fun, + ACTIONS(869), 1, + sym_comment, + ACTIONS(871), 1, + anon_sym_RBRACE, + STATE(205), 4, + sym_property, + sym_const, + sym_function, + aux_sym_component_repeat1, + [10647] = 1, + ACTIONS(873), 8, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_RPAREN, + sym__entity_part, + [10658] = 1, + ACTIONS(875), 8, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_RPAREN, + sym__entity_part, + [10669] = 1, + ACTIONS(877), 8, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_RPAREN, + sym__entity_part, + [10680] = 1, + ACTIONS(865), 8, + sym_variable, + sym_comment, + anon_sym_EQ, + anon_sym_LBRACE, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_RPAREN, + sym__entity_part, + [10691] = 5, + ACTIONS(847), 1, + anon_sym_const, + ACTIONS(849), 1, + anon_sym_fun, + ACTIONS(879), 1, + sym_comment, + ACTIONS(881), 1, + anon_sym_RBRACE, + STATE(223), 3, + sym_const, + sym_function, + aux_sym_module_repeat1, + [10709] = 6, + ACTIONS(883), 1, + sym_variable, + ACTIONS(885), 1, + sym_comment, + ACTIONS(887), 1, + anon_sym_RBRACE, + ACTIONS(889), 1, + sym__entity_part, + STATE(206), 1, + sym_entity_name, + STATE(215), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10729] = 6, + ACTIONS(883), 1, + sym_variable, + ACTIONS(889), 1, + sym__entity_part, + ACTIONS(891), 1, + sym_comment, + ACTIONS(893), 1, + anon_sym_RBRACE, + STATE(206), 1, + sym_entity_name, + STATE(222), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10749] = 6, + ACTIONS(883), 1, + sym_variable, + ACTIONS(889), 1, + sym__entity_part, + ACTIONS(895), 1, + sym_comment, + ACTIONS(897), 1, + anon_sym_RBRACE, + STATE(206), 1, + sym_entity_name, + STATE(221), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10769] = 6, + ACTIONS(883), 1, + sym_variable, + ACTIONS(889), 1, + sym__entity_part, + ACTIONS(893), 1, + anon_sym_RBRACE, + ACTIONS(895), 1, + sym_comment, + STATE(206), 1, + sym_entity_name, + STATE(221), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10789] = 6, + ACTIONS(883), 1, + sym_variable, + ACTIONS(889), 1, + sym__entity_part, + ACTIONS(895), 1, + sym_comment, + ACTIONS(899), 1, + anon_sym_RBRACE, + STATE(206), 1, + sym_entity_name, + STATE(221), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10809] = 6, + ACTIONS(883), 1, + sym_variable, + ACTIONS(889), 1, + sym__entity_part, + ACTIONS(899), 1, + anon_sym_RBRACE, + ACTIONS(901), 1, + sym_comment, + STATE(206), 1, + sym_entity_name, + STATE(216), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10829] = 5, + ACTIONS(903), 1, + sym_comment, + ACTIONS(906), 1, + anon_sym_RBRACE, + ACTIONS(908), 1, + anon_sym_const, + ACTIONS(911), 1, + anon_sym_fun, + STATE(219), 3, + sym_const, + sym_function, + aux_sym_module_repeat1, + [10847] = 6, + ACTIONS(883), 1, + sym_variable, + ACTIONS(889), 1, + sym__entity_part, + ACTIONS(914), 1, + sym_comment, + ACTIONS(916), 1, + anon_sym_RBRACE, + STATE(206), 1, + sym_entity_name, + STATE(217), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10867] = 6, + ACTIONS(918), 1, + sym_variable, + ACTIONS(921), 1, + sym_comment, + ACTIONS(924), 1, + anon_sym_RBRACE, + ACTIONS(926), 1, + sym__entity_part, + STATE(206), 1, + sym_entity_name, + STATE(221), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10887] = 6, + ACTIONS(883), 1, + sym_variable, + ACTIONS(889), 1, + sym__entity_part, + ACTIONS(895), 1, + sym_comment, + ACTIONS(929), 1, + anon_sym_RBRACE, + STATE(206), 1, + sym_entity_name, + STATE(221), 2, + sym_type, + aux_sym_enum_definition_repeat2, + [10907] = 5, + ACTIONS(847), 1, + anon_sym_const, + ACTIONS(849), 1, + anon_sym_fun, + ACTIONS(931), 1, + sym_comment, + ACTIONS(933), 1, + anon_sym_RBRACE, + STATE(219), 3, + sym_const, + sym_function, + aux_sym_module_repeat1, + [10925] = 1, + ACTIONS(935), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [10934] = 1, + ACTIONS(937), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [10943] = 1, + ACTIONS(939), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [10952] = 1, + ACTIONS(941), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [10961] = 1, + ACTIONS(943), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [10970] = 1, + ACTIONS(945), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [10979] = 1, + ACTIONS(947), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [10988] = 1, + ACTIONS(949), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [10997] = 1, + ACTIONS(951), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [11006] = 1, + ACTIONS(953), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [11015] = 1, + ACTIONS(955), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [11024] = 1, + ACTIONS(957), 6, + ts_builtin_sym_end, + sym_comment, + anon_sym_record, + anon_sym_enum, + anon_sym_component, + anon_sym_module, + [11033] = 5, + ACTIONS(883), 1, + sym_variable, + ACTIONS(889), 1, + sym__entity_part, + ACTIONS(959), 1, + anon_sym_RPAREN, + STATE(206), 1, + sym_entity_name, + STATE(275), 1, + sym_type, + [11049] = 4, + ACTIONS(961), 1, + anon_sym_POUND_LBRACE, + ACTIONS(963), 1, + anon_sym_DQUOTE, + ACTIONS(965), 1, + sym_string_chars, + STATE(239), 2, + sym_interpolation, + aux_sym_string_repeat1, + [11063] = 4, + ACTIONS(961), 1, + anon_sym_POUND_LBRACE, + ACTIONS(965), 1, + sym_string_chars, + ACTIONS(967), 1, + anon_sym_DQUOTE, + STATE(239), 2, + sym_interpolation, + aux_sym_string_repeat1, + [11077] = 4, + ACTIONS(969), 1, + anon_sym_POUND_LBRACE, + ACTIONS(972), 1, + anon_sym_DQUOTE, + ACTIONS(974), 1, + sym_string_chars, + STATE(239), 2, + sym_interpolation, + aux_sym_string_repeat1, + [11091] = 1, + ACTIONS(977), 5, + sym_comment, + anon_sym_property, anon_sym_RBRACE, - STATE(29), 1, - sym_inline_javascript, - STATE(2), 2, - sym_statement, - aux_sym_function_repeat1, - [183] = 4, - ACTIONS(49), 1, + anon_sym_const, + anon_sym_fun, + [11099] = 4, + ACTIONS(979), 1, + anon_sym_POUND_LBRACE, + ACTIONS(981), 1, + anon_sym_BQUOTE, + ACTIONS(983), 1, + sym_javascript_chars, + STATE(255), 2, + sym_interpolation, + aux_sym_inline_javascript_repeat1, + [11113] = 1, + ACTIONS(985), 5, sym_comment, - ACTIONS(51), 1, + anon_sym_property, anon_sym_RBRACE, - ACTIONS(53), 1, + anon_sym_const, anon_sym_fun, - STATE(15), 2, - sym_function, - aux_sym_module_repeat1, - [197] = 4, - ACTIONS(55), 1, + [11121] = 1, + ACTIONS(987), 5, sym_comment, - ACTIONS(58), 1, + anon_sym_property, anon_sym_RBRACE, - ACTIONS(60), 1, + anon_sym_const, anon_sym_fun, - STATE(14), 2, - sym_function, - aux_sym_module_repeat1, - [211] = 4, - ACTIONS(53), 1, + [11129] = 1, + ACTIONS(989), 5, + sym_comment, + anon_sym_property, + anon_sym_RBRACE, + anon_sym_const, anon_sym_fun, - ACTIONS(63), 1, + [11137] = 4, + ACTIONS(979), 1, + anon_sym_POUND_LBRACE, + ACTIONS(991), 1, + anon_sym_BQUOTE, + ACTIONS(993), 1, + sym_javascript_chars, + STATE(253), 2, + sym_interpolation, + aux_sym_inline_javascript_repeat1, + [11151] = 1, + ACTIONS(995), 5, sym_comment, - ACTIONS(65), 1, + anon_sym_property, anon_sym_RBRACE, - STATE(14), 2, - sym_function, - aux_sym_module_repeat1, - [225] = 5, - ACTIONS(67), 1, - anon_sym_LBRACE, - ACTIONS(69), 1, + anon_sym_const, + anon_sym_fun, + [11159] = 5, + ACTIONS(23), 1, anon_sym_LPAREN, - ACTIONS(71), 1, + ACTIONS(997), 1, + anon_sym_LBRACE, + ACTIONS(999), 1, anon_sym_COLON, - STATE(44), 1, + STATE(263), 1, sym_argument_list, - STATE(69), 1, + STATE(342), 1, sym_type_definition, - [241] = 2, - ACTIONS(75), 1, - anon_sym_LPAREN, - ACTIONS(73), 3, + [11175] = 1, + ACTIONS(1001), 5, + sym_comment, + anon_sym_property, + anon_sym_RBRACE, + anon_sym_const, + anon_sym_fun, + [11183] = 4, + ACTIONS(961), 1, + anon_sym_POUND_LBRACE, + ACTIONS(1003), 1, + anon_sym_DQUOTE, + ACTIONS(1005), 1, + sym_string_chars, + STATE(238), 2, + sym_interpolation, + aux_sym_string_repeat1, + [11197] = 4, + ACTIONS(979), 1, + anon_sym_POUND_LBRACE, + ACTIONS(1007), 1, + anon_sym_BQUOTE, + ACTIONS(1009), 1, + sym_javascript_chars, + STATE(241), 2, + sym_interpolation, + aux_sym_inline_javascript_repeat1, + [11211] = 4, + ACTIONS(961), 1, + anon_sym_POUND_LBRACE, + ACTIONS(1011), 1, + anon_sym_DQUOTE, + ACTIONS(1013), 1, + sym_string_chars, + STATE(237), 2, + sym_interpolation, + aux_sym_string_repeat1, + [11225] = 1, + ACTIONS(1015), 5, + anon_sym_EQ, anon_sym_LBRACE, anon_sym_COMMA, + anon_sym_RBRACE, anon_sym_RPAREN, - [250] = 3, - ACTIONS(71), 1, - anon_sym_COLON, - STATE(54), 1, - sym_type_definition, - ACTIONS(77), 2, + [11233] = 4, + ACTIONS(979), 1, + anon_sym_POUND_LBRACE, + ACTIONS(983), 1, + sym_javascript_chars, + ACTIONS(1017), 1, + anon_sym_BQUOTE, + STATE(255), 2, + sym_interpolation, + aux_sym_inline_javascript_repeat1, + [11247] = 1, + ACTIONS(1019), 5, + sym_comment, + anon_sym_property, + anon_sym_RBRACE, + anon_sym_const, + anon_sym_fun, + [11255] = 4, + ACTIONS(1021), 1, + anon_sym_POUND_LBRACE, + ACTIONS(1024), 1, + anon_sym_BQUOTE, + ACTIONS(1026), 1, + sym_javascript_chars, + STATE(255), 2, + sym_interpolation, + aux_sym_inline_javascript_repeat1, + [11269] = 1, + ACTIONS(1029), 5, + sym_comment, + anon_sym_property, + anon_sym_RBRACE, + anon_sym_const, + anon_sym_fun, + [11277] = 3, + ACTIONS(1031), 1, anon_sym_COMMA, + STATE(257), 1, + aux_sym_enum_definition_repeat1, + ACTIONS(1034), 2, + anon_sym_RBRACE, anon_sym_RPAREN, - [261] = 4, - ACTIONS(79), 1, - anon_sym_RPAREN, - ACTIONS(81), 1, + [11288] = 4, + ACTIONS(883), 1, sym_variable, - ACTIONS(83), 1, + ACTIONS(889), 1, sym__entity_part, - STATE(38), 1, + STATE(206), 1, + sym_entity_name, + STATE(324), 1, sym_type, - [274] = 1, - ACTIONS(85), 3, + [11301] = 4, + ACTIONS(999), 1, + anon_sym_COLON, + ACTIONS(1036), 1, anon_sym_LBRACE, - anon_sym_COMMA, - anon_sym_RPAREN, - [280] = 1, - ACTIONS(87), 3, - ts_builtin_sym_end, - sym_comment, - anon_sym_module, - [286] = 3, - ACTIONS(89), 1, - anon_sym_RPAREN, - ACTIONS(91), 1, - sym_variable, - STATE(31), 1, - sym_argument, - [296] = 3, - ACTIONS(81), 1, + STATE(68), 1, + sym_block, + STATE(327), 1, + sym_type_definition, + [11314] = 4, + ACTIONS(999), 1, + anon_sym_COLON, + ACTIONS(1038), 1, + anon_sym_LBRACE, + STATE(170), 1, + sym_block, + STATE(319), 1, + sym_type_definition, + [11327] = 4, + ACTIONS(883), 1, sym_variable, - ACTIONS(83), 1, + ACTIONS(889), 1, sym__entity_part, - STATE(46), 1, + STATE(206), 1, + sym_entity_name, + STATE(252), 1, sym_type, - [306] = 3, - ACTIONS(93), 1, + [11340] = 3, + ACTIONS(999), 1, + anon_sym_COLON, + STATE(307), 1, + sym_type_definition, + ACTIONS(1040), 2, anon_sym_COMMA, - ACTIONS(96), 1, anon_sym_RPAREN, - STATE(24), 1, - aux_sym_type_repeat1, - [316] = 1, - ACTIONS(98), 3, + [11351] = 3, + ACTIONS(999), 1, + anon_sym_COLON, + ACTIONS(1042), 1, anon_sym_LBRACE, + STATE(331), 1, + sym_type_definition, + [11361] = 3, + ACTIONS(617), 1, anon_sym_COMMA, - anon_sym_RPAREN, - [322] = 1, - ACTIONS(100), 3, - sym_comment, + ACTIONS(1044), 1, anon_sym_RBRACE, - anon_sym_fun, - [328] = 1, - ACTIONS(102), 3, - sym_comment, - anon_sym_RBRACE, - anon_sym_fun, - [334] = 3, - ACTIONS(104), 1, + STATE(286), 1, + aux_sym_tuple_repeat1, + [11371] = 3, + ACTIONS(1046), 1, anon_sym_COMMA, - ACTIONS(106), 1, + ACTIONS(1048), 1, anon_sym_RPAREN, - STATE(24), 1, - aux_sym_type_repeat1, - [344] = 1, - ACTIONS(108), 3, - anon_sym_RBRACE, - sym_variable, - anon_sym_BQUOTE, - [350] = 1, - ACTIONS(110), 3, - anon_sym_LBRACE, + STATE(267), 1, + aux_sym_argument_list_repeat1, + [11381] = 3, + ACTIONS(1050), 1, anon_sym_COMMA, + ACTIONS(1052), 1, anon_sym_RPAREN, - [356] = 3, - ACTIONS(112), 1, + STATE(287), 1, + aux_sym_type_repeat1, + [11391] = 3, + ACTIONS(1054), 1, anon_sym_COMMA, - ACTIONS(114), 1, + ACTIONS(1057), 1, anon_sym_RPAREN, - STATE(34), 1, + STATE(267), 1, aux_sym_argument_list_repeat1, - [366] = 1, - ACTIONS(73), 3, - anon_sym_LBRACE, + [11401] = 3, + ACTIONS(1059), 1, anon_sym_COMMA, - anon_sym_RPAREN, - [372] = 3, - ACTIONS(81), 1, + ACTIONS(1061), 1, + anon_sym_RBRACE, + STATE(283), 1, + aux_sym_record_update_repeat1, + [11411] = 3, + ACTIONS(1063), 1, sym_variable, - ACTIONS(83), 1, - sym__entity_part, - STATE(59), 1, - sym_type, - [382] = 3, - ACTIONS(112), 1, + ACTIONS(1065), 1, + anon_sym_RPAREN, + STATE(288), 1, + sym_argument, + [11421] = 3, + ACTIONS(201), 1, anon_sym_COMMA, - ACTIONS(116), 1, + ACTIONS(1067), 1, anon_sym_RPAREN, - STATE(42), 1, - aux_sym_argument_list_repeat1, - [392] = 3, - ACTIONS(118), 1, - anon_sym_LBRACE, - ACTIONS(120), 1, - anon_sym_DOT, - STATE(35), 1, - aux_sym_entity_name_repeat1, - [402] = 1, - ACTIONS(123), 3, - sym_comment, + STATE(294), 1, + aux_sym_arguments_repeat1, + [11431] = 3, + ACTIONS(1059), 1, + anon_sym_COMMA, + ACTIONS(1069), 1, anon_sym_RBRACE, - anon_sym_fun, - [408] = 1, - ACTIONS(125), 3, - sym_comment, + STATE(268), 1, + aux_sym_record_update_repeat1, + [11441] = 3, + ACTIONS(201), 1, + anon_sym_COMMA, + ACTIONS(781), 1, + anon_sym_RPAREN, + STATE(294), 1, + aux_sym_arguments_repeat1, + [11451] = 3, + ACTIONS(1059), 1, + anon_sym_COMMA, + ACTIONS(1071), 1, anon_sym_RBRACE, - anon_sym_fun, - [414] = 3, - ACTIONS(104), 1, + STATE(299), 1, + aux_sym_record_update_repeat1, + [11461] = 1, + ACTIONS(1034), 3, + anon_sym_COMMA, + anon_sym_RBRACE, + anon_sym_RPAREN, + [11467] = 3, + ACTIONS(1050), 1, anon_sym_COMMA, - ACTIONS(127), 1, + ACTIONS(1073), 1, anon_sym_RPAREN, - STATE(28), 1, + STATE(266), 1, aux_sym_type_repeat1, - [424] = 1, - ACTIONS(129), 3, - ts_builtin_sym_end, - sym_comment, - anon_sym_module, - [430] = 1, - ACTIONS(131), 3, - sym_comment, + [11477] = 3, + ACTIONS(1075), 1, + anon_sym_COMMA, + ACTIONS(1077), 1, anon_sym_RBRACE, - anon_sym_fun, - [436] = 3, - ACTIONS(133), 1, - anon_sym_LBRACE, - ACTIONS(135), 1, - anon_sym_DOT, - STATE(35), 1, - aux_sym_entity_name_repeat1, - [446] = 3, - ACTIONS(137), 1, + STATE(257), 1, + aux_sym_enum_definition_repeat1, + [11487] = 3, + ACTIONS(1079), 1, anon_sym_COMMA, - ACTIONS(140), 1, - anon_sym_RPAREN, - STATE(42), 1, - aux_sym_argument_list_repeat1, - [456] = 1, - ACTIONS(142), 3, + ACTIONS(1082), 1, + anon_sym_RBRACE, + STATE(277), 1, + aux_sym_record_definition_repeat1, + [11497] = 3, + ACTIONS(617), 1, + anon_sym_COMMA, + ACTIONS(1084), 1, + anon_sym_RBRACE, + STATE(286), 1, + aux_sym_tuple_repeat1, + [11507] = 3, + ACTIONS(1059), 1, + anon_sym_COMMA, + ACTIONS(1086), 1, anon_sym_RBRACE, + STATE(283), 1, + aux_sym_record_update_repeat1, + [11517] = 3, + ACTIONS(1088), 1, sym_variable, - anon_sym_BQUOTE, - [462] = 3, - ACTIONS(71), 1, + ACTIONS(1090), 1, + anon_sym_RBRACE, + STATE(271), 1, + sym_record_field, + [11527] = 3, + ACTIONS(1088), 1, + sym_variable, + ACTIONS(1092), 1, + anon_sym_RBRACE, + STATE(273), 1, + sym_record_field, + [11537] = 3, + ACTIONS(999), 1, anon_sym_COLON, - ACTIONS(144), 1, - anon_sym_LBRACE, - STATE(64), 1, + ACTIONS(1094), 1, + anon_sym_EQ, + STATE(341), 1, sym_type_definition, - [472] = 1, - ACTIONS(146), 3, - sym_comment, + [11547] = 3, + ACTIONS(1096), 1, + anon_sym_COMMA, + ACTIONS(1099), 1, anon_sym_RBRACE, - anon_sym_fun, - [478] = 1, - ACTIONS(148), 3, - anon_sym_LBRACE, + STATE(283), 1, + aux_sym_record_update_repeat1, + [11557] = 3, + ACTIONS(1075), 1, anon_sym_COMMA, + ACTIONS(1101), 1, anon_sym_RPAREN, - [484] = 1, - ACTIONS(150), 3, - sym_comment, + STATE(257), 1, + aux_sym_enum_definition_repeat1, + [11567] = 3, + ACTIONS(1059), 1, + anon_sym_COMMA, + ACTIONS(1103), 1, anon_sym_RBRACE, - anon_sym_fun, - [490] = 1, - ACTIONS(152), 3, + STATE(279), 1, + aux_sym_record_update_repeat1, + [11577] = 3, + ACTIONS(785), 1, anon_sym_RBRACE, - sym_variable, + ACTIONS(1105), 1, + anon_sym_COMMA, + STATE(286), 1, + aux_sym_tuple_repeat1, + [11587] = 3, + ACTIONS(1108), 1, + anon_sym_COMMA, + ACTIONS(1111), 1, + anon_sym_RPAREN, + STATE(287), 1, + aux_sym_type_repeat1, + [11597] = 3, + ACTIONS(1046), 1, + anon_sym_COMMA, + ACTIONS(1113), 1, + anon_sym_RPAREN, + STATE(265), 1, + aux_sym_argument_list_repeat1, + [11607] = 3, + ACTIONS(1115), 1, + anon_sym_COMMA, + ACTIONS(1117), 1, + anon_sym_RBRACE, + STATE(277), 1, + aux_sym_record_definition_repeat1, + [11617] = 3, + ACTIONS(1059), 1, + anon_sym_COMMA, + ACTIONS(1119), 1, + anon_sym_RBRACE, + STATE(283), 1, + aux_sym_record_update_repeat1, + [11627] = 1, + ACTIONS(1121), 3, + sym_javascript_chars, + anon_sym_POUND_LBRACE, anon_sym_BQUOTE, - [496] = 3, - ACTIONS(135), 1, - anon_sym_DOT, - ACTIONS(154), 1, - anon_sym_LBRACE, - STATE(41), 1, - aux_sym_entity_name_repeat1, - [506] = 1, - ACTIONS(156), 3, - sym_comment, + [11633] = 3, + ACTIONS(1115), 1, + anon_sym_COMMA, + ACTIONS(1123), 1, anon_sym_RBRACE, - anon_sym_fun, - [512] = 2, - ACTIONS(91), 1, - sym_variable, - STATE(52), 1, - sym_argument, - [519] = 1, - ACTIONS(140), 2, + STATE(289), 1, + aux_sym_record_definition_repeat1, + [11643] = 3, + ACTIONS(201), 1, + anon_sym_COMMA, + ACTIONS(1125), 1, + anon_sym_RPAREN, + STATE(294), 1, + aux_sym_arguments_repeat1, + [11653] = 3, + ACTIONS(787), 1, + anon_sym_RPAREN, + ACTIONS(1127), 1, anon_sym_COMMA, + STATE(294), 1, + aux_sym_arguments_repeat1, + [11663] = 3, + ACTIONS(201), 1, + anon_sym_COMMA, + ACTIONS(783), 1, + anon_sym_RPAREN, + STATE(294), 1, + aux_sym_arguments_repeat1, + [11673] = 3, + ACTIONS(1059), 1, + anon_sym_COMMA, + ACTIONS(1130), 1, + anon_sym_RBRACE, + STATE(290), 1, + aux_sym_record_update_repeat1, + [11683] = 1, + ACTIONS(1121), 3, + sym_string_chars, + anon_sym_POUND_LBRACE, + anon_sym_DQUOTE, + [11689] = 3, + ACTIONS(1075), 1, + anon_sym_COMMA, + ACTIONS(1132), 1, anon_sym_RPAREN, - [524] = 1, - ACTIONS(158), 2, + STATE(284), 1, + aux_sym_enum_definition_repeat1, + [11699] = 3, + ACTIONS(1059), 1, + anon_sym_COMMA, + ACTIONS(1134), 1, + anon_sym_RBRACE, + STATE(283), 1, + aux_sym_record_update_repeat1, + [11709] = 2, + ACTIONS(1136), 1, + sym__entity_part, + STATE(51), 1, + sym_entity_name, + [11716] = 2, + ACTIONS(889), 1, + sym__entity_part, + STATE(316), 1, + sym_entity_name, + [11723] = 2, + ACTIONS(1063), 1, + sym_variable, + STATE(320), 1, + sym_argument, + [11730] = 2, + ACTIONS(889), 1, + sym__entity_part, + STATE(343), 1, + sym_entity_name, + [11737] = 1, + ACTIONS(1138), 2, anon_sym_LBRACE, anon_sym_COLON, - [529] = 1, - ACTIONS(160), 2, + [11742] = 2, + ACTIONS(889), 1, + sym__entity_part, + STATE(345), 1, + sym_entity_name, + [11749] = 2, + ACTIONS(889), 1, + sym__entity_part, + STATE(348), 1, + sym_entity_name, + [11756] = 1, + ACTIONS(1140), 2, anon_sym_COMMA, anon_sym_RPAREN, - [534] = 2, - ACTIONS(13), 1, - anon_sym_BQUOTE, - STATE(48), 1, - sym_inline_javascript, - [541] = 1, - ACTIONS(118), 2, + [11761] = 1, + ACTIONS(1142), 2, + anon_sym_COMMA, + anon_sym_RBRACE, + [11766] = 2, + ACTIONS(999), 1, + anon_sym_COLON, + STATE(308), 1, + sym_type_definition, + [11773] = 2, + ACTIONS(93), 1, + anon_sym_DQUOTE, + STATE(157), 1, + sym_string, + [11780] = 2, + ACTIONS(93), 1, + anon_sym_DQUOTE, + STATE(152), 1, + sym_string, + [11787] = 2, + ACTIONS(1144), 1, + sym_variable, + STATE(326), 1, + sym_record_definition_field, + [11794] = 1, + ACTIONS(1146), 2, anon_sym_LBRACE, - anon_sym_DOT, - [546] = 2, - ACTIONS(162), 1, + anon_sym_COLON, + [11799] = 2, + ACTIONS(1148), 1, sym__entity_part, - STATE(61), 1, + STATE(175), 1, sym_entity_name, - [553] = 1, - ACTIONS(164), 2, + [11806] = 2, + ACTIONS(1150), 1, + sym_variable, + ACTIONS(1152), 1, + anon_sym_RPAREN, + [11813] = 2, + ACTIONS(1154), 1, + anon_sym_LBRACE, + ACTIONS(1156), 1, + anon_sym_LPAREN, + [11820] = 2, + ACTIONS(41), 1, + anon_sym_DQUOTE, + STATE(104), 1, + sym_string, + [11827] = 1, + ACTIONS(1158), 2, anon_sym_LBRACE, anon_sym_COLON, - [558] = 1, - ACTIONS(96), 2, + [11832] = 2, + ACTIONS(1038), 1, + anon_sym_LBRACE, + STATE(147), 1, + sym_block, + [11839] = 1, + ACTIONS(1057), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [11844] = 2, + ACTIONS(1144), 1, + sym_variable, + STATE(292), 1, + sym_record_definition_field, + [11851] = 2, + ACTIONS(1088), 1, + sym_variable, + STATE(325), 1, + sym_record_field, + [11858] = 2, + ACTIONS(41), 1, + anon_sym_DQUOTE, + STATE(96), 1, + sym_string, + [11865] = 1, + ACTIONS(1111), 2, anon_sym_COMMA, anon_sym_RPAREN, - [563] = 1, - ACTIONS(166), 2, + [11870] = 1, + ACTIONS(1099), 2, + anon_sym_COMMA, + anon_sym_RBRACE, + [11875] = 1, + ACTIONS(1082), 2, + anon_sym_COMMA, + anon_sym_RBRACE, + [11880] = 2, + ACTIONS(1036), 1, anon_sym_LBRACE, - anon_sym_COLON, - [568] = 1, - ACTIONS(168), 1, + STATE(52), 1, + sym_block, + [11887] = 1, + ACTIONS(1160), 1, + sym__entity_part, + [11891] = 1, + ACTIONS(1162), 1, + anon_sym_EQ, + [11895] = 1, + ACTIONS(1164), 1, + sym_variable, + [11899] = 1, + ACTIONS(1166), 1, anon_sym_LBRACE, - [572] = 1, - ACTIONS(170), 1, + [11903] = 1, + ACTIONS(1168), 1, + anon_sym_EQ, + [11907] = 1, + ACTIONS(1170), 1, + sym_variable, + [11911] = 1, + ACTIONS(1172), 1, + sym_variable, + [11915] = 1, + ACTIONS(1174), 1, + anon_sym_EQ, + [11919] = 1, + ACTIONS(1176), 1, sym__entity_part, - [576] = 1, - ACTIONS(172), 1, - anon_sym_BQUOTE, - [580] = 1, - ACTIONS(174), 1, + [11923] = 1, + ACTIONS(1178), 1, anon_sym_LBRACE, - [584] = 1, - ACTIONS(176), 1, - ts_builtin_sym_end, - [588] = 1, - ACTIONS(178), 1, + [11927] = 1, + ACTIONS(1180), 1, + anon_sym_LBRACE, + [11931] = 1, + ACTIONS(1182), 1, sym_variable, - [592] = 1, - ACTIONS(180), 1, - aux_sym_inline_javascript_token1, - [596] = 1, - ACTIONS(182), 1, + [11935] = 1, + ACTIONS(1184), 1, + anon_sym_LBRACE, + [11939] = 1, + ACTIONS(1186), 1, + anon_sym_EQ, + [11943] = 1, + ACTIONS(1188), 1, + anon_sym_LBRACE, + [11947] = 1, + ACTIONS(1190), 1, + anon_sym_LBRACE, + [11951] = 1, + ACTIONS(1192), 1, + anon_sym_LBRACE, + [11955] = 1, + ACTIONS(1194), 1, + anon_sym_LBRACE, + [11959] = 1, + ACTIONS(1196), 1, + anon_sym_LPAREN, + [11963] = 1, + ACTIONS(1198), 1, + sym__entity_part, + [11967] = 1, + ACTIONS(1200), 1, + anon_sym_LBRACE, + [11971] = 1, + ACTIONS(1202), 1, + sym_constant, + [11975] = 1, + ACTIONS(1204), 1, + anon_sym_LBRACE, + [11979] = 1, + ACTIONS(1206), 1, + anon_sym_LBRACE, + [11983] = 1, + ACTIONS(1208), 1, + ts_builtin_sym_end, + [11987] = 1, + ACTIONS(1210), 1, + anon_sym_LPAREN, + [11991] = 1, + ACTIONS(1212), 1, + anon_sym_EQ, + [11995] = 1, + ACTIONS(1214), 1, + anon_sym_LBRACE, + [11999] = 1, + ACTIONS(1216), 1, + anon_sym_LBRACE, + [12003] = 1, + ACTIONS(1218), 1, anon_sym_EQ, - [600] = 1, - ACTIONS(184), 1, + [12007] = 1, + ACTIONS(1220), 1, + sym_variable, + [12011] = 1, + ACTIONS(1222), 1, + anon_sym_LPAREN, + [12015] = 1, + ACTIONS(1224), 1, anon_sym_LBRACE, + [12019] = 1, + ACTIONS(1226), 1, + anon_sym_LPAREN, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(2)] = 0, - [SMALL_STATE(3)] = 17, - [SMALL_STATE(4)] = 34, - [SMALL_STATE(5)] = 51, - [SMALL_STATE(6)] = 66, - [SMALL_STATE(7)] = 83, - [SMALL_STATE(8)] = 100, - [SMALL_STATE(9)] = 115, - [SMALL_STATE(10)] = 132, - [SMALL_STATE(11)] = 149, - [SMALL_STATE(12)] = 166, - [SMALL_STATE(13)] = 183, - [SMALL_STATE(14)] = 197, - [SMALL_STATE(15)] = 211, - [SMALL_STATE(16)] = 225, - [SMALL_STATE(17)] = 241, - [SMALL_STATE(18)] = 250, - [SMALL_STATE(19)] = 261, - [SMALL_STATE(20)] = 274, - [SMALL_STATE(21)] = 280, - [SMALL_STATE(22)] = 286, - [SMALL_STATE(23)] = 296, - [SMALL_STATE(24)] = 306, - [SMALL_STATE(25)] = 316, - [SMALL_STATE(26)] = 322, - [SMALL_STATE(27)] = 328, - [SMALL_STATE(28)] = 334, - [SMALL_STATE(29)] = 344, - [SMALL_STATE(30)] = 350, - [SMALL_STATE(31)] = 356, - [SMALL_STATE(32)] = 366, - [SMALL_STATE(33)] = 372, - [SMALL_STATE(34)] = 382, - [SMALL_STATE(35)] = 392, - [SMALL_STATE(36)] = 402, - [SMALL_STATE(37)] = 408, - [SMALL_STATE(38)] = 414, - [SMALL_STATE(39)] = 424, - [SMALL_STATE(40)] = 430, - [SMALL_STATE(41)] = 436, - [SMALL_STATE(42)] = 446, - [SMALL_STATE(43)] = 456, - [SMALL_STATE(44)] = 462, - [SMALL_STATE(45)] = 472, - [SMALL_STATE(46)] = 478, - [SMALL_STATE(47)] = 484, - [SMALL_STATE(48)] = 490, - [SMALL_STATE(49)] = 496, - [SMALL_STATE(50)] = 506, - [SMALL_STATE(51)] = 512, - [SMALL_STATE(52)] = 519, - [SMALL_STATE(53)] = 524, - [SMALL_STATE(54)] = 529, - [SMALL_STATE(55)] = 534, - [SMALL_STATE(56)] = 541, - [SMALL_STATE(57)] = 546, - [SMALL_STATE(58)] = 553, - [SMALL_STATE(59)] = 558, - [SMALL_STATE(60)] = 563, - [SMALL_STATE(61)] = 568, - [SMALL_STATE(62)] = 572, - [SMALL_STATE(63)] = 576, - [SMALL_STATE(64)] = 580, - [SMALL_STATE(65)] = 584, - [SMALL_STATE(66)] = 588, - [SMALL_STATE(67)] = 592, - [SMALL_STATE(68)] = 596, - [SMALL_STATE(69)] = 600, + [SMALL_STATE(3)] = 81, + [SMALL_STATE(4)] = 162, + [SMALL_STATE(5)] = 243, + [SMALL_STATE(6)] = 321, + [SMALL_STATE(7)] = 399, + [SMALL_STATE(8)] = 477, + [SMALL_STATE(9)] = 555, + [SMALL_STATE(10)] = 631, + [SMALL_STATE(11)] = 707, + [SMALL_STATE(12)] = 785, + [SMALL_STATE(13)] = 861, + [SMALL_STATE(14)] = 939, + [SMALL_STATE(15)] = 1017, + [SMALL_STATE(16)] = 1093, + [SMALL_STATE(17)] = 1171, + [SMALL_STATE(18)] = 1247, + [SMALL_STATE(19)] = 1325, + [SMALL_STATE(20)] = 1403, + [SMALL_STATE(21)] = 1481, + [SMALL_STATE(22)] = 1559, + [SMALL_STATE(23)] = 1637, + [SMALL_STATE(24)] = 1712, + [SMALL_STATE(25)] = 1787, + [SMALL_STATE(26)] = 1859, + [SMALL_STATE(27)] = 1931, + [SMALL_STATE(28)] = 2001, + [SMALL_STATE(29)] = 2047, + [SMALL_STATE(30)] = 2093, + [SMALL_STATE(31)] = 2165, + [SMALL_STATE(32)] = 2211, + [SMALL_STATE(33)] = 2283, + [SMALL_STATE(34)] = 2329, + [SMALL_STATE(35)] = 2401, + [SMALL_STATE(36)] = 2442, + [SMALL_STATE(37)] = 2493, + [SMALL_STATE(38)] = 2552, + [SMALL_STATE(39)] = 2609, + [SMALL_STATE(40)] = 2652, + [SMALL_STATE(41)] = 2697, + [SMALL_STATE(42)] = 2746, + [SMALL_STATE(43)] = 2797, + [SMALL_STATE(44)] = 2852, + [SMALL_STATE(45)] = 2923, + [SMALL_STATE(46)] = 2966, + [SMALL_STATE(47)] = 3009, + [SMALL_STATE(48)] = 3052, + [SMALL_STATE(49)] = 3113, + [SMALL_STATE(50)] = 3179, + [SMALL_STATE(51)] = 3245, + [SMALL_STATE(52)] = 3285, + [SMALL_STATE(53)] = 3325, + [SMALL_STATE(54)] = 3365, + [SMALL_STATE(55)] = 3405, + [SMALL_STATE(56)] = 3445, + [SMALL_STATE(57)] = 3485, + [SMALL_STATE(58)] = 3525, + [SMALL_STATE(59)] = 3565, + [SMALL_STATE(60)] = 3605, + [SMALL_STATE(61)] = 3671, + [SMALL_STATE(62)] = 3737, + [SMALL_STATE(63)] = 3803, + [SMALL_STATE(64)] = 3869, + [SMALL_STATE(65)] = 3935, + [SMALL_STATE(66)] = 4001, + [SMALL_STATE(67)] = 4067, + [SMALL_STATE(68)] = 4133, + [SMALL_STATE(69)] = 4173, + [SMALL_STATE(70)] = 4213, + [SMALL_STATE(71)] = 4279, + [SMALL_STATE(72)] = 4319, + [SMALL_STATE(73)] = 4385, + [SMALL_STATE(74)] = 4425, + [SMALL_STATE(75)] = 4491, + [SMALL_STATE(76)] = 4557, + [SMALL_STATE(77)] = 4597, + [SMALL_STATE(78)] = 4663, + [SMALL_STATE(79)] = 4729, + [SMALL_STATE(80)] = 4795, + [SMALL_STATE(81)] = 4861, + [SMALL_STATE(82)] = 4927, + [SMALL_STATE(83)] = 4967, + [SMALL_STATE(84)] = 5007, + [SMALL_STATE(85)] = 5073, + [SMALL_STATE(86)] = 5139, + [SMALL_STATE(87)] = 5179, + [SMALL_STATE(88)] = 5245, + [SMALL_STATE(89)] = 5311, + [SMALL_STATE(90)] = 5377, + [SMALL_STATE(91)] = 5417, + [SMALL_STATE(92)] = 5483, + [SMALL_STATE(93)] = 5549, + [SMALL_STATE(94)] = 5615, + [SMALL_STATE(95)] = 5681, + [SMALL_STATE(96)] = 5747, + [SMALL_STATE(97)] = 5787, + [SMALL_STATE(98)] = 5827, + [SMALL_STATE(99)] = 5893, + [SMALL_STATE(100)] = 5933, + [SMALL_STATE(101)] = 5973, + [SMALL_STATE(102)] = 6039, + [SMALL_STATE(103)] = 6079, + [SMALL_STATE(104)] = 6145, + [SMALL_STATE(105)] = 6185, + [SMALL_STATE(106)] = 6251, + [SMALL_STATE(107)] = 6291, + [SMALL_STATE(108)] = 6357, + [SMALL_STATE(109)] = 6423, + [SMALL_STATE(110)] = 6467, + [SMALL_STATE(111)] = 6533, + [SMALL_STATE(112)] = 6609, + [SMALL_STATE(113)] = 6653, + [SMALL_STATE(114)] = 6693, + [SMALL_STATE(115)] = 6733, + [SMALL_STATE(116)] = 6809, + [SMALL_STATE(117)] = 6849, + [SMALL_STATE(118)] = 6889, + [SMALL_STATE(119)] = 6955, + [SMALL_STATE(120)] = 6995, + [SMALL_STATE(121)] = 7061, + [SMALL_STATE(122)] = 7127, + [SMALL_STATE(123)] = 7168, + [SMALL_STATE(124)] = 7237, + [SMALL_STATE(125)] = 7306, + [SMALL_STATE(126)] = 7379, + [SMALL_STATE(127)] = 7447, + [SMALL_STATE(128)] = 7515, + [SMALL_STATE(129)] = 7555, + [SMALL_STATE(130)] = 7623, + [SMALL_STATE(131)] = 7662, + [SMALL_STATE(132)] = 7701, + [SMALL_STATE(133)] = 7740, + [SMALL_STATE(134)] = 7779, + [SMALL_STATE(135)] = 7815, + [SMALL_STATE(136)] = 7863, + [SMALL_STATE(137)] = 7913, + [SMALL_STATE(138)] = 7965, + [SMALL_STATE(139)] = 8003, + [SMALL_STATE(140)] = 8045, + [SMALL_STATE(141)] = 8089, + [SMALL_STATE(142)] = 8125, + [SMALL_STATE(143)] = 8171, + [SMALL_STATE(144)] = 8231, + [SMALL_STATE(145)] = 8267, + [SMALL_STATE(146)] = 8303, + [SMALL_STATE(147)] = 8337, + [SMALL_STATE(148)] = 8370, + [SMALL_STATE(149)] = 8403, + [SMALL_STATE(150)] = 8436, + [SMALL_STATE(151)] = 8469, + [SMALL_STATE(152)] = 8502, + [SMALL_STATE(153)] = 8535, + [SMALL_STATE(154)] = 8568, + [SMALL_STATE(155)] = 8601, + [SMALL_STATE(156)] = 8634, + [SMALL_STATE(157)] = 8667, + [SMALL_STATE(158)] = 8700, + [SMALL_STATE(159)] = 8733, + [SMALL_STATE(160)] = 8766, + [SMALL_STATE(161)] = 8799, + [SMALL_STATE(162)] = 8832, + [SMALL_STATE(163)] = 8865, + [SMALL_STATE(164)] = 8898, + [SMALL_STATE(165)] = 8931, + [SMALL_STATE(166)] = 8964, + [SMALL_STATE(167)] = 8997, + [SMALL_STATE(168)] = 9030, + [SMALL_STATE(169)] = 9063, + [SMALL_STATE(170)] = 9096, + [SMALL_STATE(171)] = 9129, + [SMALL_STATE(172)] = 9162, + [SMALL_STATE(173)] = 9195, + [SMALL_STATE(174)] = 9228, + [SMALL_STATE(175)] = 9261, + [SMALL_STATE(176)] = 9294, + [SMALL_STATE(177)] = 9327, + [SMALL_STATE(178)] = 9383, + [SMALL_STATE(179)] = 9439, + [SMALL_STATE(180)] = 9495, + [SMALL_STATE(181)] = 9553, + [SMALL_STATE(182)] = 9611, + [SMALL_STATE(183)] = 9664, + [SMALL_STATE(184)] = 9717, + [SMALL_STATE(185)] = 9770, + [SMALL_STATE(186)] = 9822, + [SMALL_STATE(187)] = 9874, + [SMALL_STATE(188)] = 9926, + [SMALL_STATE(189)] = 9978, + [SMALL_STATE(190)] = 10030, + [SMALL_STATE(191)] = 10082, + [SMALL_STATE(192)] = 10134, + [SMALL_STATE(193)] = 10186, + [SMALL_STATE(194)] = 10238, + [SMALL_STATE(195)] = 10290, + [SMALL_STATE(196)] = 10342, + [SMALL_STATE(197)] = 10394, + [SMALL_STATE(198)] = 10446, + [SMALL_STATE(199)] = 10473, + [SMALL_STATE(200)] = 10500, + [SMALL_STATE(201)] = 10518, + [SMALL_STATE(202)] = 10536, + [SMALL_STATE(203)] = 10554, + [SMALL_STATE(204)] = 10567, + [SMALL_STATE(205)] = 10589, + [SMALL_STATE(206)] = 10611, + [SMALL_STATE(207)] = 10625, + [SMALL_STATE(208)] = 10647, + [SMALL_STATE(209)] = 10658, + [SMALL_STATE(210)] = 10669, + [SMALL_STATE(211)] = 10680, + [SMALL_STATE(212)] = 10691, + [SMALL_STATE(213)] = 10709, + [SMALL_STATE(214)] = 10729, + [SMALL_STATE(215)] = 10749, + [SMALL_STATE(216)] = 10769, + [SMALL_STATE(217)] = 10789, + [SMALL_STATE(218)] = 10809, + [SMALL_STATE(219)] = 10829, + [SMALL_STATE(220)] = 10847, + [SMALL_STATE(221)] = 10867, + [SMALL_STATE(222)] = 10887, + [SMALL_STATE(223)] = 10907, + [SMALL_STATE(224)] = 10925, + [SMALL_STATE(225)] = 10934, + [SMALL_STATE(226)] = 10943, + [SMALL_STATE(227)] = 10952, + [SMALL_STATE(228)] = 10961, + [SMALL_STATE(229)] = 10970, + [SMALL_STATE(230)] = 10979, + [SMALL_STATE(231)] = 10988, + [SMALL_STATE(232)] = 10997, + [SMALL_STATE(233)] = 11006, + [SMALL_STATE(234)] = 11015, + [SMALL_STATE(235)] = 11024, + [SMALL_STATE(236)] = 11033, + [SMALL_STATE(237)] = 11049, + [SMALL_STATE(238)] = 11063, + [SMALL_STATE(239)] = 11077, + [SMALL_STATE(240)] = 11091, + [SMALL_STATE(241)] = 11099, + [SMALL_STATE(242)] = 11113, + [SMALL_STATE(243)] = 11121, + [SMALL_STATE(244)] = 11129, + [SMALL_STATE(245)] = 11137, + [SMALL_STATE(246)] = 11151, + [SMALL_STATE(247)] = 11159, + [SMALL_STATE(248)] = 11175, + [SMALL_STATE(249)] = 11183, + [SMALL_STATE(250)] = 11197, + [SMALL_STATE(251)] = 11211, + [SMALL_STATE(252)] = 11225, + [SMALL_STATE(253)] = 11233, + [SMALL_STATE(254)] = 11247, + [SMALL_STATE(255)] = 11255, + [SMALL_STATE(256)] = 11269, + [SMALL_STATE(257)] = 11277, + [SMALL_STATE(258)] = 11288, + [SMALL_STATE(259)] = 11301, + [SMALL_STATE(260)] = 11314, + [SMALL_STATE(261)] = 11327, + [SMALL_STATE(262)] = 11340, + [SMALL_STATE(263)] = 11351, + [SMALL_STATE(264)] = 11361, + [SMALL_STATE(265)] = 11371, + [SMALL_STATE(266)] = 11381, + [SMALL_STATE(267)] = 11391, + [SMALL_STATE(268)] = 11401, + [SMALL_STATE(269)] = 11411, + [SMALL_STATE(270)] = 11421, + [SMALL_STATE(271)] = 11431, + [SMALL_STATE(272)] = 11441, + [SMALL_STATE(273)] = 11451, + [SMALL_STATE(274)] = 11461, + [SMALL_STATE(275)] = 11467, + [SMALL_STATE(276)] = 11477, + [SMALL_STATE(277)] = 11487, + [SMALL_STATE(278)] = 11497, + [SMALL_STATE(279)] = 11507, + [SMALL_STATE(280)] = 11517, + [SMALL_STATE(281)] = 11527, + [SMALL_STATE(282)] = 11537, + [SMALL_STATE(283)] = 11547, + [SMALL_STATE(284)] = 11557, + [SMALL_STATE(285)] = 11567, + [SMALL_STATE(286)] = 11577, + [SMALL_STATE(287)] = 11587, + [SMALL_STATE(288)] = 11597, + [SMALL_STATE(289)] = 11607, + [SMALL_STATE(290)] = 11617, + [SMALL_STATE(291)] = 11627, + [SMALL_STATE(292)] = 11633, + [SMALL_STATE(293)] = 11643, + [SMALL_STATE(294)] = 11653, + [SMALL_STATE(295)] = 11663, + [SMALL_STATE(296)] = 11673, + [SMALL_STATE(297)] = 11683, + [SMALL_STATE(298)] = 11689, + [SMALL_STATE(299)] = 11699, + [SMALL_STATE(300)] = 11709, + [SMALL_STATE(301)] = 11716, + [SMALL_STATE(302)] = 11723, + [SMALL_STATE(303)] = 11730, + [SMALL_STATE(304)] = 11737, + [SMALL_STATE(305)] = 11742, + [SMALL_STATE(306)] = 11749, + [SMALL_STATE(307)] = 11756, + [SMALL_STATE(308)] = 11761, + [SMALL_STATE(309)] = 11766, + [SMALL_STATE(310)] = 11773, + [SMALL_STATE(311)] = 11780, + [SMALL_STATE(312)] = 11787, + [SMALL_STATE(313)] = 11794, + [SMALL_STATE(314)] = 11799, + [SMALL_STATE(315)] = 11806, + [SMALL_STATE(316)] = 11813, + [SMALL_STATE(317)] = 11820, + [SMALL_STATE(318)] = 11827, + [SMALL_STATE(319)] = 11832, + [SMALL_STATE(320)] = 11839, + [SMALL_STATE(321)] = 11844, + [SMALL_STATE(322)] = 11851, + [SMALL_STATE(323)] = 11858, + [SMALL_STATE(324)] = 11865, + [SMALL_STATE(325)] = 11870, + [SMALL_STATE(326)] = 11875, + [SMALL_STATE(327)] = 11880, + [SMALL_STATE(328)] = 11887, + [SMALL_STATE(329)] = 11891, + [SMALL_STATE(330)] = 11895, + [SMALL_STATE(331)] = 11899, + [SMALL_STATE(332)] = 11903, + [SMALL_STATE(333)] = 11907, + [SMALL_STATE(334)] = 11911, + [SMALL_STATE(335)] = 11915, + [SMALL_STATE(336)] = 11919, + [SMALL_STATE(337)] = 11923, + [SMALL_STATE(338)] = 11927, + [SMALL_STATE(339)] = 11931, + [SMALL_STATE(340)] = 11935, + [SMALL_STATE(341)] = 11939, + [SMALL_STATE(342)] = 11943, + [SMALL_STATE(343)] = 11947, + [SMALL_STATE(344)] = 11951, + [SMALL_STATE(345)] = 11955, + [SMALL_STATE(346)] = 11959, + [SMALL_STATE(347)] = 11963, + [SMALL_STATE(348)] = 11967, + [SMALL_STATE(349)] = 11971, + [SMALL_STATE(350)] = 11975, + [SMALL_STATE(351)] = 11979, + [SMALL_STATE(352)] = 11983, + [SMALL_STATE(353)] = 11987, + [SMALL_STATE(354)] = 11991, + [SMALL_STATE(355)] = 11995, + [SMALL_STATE(356)] = 11999, + [SMALL_STATE(357)] = 12003, + [SMALL_STATE(358)] = 12007, + [SMALL_STATE(359)] = 12011, + [SMALL_STATE(360)] = 12015, + [SMALL_STATE(361)] = 12019, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 0), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), - [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), - [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 1), - [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), - [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), - [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), - [27] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), - [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(8), - [32] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(57), - [35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), - [37] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(68), - [40] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(67), - [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), - [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), - [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), - [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), - [55] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), SHIFT_REPEAT(14), - [58] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), - [60] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), SHIFT_REPEAT(66), - [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), - [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), - [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), - [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 1), - [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), - [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument, 1, .production_id = 2), - [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), - [81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), - [83] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), - [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 3), - [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 4, .production_id = 1), - [89] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), - [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [93] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_type_repeat1, 2), SHIFT_REPEAT(33), - [96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_type_repeat1, 2), - [98] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 5), - [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 4, .production_id = 1), - [102] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 7, .production_id = 6), - [104] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), - [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), - [108] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 1), - [110] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 4), - [112] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), - [114] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), - [116] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), - [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_entity_name_repeat1, 2), - [120] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_entity_name_repeat1, 2), SHIFT_REPEAT(62), - [123] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 6), - [125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 4), - [127] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), - [129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 5, .production_id = 1), - [131] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 1), - [133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_entity_name, 2), - [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), - [137] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_argument_list_repeat1, 2), SHIFT_REPEAT(51), - [140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_argument_list_repeat1, 2), - [142] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_inline_javascript, 3), - [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [146] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 5), - [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_definition, 2), - [150] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 4), - [152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 3, .production_id = 2), - [154] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_entity_name, 1), - [156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 5), - [158] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 4), - [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument, 2, .production_id = 3), - [162] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), - [164] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 2), - [166] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 3), - [168] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), - [170] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), - [172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), - [174] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [176] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [178] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [180] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), - [182] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), - [184] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(198), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(306), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(301), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(303), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(305), + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(109), + [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(111), + [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(73), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(269), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(28), + [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(111), + [31] = {.entry = {.count = 1, .reusable = false}}, SHIFT(76), + [33] = {.entry = {.count = 1, .reusable = false}}, SHIFT(359), + [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(361), + [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75), + [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(245), + [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(251), + [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(112), + [45] = {.entry = {.count = 1, .reusable = false}}, SHIFT(115), + [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(165), + [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(115), + [51] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), + [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(122), + [55] = {.entry = {.count = 1, .reusable = false}}, SHIFT(128), + [57] = {.entry = {.count = 1, .reusable = false}}, SHIFT(129), + [59] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(129), + [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(246), + [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(256), + [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(176), + [69] = {.entry = {.count = 1, .reusable = false}}, SHIFT(197), + [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [73] = {.entry = {.count = 1, .reusable = true}}, SHIFT(119), + [75] = {.entry = {.count = 1, .reusable = false}}, SHIFT(131), + [77] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(197), + [81] = {.entry = {.count = 1, .reusable = false}}, SHIFT(159), + [83] = {.entry = {.count = 1, .reusable = true}}, SHIFT(92), + [85] = {.entry = {.count = 1, .reusable = false}}, SHIFT(346), + [87] = {.entry = {.count = 1, .reusable = false}}, SHIFT(353), + [89] = {.entry = {.count = 1, .reusable = true}}, SHIFT(87), + [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(250), + [93] = {.entry = {.count = 1, .reusable = true}}, SHIFT(249), + [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(117), + [97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(244), + [99] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(197), + [102] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(3), + [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), + [107] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(269), + [110] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(131), + [113] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(32), + [116] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(197), + [119] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(159), + [122] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(92), + [125] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(346), + [128] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(353), + [131] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(87), + [134] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(250), + [137] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_case_repeat1, 2), SHIFT_REPEAT(249), + [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [142] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(128), + [145] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(129), + [148] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(4), + [151] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), + [153] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(269), + [156] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(28), + [159] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(34), + [162] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(129), + [165] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(76), + [168] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(359), + [171] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(361), + [174] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(75), + [177] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(245), + [180] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_repeat1, 2), SHIFT_REPEAT(251), + [183] = {.entry = {.count = 1, .reusable = true}}, SHIFT(161), + [185] = {.entry = {.count = 1, .reusable = true}}, SHIFT(248), + [187] = {.entry = {.count = 1, .reusable = true}}, SHIFT(153), + [189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(240), + [191] = {.entry = {.count = 1, .reusable = true}}, SHIFT(168), + [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(254), + [195] = {.entry = {.count = 1, .reusable = true}}, SHIFT(242), + [197] = {.entry = {.count = 1, .reusable = true}}, SHIFT(243), + [199] = {.entry = {.count = 1, .reusable = false}}, SHIFT(181), + [201] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [203] = {.entry = {.count = 1, .reusable = true}}, SHIFT(172), + [205] = {.entry = {.count = 1, .reusable = true}}, SHIFT(181), + [207] = {.entry = {.count = 1, .reusable = false}}, SHIFT(180), + [209] = {.entry = {.count = 1, .reusable = true}}, SHIFT(99), + [211] = {.entry = {.count = 1, .reusable = true}}, SHIFT(180), + [213] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(127), + [216] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(2), + [219] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(269), + [222] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(28), + [225] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(34), + [228] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2), + [230] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(127), + [233] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(76), + [236] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(359), + [239] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(361), + [242] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(75), + [245] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(245), + [248] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 2), SHIFT_REPEAT(251), + [251] = {.entry = {.count = 1, .reusable = false}}, SHIFT(127), + [253] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [255] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), + [257] = {.entry = {.count = 1, .reusable = true}}, SHIFT(127), + [259] = {.entry = {.count = 1, .reusable = false}}, SHIFT(184), + [261] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_arguments_repeat1, 1), + [263] = {.entry = {.count = 1, .reusable = true}}, SHIFT(184), + [265] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_entity_name, 1), + [267] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_entity_name, 1), + [269] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_entity_name, 1), SHIFT(347), + [272] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if, 7), + [274] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if, 7), + [276] = {.entry = {.count = 1, .reusable = false}}, SHIFT(356), + [278] = {.entry = {.count = 1, .reusable = true}}, SHIFT(169), + [280] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_entity_name, 2), + [282] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_entity_name, 2), + [284] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_entity_name, 2), SHIFT(347), + [287] = {.entry = {.count = 1, .reusable = true}}, SHIFT(167), + [289] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_entity_name_repeat1, 2), + [291] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_entity_name_repeat1, 2), + [293] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_entity_name_repeat1, 2), SHIFT_REPEAT(347), + [296] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71), + [298] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__basic_expression, 1), + [300] = {.entry = {.count = 1, .reusable = false}}, SHIFT(72), + [302] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__basic_expression, 1), + [304] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym__basic_expression, 1), SHIFT(339), + [307] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym__basic_expression, 1), SHIFT(332), + [310] = {.entry = {.count = 1, .reusable = false}}, SHIFT(280), + [312] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operation, 3, .production_id = 8), + [314] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation, 3, .production_id = 8), + [316] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [318] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), + [320] = {.entry = {.count = 1, .reusable = false}}, SHIFT(65), + [322] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), + [324] = {.entry = {.count = 1, .reusable = false}}, SHIFT(63), + [326] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), + [328] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), + [330] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), + [332] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_negation, 2), + [334] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_negation, 2), + [336] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_negation, 2), SHIFT(24), + [339] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_negation, 2), SHIFT(330), + [342] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_negation, 2), SHIFT(80), + [345] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_negation, 2), SHIFT(67), + [348] = {.entry = {.count = 2, .reusable = false}}, REDUCE(sym_negation, 2), SHIFT(67), + [351] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), + [353] = {.entry = {.count = 1, .reusable = true}}, SHIFT(300), + [355] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string, 3), + [357] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string, 3), + [359] = {.entry = {.count = 1, .reusable = true}}, SHIFT(317), + [361] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string, 2), + [363] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string, 2), + [365] = {.entry = {.count = 1, .reusable = true}}, SHIFT(323), + [367] = {.entry = {.count = 1, .reusable = false}}, SHIFT(177), + [369] = {.entry = {.count = 1, .reusable = true}}, SHIFT(177), + [371] = {.entry = {.count = 1, .reusable = false}}, SHIFT(183), + [373] = {.entry = {.count = 1, .reusable = true}}, SHIFT(183), + [375] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_enum, 3), + [377] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum, 3), + [379] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_inline_function, 3), + [381] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_inline_function, 3), + [383] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 2), + [385] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 2), + [387] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_inline_javascript, 3), + [389] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_inline_javascript, 3), + [391] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array, 3), + [393] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array, 3), + [395] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 3), + [397] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 3), + [399] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tuple, 3), + [401] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tuple, 3), + [403] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record, 3), + [405] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record, 3), + [407] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_call, 2, .production_id = 3), + [409] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_call, 2, .production_id = 3), + [411] = {.entry = {.count = 1, .reusable = false}}, SHIFT(37), + [413] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [415] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), + [417] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [419] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39), + [421] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), + [423] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), + [425] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [427] = {.entry = {.count = 1, .reusable = false}}, SHIFT(41), + [429] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), + [431] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42), + [433] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), + [435] = {.entry = {.count = 1, .reusable = false}}, SHIFT(43), + [437] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), + [439] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48), + [441] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), + [443] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_inline_function, 2), + [445] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_inline_function, 2), + [447] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_inline_javascript, 2), + [449] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_inline_javascript, 2), + [451] = {.entry = {.count = 1, .reusable = false}}, SHIFT(179), + [453] = {.entry = {.count = 1, .reusable = true}}, SHIFT(179), + [455] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_array, 2), + [457] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_array, 2), + [459] = {.entry = {.count = 1, .reusable = false}}, SHIFT(125), + [461] = {.entry = {.count = 1, .reusable = true}}, SHIFT(125), + [463] = {.entry = {.count = 2, .reusable = false}}, REDUCE(sym_tuple, 2), REDUCE(sym_block, 2), + [466] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_tuple, 2), REDUCE(sym_block, 2), + [469] = {.entry = {.count = 1, .reusable = false}}, SHIFT(189), + [471] = {.entry = {.count = 1, .reusable = true}}, SHIFT(189), + [473] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), + [475] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), + [477] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bool, 1), + [479] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bool, 1), + [481] = {.entry = {.count = 1, .reusable = false}}, SHIFT(192), + [483] = {.entry = {.count = 1, .reusable = true}}, SHIFT(192), + [485] = {.entry = {.count = 1, .reusable = false}}, SHIFT(195), + [487] = {.entry = {.count = 1, .reusable = true}}, SHIFT(195), + [489] = {.entry = {.count = 1, .reusable = false}}, SHIFT(193), + [491] = {.entry = {.count = 1, .reusable = true}}, SHIFT(193), + [493] = {.entry = {.count = 1, .reusable = false}}, SHIFT(190), + [495] = {.entry = {.count = 1, .reusable = true}}, SHIFT(190), + [497] = {.entry = {.count = 1, .reusable = false}}, SHIFT(191), + [499] = {.entry = {.count = 1, .reusable = true}}, SHIFT(191), + [501] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_member, 3, .production_id = 7), + [503] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_member, 3, .production_id = 7), + [505] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_update, 4), + [507] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_update, 4), + [509] = {.entry = {.count = 1, .reusable = false}}, SHIFT(188), + [511] = {.entry = {.count = 1, .reusable = true}}, SHIFT(188), + [513] = {.entry = {.count = 1, .reusable = false}}, SHIFT(126), + [515] = {.entry = {.count = 1, .reusable = true}}, SHIFT(126), + [517] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record, 4), + [519] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record, 4), + [521] = {.entry = {.count = 1, .reusable = false}}, SHIFT(143), + [523] = {.entry = {.count = 1, .reusable = true}}, SHIFT(143), + [525] = {.entry = {.count = 1, .reusable = false}}, SHIFT(123), + [527] = {.entry = {.count = 1, .reusable = true}}, SHIFT(123), + [529] = {.entry = {.count = 1, .reusable = false}}, SHIFT(136), + [531] = {.entry = {.count = 1, .reusable = true}}, SHIFT(136), + [533] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tuple, 4), + [535] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tuple, 4), + [537] = {.entry = {.count = 1, .reusable = false}}, SHIFT(135), + [539] = {.entry = {.count = 1, .reusable = true}}, SHIFT(135), + [541] = {.entry = {.count = 1, .reusable = false}}, SHIFT(124), + [543] = {.entry = {.count = 1, .reusable = true}}, SHIFT(124), + [545] = {.entry = {.count = 1, .reusable = false}}, SHIFT(178), + [547] = {.entry = {.count = 1, .reusable = true}}, SHIFT(178), + [549] = {.entry = {.count = 1, .reusable = false}}, SHIFT(187), + [551] = {.entry = {.count = 1, .reusable = true}}, SHIFT(187), + [553] = {.entry = {.count = 1, .reusable = false}}, SHIFT(134), + [555] = {.entry = {.count = 1, .reusable = true}}, SHIFT(134), + [557] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string, 4), + [559] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string, 4), + [561] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_arguments, 3), + [563] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arguments, 3), + [565] = {.entry = {.count = 1, .reusable = false}}, SHIFT(138), + [567] = {.entry = {.count = 1, .reusable = true}}, SHIFT(138), + [569] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_arguments, 2), + [571] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arguments, 2), + [573] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_access, 4, .production_id = 7), + [575] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_access, 4, .production_id = 7), + [577] = {.entry = {.count = 1, .reusable = false}}, SHIFT(139), + [579] = {.entry = {.count = 1, .reusable = true}}, SHIFT(139), + [581] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_update, 5), + [583] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_update, 5), + [585] = {.entry = {.count = 1, .reusable = false}}, SHIFT(140), + [587] = {.entry = {.count = 1, .reusable = true}}, SHIFT(140), + [589] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string, 5), + [591] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string, 5), + [593] = {.entry = {.count = 1, .reusable = false}}, SHIFT(142), + [595] = {.entry = {.count = 1, .reusable = true}}, SHIFT(142), + [597] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_arguments, 4), + [599] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arguments, 4), + [601] = {.entry = {.count = 1, .reusable = false}}, SHIFT(137), + [603] = {.entry = {.count = 1, .reusable = true}}, SHIFT(137), + [605] = {.entry = {.count = 1, .reusable = false}}, SHIFT(185), + [607] = {.entry = {.count = 1, .reusable = true}}, SHIFT(185), + [609] = {.entry = {.count = 1, .reusable = false}}, SHIFT(182), + [611] = {.entry = {.count = 1, .reusable = true}}, SHIFT(182), + [613] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 1), + [615] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 1), + [617] = {.entry = {.count = 1, .reusable = true}}, SHIFT(110), + [619] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_statement, 1), SHIFT(57), + [622] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_statement, 1), SHIFT(24), + [625] = {.entry = {.count = 1, .reusable = true}}, SHIFT(330), + [627] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_statement, 1), SHIFT(80), + [630] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [632] = {.entry = {.count = 1, .reusable = false}}, SHIFT(67), + [634] = {.entry = {.count = 1, .reusable = false}}, SHIFT(281), + [636] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_else, 4), + [638] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_else, 4), + [640] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if, 8), + [642] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if, 8), + [644] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_statement, 1), SHIFT(166), + [647] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_record_update, 6), + [649] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_update, 6), + [651] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_case, 6), + [653] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case, 6), + [655] = {.entry = {.count = 1, .reusable = false}}, SHIFT(196), + [657] = {.entry = {.count = 1, .reusable = true}}, SHIFT(196), + [659] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_case, 7), + [661] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case, 7), + [663] = {.entry = {.count = 1, .reusable = false}}, SHIFT(186), + [665] = {.entry = {.count = 1, .reusable = true}}, SHIFT(186), + [667] = {.entry = {.count = 1, .reusable = false}}, SHIFT(194), + [669] = {.entry = {.count = 1, .reusable = true}}, SHIFT(194), + [671] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tuple_destructuring, 2), + [673] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_case_branch, 3), + [675] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_branch, 3), + [677] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_case_branch, 3), SHIFT(24), + [680] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_case_branch, 3), SHIFT(80), + [683] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_case_branch, 2), + [685] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_branch, 2), + [687] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_case_branch, 2), SHIFT(24), + [690] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_case_branch, 2), SHIFT(80), + [693] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_statement, 3, .production_id = 2), + [695] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_statement, 3, .production_id = 2), + [697] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_field, 3), + [699] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_statement, 3, .production_id = 2), REDUCE(sym_record_field, 3), + [702] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_statement, 3, .production_id = 2), SHIFT(24), + [705] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_statement, 3, .production_id = 2), SHIFT(80), + [708] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_array_repeat1, 1), + [710] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 1), + [712] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 1), SHIFT(24), + [715] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_array_repeat1, 1), SHIFT(80), + [718] = {.entry = {.count = 1, .reusable = false}}, SHIFT(85), + [720] = {.entry = {.count = 1, .reusable = true}}, SHIFT(350), + [722] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_entity_name, 1), SHIFT(328), + [725] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_entity_name, 2), SHIFT(328), + [728] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_entity_name_repeat1, 2), SHIFT_REPEAT(328), + [731] = {.entry = {.count = 1, .reusable = true}}, SHIFT(105), + [733] = {.entry = {.count = 1, .reusable = true}}, SHIFT(103), + [735] = {.entry = {.count = 1, .reusable = false}}, SHIFT(103), + [737] = {.entry = {.count = 1, .reusable = true}}, SHIFT(101), + [739] = {.entry = {.count = 1, .reusable = false}}, SHIFT(98), + [741] = {.entry = {.count = 1, .reusable = true}}, SHIFT(98), + [743] = {.entry = {.count = 1, .reusable = true}}, SHIFT(95), + [745] = {.entry = {.count = 1, .reusable = true}}, SHIFT(91), + [747] = {.entry = {.count = 1, .reusable = true}}, SHIFT(89), + [749] = {.entry = {.count = 1, .reusable = true}}, SHIFT(314), + [751] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_negation, 2), SHIFT(23), + [754] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_negation, 2), SHIFT(334), + [757] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_negation, 2), SHIFT(108), + [760] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_negation, 2), SHIFT(107), + [763] = {.entry = {.count = 1, .reusable = true}}, SHIFT(311), + [765] = {.entry = {.count = 1, .reusable = true}}, SHIFT(310), + [767] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_const, 4), + [769] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [771] = {.entry = {.count = 1, .reusable = true}}, SHIFT(334), + [773] = {.entry = {.count = 1, .reusable = true}}, SHIFT(108), + [775] = {.entry = {.count = 1, .reusable = true}}, SHIFT(107), + [777] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 5), + [779] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 4), + [781] = {.entry = {.count = 1, .reusable = true}}, SHIFT(97), + [783] = {.entry = {.count = 1, .reusable = true}}, SHIFT(150), + [785] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_tuple_repeat1, 2), + [787] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_arguments_repeat1, 2), + [789] = {.entry = {.count = 1, .reusable = true}}, SHIFT(164), + [791] = {.entry = {.count = 1, .reusable = true}}, SHIFT(340), + [793] = {.entry = {.count = 1, .reusable = true}}, SHIFT(130), + [795] = {.entry = {.count = 1, .reusable = true}}, SHIFT(297), + [797] = {.entry = {.count = 1, .reusable = true}}, SHIFT(355), + [799] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), + [801] = {.entry = {.count = 1, .reusable = true}}, SHIFT(151), + [803] = {.entry = {.count = 1, .reusable = true}}, SHIFT(351), + [805] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [807] = {.entry = {.count = 1, .reusable = true}}, SHIFT(344), + [809] = {.entry = {.count = 1, .reusable = true}}, SHIFT(113), + [811] = {.entry = {.count = 1, .reusable = true}}, SHIFT(291), + [813] = {.entry = {.count = 1, .reusable = true}}, SHIFT(88), + [815] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 1), + [817] = {.entry = {.count = 1, .reusable = true}}, SHIFT(199), + [819] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), + [821] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(199), + [824] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(306), + [827] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(301), + [830] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(303), + [833] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2), SHIFT_REPEAT(305), + [836] = {.entry = {.count = 1, .reusable = true}}, SHIFT(336), + [838] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_entity_name_repeat1, 2), SHIFT_REPEAT(336), + [841] = {.entry = {.count = 1, .reusable = true}}, SHIFT(207), + [843] = {.entry = {.count = 1, .reusable = true}}, SHIFT(333), + [845] = {.entry = {.count = 1, .reusable = true}}, SHIFT(225), + [847] = {.entry = {.count = 1, .reusable = true}}, SHIFT(349), + [849] = {.entry = {.count = 1, .reusable = true}}, SHIFT(358), + [851] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_component_repeat1, 2), SHIFT_REPEAT(205), + [854] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_component_repeat1, 2), SHIFT_REPEAT(333), + [857] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_component_repeat1, 2), + [859] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_component_repeat1, 2), SHIFT_REPEAT(349), + [862] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_component_repeat1, 2), SHIFT_REPEAT(358), + [865] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 1), + [867] = {.entry = {.count = 1, .reusable = true}}, SHIFT(236), + [869] = {.entry = {.count = 1, .reusable = true}}, SHIFT(205), + [871] = {.entry = {.count = 1, .reusable = true}}, SHIFT(227), + [873] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 4), + [875] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 3), + [877] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type, 5), + [879] = {.entry = {.count = 1, .reusable = true}}, SHIFT(223), + [881] = {.entry = {.count = 1, .reusable = true}}, SHIFT(235), + [883] = {.entry = {.count = 1, .reusable = true}}, SHIFT(211), + [885] = {.entry = {.count = 1, .reusable = true}}, SHIFT(215), + [887] = {.entry = {.count = 1, .reusable = true}}, SHIFT(224), + [889] = {.entry = {.count = 1, .reusable = true}}, SHIFT(200), + [891] = {.entry = {.count = 1, .reusable = true}}, SHIFT(222), + [893] = {.entry = {.count = 1, .reusable = true}}, SHIFT(234), + [895] = {.entry = {.count = 1, .reusable = true}}, SHIFT(221), + [897] = {.entry = {.count = 1, .reusable = true}}, SHIFT(232), + [899] = {.entry = {.count = 1, .reusable = true}}, SHIFT(229), + [901] = {.entry = {.count = 1, .reusable = true}}, SHIFT(216), + [903] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), SHIFT_REPEAT(219), + [906] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), + [908] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), SHIFT_REPEAT(349), + [911] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_module_repeat1, 2), SHIFT_REPEAT(358), + [914] = {.entry = {.count = 1, .reusable = true}}, SHIFT(217), + [916] = {.entry = {.count = 1, .reusable = true}}, SHIFT(231), + [918] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_enum_definition_repeat2, 2), SHIFT_REPEAT(211), + [921] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_enum_definition_repeat2, 2), SHIFT_REPEAT(221), + [924] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_enum_definition_repeat2, 2), + [926] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_enum_definition_repeat2, 2), SHIFT_REPEAT(200), + [929] = {.entry = {.count = 1, .reusable = true}}, SHIFT(230), + [931] = {.entry = {.count = 1, .reusable = true}}, SHIFT(219), + [933] = {.entry = {.count = 1, .reusable = true}}, SHIFT(226), + [935] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_definition, 4, .production_id = 1), + [937] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_component, 4), + [939] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 5, .production_id = 1), + [941] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_component, 5), + [943] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_definition, 6, .production_id = 1), + [945] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_definition, 7, .production_id = 1), + [947] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_definition, 9, .production_id = 1), + [949] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_definition, 6, .production_id = 1), + [951] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_definition, 5, .production_id = 1), + [953] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_definition, 5, .production_id = 1), + [955] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_enum_definition, 8, .production_id = 1), + [957] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 4, .production_id = 1), + [959] = {.entry = {.count = 1, .reusable = true}}, SHIFT(209), + [961] = {.entry = {.count = 1, .reusable = true}}, SHIFT(84), + [963] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), + [965] = {.entry = {.count = 1, .reusable = true}}, SHIFT(239), + [967] = {.entry = {.count = 1, .reusable = true}}, SHIFT(145), + [969] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_string_repeat1, 2), SHIFT_REPEAT(84), + [972] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_string_repeat1, 2), + [974] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_string_repeat1, 2), SHIFT_REPEAT(239), + [977] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 1), + [979] = {.entry = {.count = 1, .reusable = true}}, SHIFT(118), + [981] = {.entry = {.count = 1, .reusable = true}}, SHIFT(174), + [983] = {.entry = {.count = 1, .reusable = true}}, SHIFT(255), + [985] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 7, .production_id = 9), + [987] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 5), + [989] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 9), + [991] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), + [993] = {.entry = {.count = 1, .reusable = true}}, SHIFT(253), + [995] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 4, .production_id = 1), + [997] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [999] = {.entry = {.count = 1, .reusable = true}}, SHIFT(261), + [1001] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 5), + [1003] = {.entry = {.count = 1, .reusable = true}}, SHIFT(144), + [1005] = {.entry = {.count = 1, .reusable = true}}, SHIFT(238), + [1007] = {.entry = {.count = 1, .reusable = true}}, SHIFT(173), + [1009] = {.entry = {.count = 1, .reusable = true}}, SHIFT(241), + [1011] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), + [1013] = {.entry = {.count = 1, .reusable = true}}, SHIFT(237), + [1015] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_definition, 2), + [1017] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), + [1019] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 6, .production_id = 6), + [1021] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_inline_javascript_repeat1, 2), SHIFT_REPEAT(118), + [1024] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_inline_javascript_repeat1, 2), + [1026] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_inline_javascript_repeat1, 2), SHIFT_REPEAT(255), + [1029] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 5, .production_id = 6), + [1031] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_enum_definition_repeat1, 2), SHIFT_REPEAT(339), + [1034] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_enum_definition_repeat1, 2), + [1036] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [1038] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [1040] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument, 1, .production_id = 2), + [1042] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [1044] = {.entry = {.count = 1, .reusable = true}}, SHIFT(156), + [1046] = {.entry = {.count = 1, .reusable = true}}, SHIFT(302), + [1048] = {.entry = {.count = 1, .reusable = true}}, SHIFT(318), + [1050] = {.entry = {.count = 1, .reusable = true}}, SHIFT(258), + [1052] = {.entry = {.count = 1, .reusable = true}}, SHIFT(210), + [1054] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_argument_list_repeat1, 2), SHIFT_REPEAT(302), + [1057] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_argument_list_repeat1, 2), + [1059] = {.entry = {.count = 1, .reusable = true}}, SHIFT(322), + [1061] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), + [1063] = {.entry = {.count = 1, .reusable = true}}, SHIFT(262), + [1065] = {.entry = {.count = 1, .reusable = true}}, SHIFT(313), + [1067] = {.entry = {.count = 1, .reusable = true}}, SHIFT(106), + [1069] = {.entry = {.count = 1, .reusable = true}}, SHIFT(102), + [1071] = {.entry = {.count = 1, .reusable = true}}, SHIFT(148), + [1073] = {.entry = {.count = 1, .reusable = true}}, SHIFT(208), + [1075] = {.entry = {.count = 1, .reusable = true}}, SHIFT(339), + [1077] = {.entry = {.count = 1, .reusable = true}}, SHIFT(354), + [1079] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_record_definition_repeat1, 2), SHIFT_REPEAT(312), + [1082] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_definition_repeat1, 2), + [1084] = {.entry = {.count = 1, .reusable = true}}, SHIFT(90), + [1086] = {.entry = {.count = 1, .reusable = true}}, SHIFT(86), + [1088] = {.entry = {.count = 1, .reusable = true}}, SHIFT(329), + [1090] = {.entry = {.count = 1, .reusable = true}}, SHIFT(83), + [1092] = {.entry = {.count = 1, .reusable = true}}, SHIFT(160), + [1094] = {.entry = {.count = 1, .reusable = true}}, SHIFT(70), + [1096] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_record_update_repeat1, 2), SHIFT_REPEAT(322), + [1099] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_record_update_repeat1, 2), + [1101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(337), + [1103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), + [1105] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_tuple_repeat1, 2), SHIFT_REPEAT(110), + [1108] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_type_repeat1, 2), SHIFT_REPEAT(258), + [1111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_type_repeat1, 2), + [1113] = {.entry = {.count = 1, .reusable = true}}, SHIFT(304), + [1115] = {.entry = {.count = 1, .reusable = true}}, SHIFT(312), + [1117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(228), + [1119] = {.entry = {.count = 1, .reusable = true}}, SHIFT(158), + [1121] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 3), + [1123] = {.entry = {.count = 1, .reusable = true}}, SHIFT(233), + [1125] = {.entry = {.count = 1, .reusable = true}}, SHIFT(155), + [1127] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_arguments_repeat1, 2), SHIFT_REPEAT(27), + [1130] = {.entry = {.count = 1, .reusable = true}}, SHIFT(163), + [1132] = {.entry = {.count = 1, .reusable = true}}, SHIFT(338), + [1134] = {.entry = {.count = 1, .reusable = true}}, SHIFT(154), + [1136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [1138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 3), + [1140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument, 2, .production_id = 4), + [1142] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_record_definition_field, 2), + [1144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(309), + [1146] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 2), + [1148] = {.entry = {.count = 1, .reusable = true}}, SHIFT(131), + [1150] = {.entry = {.count = 1, .reusable = true}}, SHIFT(298), + [1152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(360), + [1154] = {.entry = {.count = 1, .reusable = true}}, SHIFT(213), + [1156] = {.entry = {.count = 1, .reusable = true}}, SHIFT(315), + [1158] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_argument_list, 4), + [1160] = {.entry = {.count = 1, .reusable = true}}, SHIFT(146), + [1162] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), + [1164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(82), + [1166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [1168] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tuple_destructuring, 3), + [1170] = {.entry = {.count = 1, .reusable = true}}, SHIFT(282), + [1172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(171), + [1174] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [1176] = {.entry = {.count = 1, .reusable = true}}, SHIFT(203), + [1178] = {.entry = {.count = 1, .reusable = true}}, SHIFT(214), + [1180] = {.entry = {.count = 1, .reusable = true}}, SHIFT(218), + [1182] = {.entry = {.count = 1, .reusable = true}}, SHIFT(274), + [1184] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [1186] = {.entry = {.count = 1, .reusable = true}}, SHIFT(93), + [1188] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [1190] = {.entry = {.count = 1, .reusable = true}}, SHIFT(204), + [1192] = {.entry = {.count = 1, .reusable = true}}, SHIFT(94), + [1194] = {.entry = {.count = 1, .reusable = true}}, SHIFT(212), + [1196] = {.entry = {.count = 1, .reusable = true}}, SHIFT(120), + [1198] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [1200] = {.entry = {.count = 1, .reusable = true}}, SHIFT(321), + [1202] = {.entry = {.count = 1, .reusable = true}}, SHIFT(335), + [1204] = {.entry = {.count = 1, .reusable = true}}, SHIFT(81), + [1206] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [1208] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [1210] = {.entry = {.count = 1, .reusable = true}}, SHIFT(121), + [1212] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tuple_destructuring, 4), + [1214] = {.entry = {.count = 1, .reusable = true}}, SHIFT(79), + [1216] = {.entry = {.count = 1, .reusable = true}}, SHIFT(78), + [1218] = {.entry = {.count = 1, .reusable = true}}, SHIFT(85), + [1220] = {.entry = {.count = 1, .reusable = true}}, SHIFT(247), + [1222] = {.entry = {.count = 1, .reusable = true}}, SHIFT(77), + [1224] = {.entry = {.count = 1, .reusable = true}}, SHIFT(220), + [1226] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74), }; #ifdef __cplusplus extern "C" { #endif +void *tree_sitter_mint_external_scanner_create(void); +void tree_sitter_mint_external_scanner_destroy(void *); +bool tree_sitter_mint_external_scanner_scan(void *, TSLexer *, const bool *); +unsigned tree_sitter_mint_external_scanner_serialize(void *, char *); +void tree_sitter_mint_external_scanner_deserialize(void *, const char *, unsigned); + #ifdef _WIN32 #define extern __declspec(dllexport) #endif @@ -1201,6 +12818,15 @@ extern const TSLanguage *tree_sitter_mint(void) { .alias_sequences = &ts_alias_sequences[0][0], .lex_modes = ts_lex_modes, .lex_fn = ts_lex, + .external_scanner = { + &ts_external_scanner_states[0][0], + ts_external_scanner_symbol_map, + tree_sitter_mint_external_scanner_create, + tree_sitter_mint_external_scanner_destroy, + tree_sitter_mint_external_scanner_scan, + tree_sitter_mint_external_scanner_serialize, + tree_sitter_mint_external_scanner_deserialize, + }, }; return &language; } diff --git a/grammar/src/scanner.c b/grammar/src/scanner.c new file mode 100644 index 000000000..f85ba7b70 --- /dev/null +++ b/grammar/src/scanner.c @@ -0,0 +1,73 @@ +#include +#include + +enum TokenType { + STRING_CHARS, + JAVASCRIPT_CHARS +}; + +void *tree_sitter_mint_external_scanner_create() { return NULL; } +void tree_sitter_mint_external_scanner_destroy(void *p) {} +void tree_sitter_mint_external_scanner_reset(void *p) {} +unsigned tree_sitter_mint_external_scanner_serialize(void *p, char *buffer) { return 0; } +void tree_sitter_mint_external_scanner_deserialize(void *p, const char *b, unsigned n) {} + +static void advance(TSLexer *lexer) { lexer->advance(lexer, false); } +static void skip(TSLexer *lexer) { lexer->advance(lexer, true); } + +static bool scan_string_chars(TSLexer *lexer) { + lexer->result_symbol = STRING_CHARS; + + for (bool has_content = false;; has_content = true) { + lexer->mark_end(lexer); + switch (lexer->lookahead) { + case '"': + return has_content; + case '\0': + return false; + case '#': + advance(lexer); + if (lexer->lookahead == '{') return has_content; + break; + // case '\\': + // return has_content; + default: + advance(lexer); + } + } +} + +static bool scan_javascript_chars(TSLexer *lexer) { + lexer->result_symbol = JAVASCRIPT_CHARS; + + for (bool has_content = false;; has_content = true) { + lexer->mark_end(lexer); + switch (lexer->lookahead) { + case '`': + return has_content; + case '\0': + return false; + case '#': + advance(lexer); + if (lexer->lookahead == '{') return has_content; + break; + // case '\\': + // return has_content; + default: + advance(lexer); + } + } +} + +bool tree_sitter_mint_external_scanner_scan(void *payload, TSLexer *lexer, + const bool *valid_symbols) { + if (valid_symbols[STRING_CHARS]) { + return scan_string_chars(lexer); + } + + if (valid_symbols[JAVASCRIPT_CHARS]) { + return scan_javascript_chars(lexer); + } + + return false; +} diff --git a/grammar/test/corpus/call-in-call.txt b/grammar/test/corpus/call-in-call.txt new file mode 100644 index 000000000..a2b94f98c --- /dev/null +++ b/grammar/test/corpus/call-in-call.txt @@ -0,0 +1,27 @@ +======================= +Call in Call +======================= + +module Test { + fun call : String { + Test.call() + } +} + +--- + +(program + (module + (entity_name) + (function + (variable) + (type_definition + (type + (entity_name))) + (statement + (call + (member + (entity_name) + (variable)) + (arguments)))))) + diff --git a/grammar/test/corpus/type.txt b/grammar/test/corpus/type.txt index 8e537cd2e..e383de901 100644 --- a/grammar/test/corpus/type.txt +++ b/grammar/test/corpus/type.txt @@ -17,6 +17,7 @@ module Test { (variable) (type_definition (type + (entity_name) (type (variable)))) (statement (inline_javascript))))) diff --git a/grammar/yarn.lock b/grammar/yarn.lock index e3d8430a3..8e970e1a4 100644 --- a/grammar/yarn.lock +++ b/grammar/yarn.lock @@ -2,7 +2,12 @@ # yarn lockfile v1 -tree-sitter-cli@^0.20.0: - version "0.20.0" - resolved "https://registry.yarnpkg.com/tree-sitter-cli/-/tree-sitter-cli-0.20.0.tgz#feaaa11c7ecf44a6e236aa1e2963b85d045d33cc" - integrity sha512-4D1qapWbJXZ5rrSUGM5rcw5Vuq/smzn9KbiFRhlON6KeuuXjra+KAtDYVrDgAoLIG4ku+jbEEGrJxCptUGi3dg== +nan@^2.15.0: + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== + +tree-sitter-cli@^0.20.1: + version "0.20.1" + resolved "https://registry.yarnpkg.com/tree-sitter-cli/-/tree-sitter-cli-0.20.1.tgz#9c6f1c79fd87d2a73a232dbceae673240741d785" + integrity sha512-I0Gp4ThRp39TDnBAaZKiogvoE85MSeL6/ILZMXbzeEo8hUsudpVhEHRE4CU+Bk5QUaiMiDkD+ZIL3gT2zZ++wg==