diff options
author | Melody Horn <melody@boringcactus.com> | 2020-10-25 11:33:15 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2020-10-25 11:33:15 -0600 |
commit | dbf6153704c67a5dcbd9cf2ab67486f06ebf8f24 (patch) | |
tree | 3ce58e2383fd8f271f7ceaa2f1e0597a2a09cf68 | |
parent | 35d68fc150ef7ee6064f5be13c19d5f7a33ef279 (diff) | |
download | reference-compiler-dbf6153704c67a5dcbd9cf2ab67486f06ebf8f24.tar.gz reference-compiler-dbf6153704c67a5dcbd9cf2ab67486f06ebf8f24.zip |
add octal literals
-rw-r--r-- | crowbar_reference_compiler/scanner.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crowbar_reference_compiler/scanner.py b/crowbar_reference_compiler/scanner.py index 438b179..ea34536 100644 --- a/crowbar_reference_compiler/scanner.py +++ b/crowbar_reference_compiler/scanner.py @@ -26,7 +26,7 @@ class GenerousTokenList(List[Token]): KEYWORD = re.compile("bool|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|fragile|function|if|include|int|long|return|short|signed|sizeof|struct|switch|typedef|unsigned|void|while") IDENTIFIER = re.compile(r"[\p{L}\p{Pc}\p{Sk}\p{Mn}][\p{L}\p{Pc}\p{Sk}\p{Mn}\p{N}]*") -CONSTANT = re.compile(r"""([0-9_]+)|(0[bB][01_]+)|(0[xX][0-9a-fA-F_]+)|([0-9_]+(\.[0-9_]+|[eE][0-9_]+|\.[0-9_]+[eE][0-9_]+))|('([^\'\\]|\\'|\\"|\\\\|\\r|\\n|\\t|\\0|\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})')""") +CONSTANT = re.compile(r"""([0-9_]+)|(0[bB][01_]+)|0o[0-7_]+|(0[xX][0-9a-fA-F_]+)|([0-9_]+(\.[0-9_]+|[eE][0-9_]+|\.[0-9_]+[eE][0-9_]+))|('([^\'\\]|\\'|\\"|\\\\|\\r|\\n|\\t|\\0|\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})')""") STRING_LITERAL = re.compile(r'''"([^\\"]|\\'|\\"|\\\\|\\r|\\n|\\t|\\0|\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})*"''') PUNCTUATOR = re.compile(r"->|\+\+|--|>>|<<|<=|>=|&&|\|\||[=!+\-*/%&|^]=|[\[\](){}.,+\-*/%;!&|^~><=]") WHITESPACE = re.compile(r"[\p{Zs}\p{Cc}]+") |