Ensure that the docs examples verify as Cretonne IL.

Any *.cton files in the docs directory are now included when running the
test-all.sh script. This is to ensure that the examples are in fact
correct IL.

Always print NaN and Inf floats with a sign. Print the positive ones as
+NaN and +Inf to make them easier to parse.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-10 12:47:16 -07:00
parent b474485c0d
commit 0c3771bccb
5 changed files with 49 additions and 36 deletions

View File

@@ -39,7 +39,7 @@ class CretonneLexer(RegexLexer):
# Numbers.
(r'[-+]?0[xX][0-9a-fA-F]+', Number.Hex),
(r'[-+]?0[xX][0-9a-fA-F]*\.[0-9a-fA-F]*([pP]\d+)?', Number.Hex),
(r'[-+]?(\d+\.\d+([eE]\d+)?|[sq]NaN|Inf)', Number.Float),
(r'[-+]?(\d+\.\d+([eE]\d+)?|s?NaN|Inf)', Number.Float),
(r'[-+]?\d+', Number.Integer),
# Known attributes.
(keywords('align', 'aligntrap', 'uext', 'sext', 'inreg'),