summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmLex.x
diff options
context:
space:
mode:
authorMichael D. Adams <t-madams@microsoft.com>2007-05-10 15:03:50 +0000
committerMichael D. Adams <t-madams@microsoft.com>2007-05-10 15:03:50 +0000
commitf8ec4ec53ba9377254af4c0c0d3787bbe1e27be3 (patch)
treef3588d41d6573419eccddb65c73da582898a18e4 /compiler/cmm/CmmLex.x
parente9a0f76386366ef0f1554e6cf0024a06252c3013 (diff)
downloadhaskell-f8ec4ec53ba9377254af4c0c0d3787bbe1e27be3.tar.gz
Fixed the C-- lexer to comply with the standard on hex escape sequences.
The C-- standard [1] says in Section 3.3.5 "Character literals" that: - the hex escape sequence "must contain at least one and at most two hexdigits." - the octal escape sequence "must contain at least one and at most three octdigits." [1] Norman Ramsey, Simon Peyton Jones, and Christian Lindig. "The C-- Language Specication, Version 2.0 ( CVS Revision 1.128 )" <http://www.cminusminus.org/extern/man2.pdf>
Diffstat (limited to 'compiler/cmm/CmmLex.x')
-rw-r--r--compiler/cmm/CmmLex.x2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x
index ee05122f49..cc477964fd 100644
--- a/compiler/cmm/CmmLex.x
+++ b/compiler/cmm/CmmLex.x
@@ -56,7 +56,7 @@ $namechar = [$namebegin $digit]
@floating_point = @decimal \. @decimal @exponent? | @decimal @exponent
-@escape = \\ ([abfnrt\\\'\"\?] | x @hexadecimal | @octal)
+@escape = \\ ([abfnrt\\\'\"\?] | x $hexit{1,2} | $octit{1,3})
@strchar = ($printable # [\"\\]) | @escape
cmm :-