diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-06-24 16:43:42 +0200 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-06-24 16:43:42 +0200 |
commit | 367347debb68da0e4b67c0e7a24b741a3259ae87 (patch) | |
tree | 1fa9ed8005fdf2e501a918e90f42d9a763b21181 /Grammar.pp | |
parent | 68c1f0d5f25f75d052320a8acf07e934fca3fcf1 (diff) | |
download | Praspel-367347debb68da0e4b67c0e7a24b741a3259ae87.zip Praspel-367347debb68da0e4b67c0e7a24b741a3259ae87.tar.gz Praspel-367347debb68da0e4b67c0e7a24b741a3259ae87.tar.bz2 |
Add the regex syntactic sugar: /r/m:s.
/r/[m][:s] where r is a regex, m is a modifier and s the maximum size.
It is strictly equivalent to regex('/r/[m]', s).
Diffstat (limited to 'Grammar.pp')
-rw-r--r-- | Grammar.pp | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -235,7 +235,7 @@ constant: scalar() | array() scalar: - <null> | boolean() | number() | string() | <regex> | range() + <null> | boolean() | number() | string() | regex() | range() boolean: <true> | <false> @@ -252,6 +252,14 @@ quoted_string: ( ( <escaped> | <accepted> | <string> | ::concat:: ) #concatenation )* ::_quote:: +#regex: + <regex> ( ::colon:: ( range() | number() ) )? + +#range: + number() ::range:: number() + | number() ::range:: #left_range + | ::range:: number() #right_range + #array: ::bracket_:: ( pair() ( ::comma:: pair() )* )? @@ -261,11 +269,6 @@ pair: ( ::from::? representation() ::to:: representation() #pair ) | ::to::? representation() -#range: - number() ::range:: number() - | number() ::range:: #left_range - | ::range:: number() #right_range - extended_identifier: ( ::count:: #count )? arrayaccess() |