From 900e462bcdf4b3dec97eccde6f92abc7e091394d Mon Sep 17 00:00:00 2001 From: Dustin Wilson Date: Thu, 1 Jul 2021 17:01:15 -0500 Subject: [PATCH] Wrote JSON to Grammar converter, successfully parses all grammars tested --- data/xml/xml.json | 12 +- lib/FauxReadOnly.php | 6 +- lib/Grammar.php | 168 ++++++++++++++++++++++----- lib/Grammar/CaptureList.php | 18 +++ lib/Grammar/GrammarInclude.php | 35 ++++++ lib/Grammar/ImmutableList.php | 31 ++++- lib/Grammar/Include.php | 32 ----- lib/Grammar/InjectionList.php | 2 +- lib/Grammar/NamedPatternListList.php | 2 +- lib/Grammar/Pattern.php | 10 +- lib/Grammar/PatternList.php | 4 +- lib/Scope/Matchers/GroupMatcher.php | 4 +- lib/Scope/Matchers/PathMatcher.php | 4 +- lib/Scope/Parser.php | 4 +- 14 files changed, 241 insertions(+), 91 deletions(-) create mode 100644 lib/Grammar/CaptureList.php create mode 100644 lib/Grammar/GrammarInclude.php delete mode 100644 lib/Grammar/Include.php diff --git a/data/xml/xml.json b/data/xml/xml.json index 921fdf0..036bc80 100644 --- a/data/xml/xml.json +++ b/data/xml/xml.json @@ -431,12 +431,12 @@ { "begin": "<%--", "captures": { - "0": { - "name": "punctuation.definition.comment.xml" - }, - "end": "--%>", - "name": "comment.block.xml" - } + "0": { + "name": "punctuation.definition.comment.xml" + } + }, + "end": "--%>", + "name": "comment.block.xml" }, { "begin": "