From 6615eafeb81f17f4be5abd3b39b77adee6aa0f6b Mon Sep 17 00:00:00 2001 From: Adam Grabski Date: Fri, 10 Apr 2020 16:39:17 +0200 Subject: [PATCH 1/5] Make sample grammar for modes more readable add a new line to the grammar used as an example for the mode changing operators to make the example more accessible --- doc/lexer-rules.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/lexer-rules.md b/doc/lexer-rules.md index 5070f4790..d580743a0 100644 --- a/doc/lexer-rules.md +++ b/doc/lexer-rules.md @@ -244,7 +244,8 @@ The mode commands alter the mode stack and hence the mode of the lexer. The 'mor ``` // Default "mode": Everything OUTSIDE of a tag COMMENT : '' ; -CDATA : '' ;OPEN : '<' -> pushMode(INSIDE) ; +CDATA : '' ; +OPEN : '<' -> pushMode(INSIDE) ; ... XMLDeclOpen : ' pushMode(INSIDE) ; SPECIAL_OPEN: ' more, pushMode(PROC_INSTR) ; From 48dff06b8ec057aa8f45dc0adf0c1945788d0198 Mon Sep 17 00:00:00 2001 From: Adam Grabski Date: Fri, 10 Apr 2020 16:42:51 +0200 Subject: [PATCH 2/5] Update contributors.txt --- contributors.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contributors.txt b/contributors.txt index ee58ff694..a33b8bc63 100644 --- a/contributors.txt +++ b/contributors.txt @@ -240,4 +240,5 @@ YYYY/MM/DD, github id, Full name, email 2020/02/02, carocad, Camilo Roca, carocad@unal.edu.co 2020/02/10, julibert, Julián Bermúdez Ortega, julibert.dev@gmail.com 2020/02/21, StochasticTinkr, Daniel Pitts, github@coloraura.com -2020/03/17, XsongyangX, Song Yang, songyang1218@gmail.com \ No newline at end of file +2020/03/17, XsongyangX, Song Yang, songyang1218@gmail.com +2020/04/10, agrabski, Adam Grabski, adam.gr@outlook.com From c40d68f92c48bc1599397e69fcb5c57a6c33b802 Mon Sep 17 00:00:00 2001 From: "[OXID-PS] Keywan Ghadami" Date: Fri, 22 May 2020 00:07:47 +0200 Subject: [PATCH 3/5] fix composer command in documentation see also https://github.com/antlr/antlr-php-runtime --- doc/php-target.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/php-target.md b/doc/php-target.md index 75eae465c..d0f010528 100644 --- a/doc/php-target.md +++ b/doc/php-target.md @@ -15,7 +15,7 @@ generated by ANTLR4. The runtime provides a common set of tools for using your p Install the runtime with Composer: ```bash -composer install antlr/antlr4 +composer require antlr4-php-runtime ``` #### 3. Generate your parser @@ -108,4 +108,4 @@ The expected output is: {"a":1} "a":1 1 -``` \ No newline at end of file +``` From 11775efabfd6f940277421cef3a0726f63018c8f Mon Sep 17 00:00:00 2001 From: "[OXID-PS] Keywan Ghadami" Date: Fri, 22 May 2020 00:12:29 +0200 Subject: [PATCH 4/5] signing contributer agreement --- contributors.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contributors.txt b/contributors.txt index d1c759981..1378857ee 100644 --- a/contributors.txt +++ b/contributors.txt @@ -242,4 +242,5 @@ YYYY/MM/DD, github id, Full name, email 2020/02/21, StochasticTinkr, Daniel Pitts, github@coloraura.com 2020/03/17, XsongyangX, Song Yang, songyang1218@gmail.com 2020/04/07, deniskyashif, Denis Kyashif, denis.kyashif@gmail.com -2020/04/30, TristonianJones, Tristan Swadell, tswadell@google.com \ No newline at end of file +2020/04/30, TristonianJones, Tristan Swadell, tswadell@google.com +2020/05/22, keywan-ghadami-oxid, Keywan Ghadami, keywan.ghadami@oxid-esales.com From 835bd709a8ebfe5dbe4d671a60a841a0f9a18879 Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Fri, 19 Jun 2020 01:05:13 +0200 Subject: [PATCH 5/5] Be more precise in documentation of char set when escaping is needed --- doc/lexer-rules.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/lexer-rules.md b/doc/lexer-rules.md index 5070f4790..b12f54a88 100644 --- a/doc/lexer-rules.md +++ b/doc/lexer-rules.md @@ -58,7 +58,7 @@ Match that character or sequence of characters. E.g., ’while’ or ’=’. [char set] -

Match one of the characters specified in the character set. Interpret x-y as the set of characters between range x and y, inclusively. The following escaped characters are interpreted as single special characters: \n, \r, \b, \t, \f, \uXXXX, and \u{XXXXXX}. To get ], \, or - you must escape them with \.

+

Match one of the characters specified in the character set. Interpret x-y as the set of characters between range x and y, inclusively. The following escaped characters are interpreted as single special characters: \n, \r, \b, \t, \f, \uXXXX, and \u{XXXXXX}. To get ] or \ you must escape them with \. To get - you must escape it with \ too, except for the case when - is the first or last character in the set.

You can also include all characters matching Unicode properties (general category, boolean, or enumerated including scripts and blocks) with \p{PropertyName} or \p{EnumProperty=Value}. (You can invert the test with \P{PropertyName} or \P{EnumProperty=Value}).

@@ -90,6 +90,8 @@ UNICODE_ID : [\p{Alpha}\p{General_Category=Other_Letter}] [\p{Alnum}\p{General_C EMOJI : [\u{1F4A9}\u{1F926}] ; // note Unicode code points > U+FFFF DASHBRACK : [\-\]]+ ; // match - or ] one or more times + +DASH : [---] ; // match a single -, i.e., "any character" between - and - (note first and last - not escaped)