aboutsummaryrefslogtreecommitdiffstats
path: root/Grammar.pp
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-02-20 11:27:01 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-02-20 11:27:01 +0100
commit43f4ab7d0e7e17fb35ef9b64172fda1d73ef457e (patch)
tree323d58af49c7aa0ba012a3ea1bb488169174e5c8 /Grammar.pp
parent828df3699a17085da4882c764df663ce773cc25a (diff)
downloadPraspel-43f4ab7d0e7e17fb35ef9b64172fda1d73ef457e.zip
Praspel-43f4ab7d0e7e17fb35ef9b64172fda1d73ef457e.tar.gz
Praspel-43f4ab7d0e7e17fb35ef9b64172fda1d73ef457e.tar.bz2
Add the “accepted” token.
It helps to recognize an invalid escape character, such as: Foo\Bar\Baz, which is equivalent to Foo\\Bar\\Baz.
Diffstat (limited to 'Grammar.pp')
-rw-r--r--Grammar.pp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Grammar.pp b/Grammar.pp
index 956f52e..1fe9dd0 100644
--- a/Grammar.pp
+++ b/Grammar.pp
@@ -107,6 +107,7 @@
%token decimal [\+\-]?(0|[1-9]\d*)(\.\d+)?([eE][\+\-]?\d+)?
%token quote_ ' -> string
%token string:escaped \\(['nrtvef\\b]|[0-7]{1,3}|[xX][0-9a-fA-F]{1,2})
+%token string:accepted \\
%token string:string [^'\\]+
%token string:concat '\s*\.\s*'
%token string:_quote ' -> default
@@ -230,8 +231,8 @@ string:
quoted_string:
::quote_::
- ( <escaped> | <string> | ::concat:: #concatenation )
- ( ( <escaped> | <string> | ::concat:: ) #concatenation )*
+ ( <escaped> | <accepted> | <string> | ::concat:: #concatenation )
+ ( ( <escaped> | <accepted> | <string> | ::concat:: ) #concatenation )*
::_quote::
#array: