From be560825002566504cd4c79386005c908039df76 Mon Sep 17 00:00:00 2001 From: Kamil Jakubus Date: Mon, 23 Sep 2024 04:38:52 +0200 Subject: [PATCH] parser: do not allow standalone labels anymore --- grammar.js | 3 +-- test/corpus/basic.txt | 15 +++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/grammar.js b/grammar.js index df21c7b..40805c4 100644 --- a/grammar.js +++ b/grammar.js @@ -1467,8 +1467,7 @@ module.exports = grammar({ $.button_definition, $.run_statement, $.enum_statement, - $.abl_statement, - prec.left(PREC.EXTRA, $.label) + $.abl_statement ) } }); diff --git a/test/corpus/basic.txt b/test/corpus/basic.txt index 4f7ee47..c8adff5 100644 --- a/test/corpus/basic.txt +++ b/test/corpus/basic.txt @@ -11,18 +11,6 @@ COMMENT (comment) (comment)) -================================================================================ -LABEL -================================================================================ - -x: - --------------------------------------------------------------------------------- - -(source_code - (label - (identifier))) - ================================================================================ COMMENT (long) ================================================================================ @@ -1726,6 +1714,7 @@ DO ON QUIT UNDO, RETURN ERROR: QUIT. END. +labeled: DO ON STOP UNDO label1, LEAVE label2: STOP. END. @@ -1751,6 +1740,8 @@ END. (abl_statement (identifier)))) (do_block + (label + (identifier)) (on_stop_phrase (identifier) (identifier))