From b3b9e48a2710d9162a70eac5162d6ba195b87498 Mon Sep 17 00:00:00 2001 From: Kamil Jakubus Date: Thu, 19 Sep 2024 01:30:26 +0200 Subject: [PATCH] parser: allow new_expressiona and function_call to be object accessed --- grammar.js | 5 ++++- test/corpus/basic.txt | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/grammar.js b/grammar.js index ae28561..9554e20 100644 --- a/grammar.js +++ b/grammar.js @@ -742,7 +742,10 @@ module.exports = grammar({ object_access: ($) => seq( - field("object", $.identifier), + field( + "object", + choice($.identifier, $.new_expression, $.function_call) + ), repeat1(seq(alias($._namecolon, ":"), field("property", $.identifier))) ), diff --git a/test/corpus/basic.txt b/test/corpus/basic.txt index 0d3278a..78c69f7 100644 --- a/test/corpus/basic.txt +++ b/test/corpus/basic.txt @@ -1175,6 +1175,9 @@ DISPLAY some_object:chained_property:chained_another:method(). PUT some_object:array[5]. +Object:Length = new OpenEdge.Core.String(pcMessage):Size. +oObject:Length -= String(pcMessage):Size. + -------------------------------------------------------------------------------- (source_code