From 3b4be40ef780faef07580545e9468dafedada79b Mon Sep 17 00:00:00 2001 From: ProgramSnail Date: Tue, 18 Jul 2023 15:17:02 +0300 Subject: [PATCH] access -> array_access --- corpus/edigits_like.langexp | 2 +- corpus/test.langexp | 18 +++++++++--------- grammar.g4 | 4 ++-- grammar.js | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/corpus/edigits_like.langexp b/corpus/edigits_like.langexp index 11ddb7a..e0919bd 100644 --- a/corpus/edigits_like.langexp +++ b/corpus/edigits_like.langexp @@ -84,7 +84,7 @@ test_k 'n 'k : Int Int -> Bool = { (number_literal)) (name_expression (reference - (access + (array_access (simple_name_identifier) (number_literal))) (simple_name_identifier)) diff --git a/corpus/test.langexp b/corpus/test.langexp index 9e3d7cc..02fe5dd 100644 --- a/corpus/test.langexp +++ b/corpus/test.langexp @@ -671,12 +671,12 @@ arg_deduction_example 'name 'duration : <- String <- Float -> Task = Task 'name (comma_expression (condition (operator_expression - (access + (array_access (argument_name_identifier) (name_expression (simple_name_identifier))) (operator) - (access + (array_access (argument_name_identifier) (operator_expression (name_expression @@ -685,11 +685,11 @@ arg_deduction_example 'name 'duration : <- String <- Float -> Task = Task 'name (number_literal)))) (name_expression (simple_name_identifier) - (access + (array_access (argument_name_identifier) (name_expression (simple_name_identifier))) - (access + (array_access (argument_name_identifier) (operator_expression (name_expression @@ -736,12 +736,12 @@ arg_deduction_example 'name 'duration : <- String <- Float -> Task = Task 'name (comma_expression (condition (operator_expression - (access + (array_access (argument_name_identifier) (name_expression (simple_name_identifier))) (operator) - (access + (array_access (argument_name_identifier) (operator_expression (name_expression @@ -750,11 +750,11 @@ arg_deduction_example 'name 'duration : <- String <- Float -> Task = Task 'name (number_literal)))) (name_expression (simple_name_identifier) - (access + (array_access (argument_name_identifier) (name_expression (simple_name_identifier))) - (access + (array_access (argument_name_identifier) (operator_expression (name_expression @@ -893,7 +893,7 @@ arg_deduction_example 'name 'duration : <- String <- Float -> Task = Task 'name (simple_name_identifier)) (case (reference - (access + (array_access (simple_name_identifier) (number_literal))))))) (function_definition diff --git a/grammar.g4 b/grammar.g4 index 915f12b..7e34246 100644 --- a/grammar.g4 +++ b/grammar.g4 @@ -62,7 +62,7 @@ array: '[[' (scoped_expression)+ ']]' ; name_definition: (('%' | 'let') | ('$' | 'var')) (SIMPLE_NAME_IDENTIFIER | PLACEHOLDER) ; -access: scoped_expression '[' super_expression ']' ; +array_access: scoped_expression '[' super_expression ']' ; tuple_access: scoped_expression, '.' NUMBER_LITERAL @@ -113,7 +113,7 @@ not_name_scoped_expression: block | array | PLACEHOLDER | name_definition - | access + | array_access | tuple_access | loop_control | reference diff --git a/grammar.js b/grammar.js index 2c2b567..d753731 100644 --- a/grammar.js +++ b/grammar.js @@ -139,7 +139,7 @@ module.exports = grammar({ choice($.simple_name_identifier, $.placeholder), ), - access: $ => seq($._scoped_expression, '[', $._super_expression, ']'), + array_access: $ => seq($._scoped_expression, '[', $._super_expression, ']'), tuple_access: $ => seq($._scoped_expression, '.', $.number_literal), @@ -202,7 +202,7 @@ module.exports = grammar({ $.array, $.placeholder, $.name_definition, - $.access, + $.array_access, $.tuple_access, $.loop_control, $.reference,