Switch SIMD type spelling to i32x4.

Add support for 'type variables' in type directives.
This commit is contained in:
Jakob Stoklund Olesen
2016-01-21 16:39:45 -08:00
parent 75544db19a
commit c228c0b3ae
3 changed files with 79 additions and 40 deletions

View File

@@ -15,10 +15,14 @@ class CretonneLexer(RegexLexer):
(r';.*?$', Comment.Single),
(r'\b(function|entry)\b', Keyword),
(r'\b(align)\b', Name.Attribute),
(r'\b(v\d+)?(bool|i\d+|f32|f64)\b', Keyword.Type),
# Well known value types.
(r'\b(bool|i\d+|f32|f64)(x\d+)?\b', Keyword.Type),
(r'\d+', Number.Integer),
(r'0[xX][0-9a-fA-F]+', Number.Hex),
(r'(v|ss|ebb)\d+', Name.Variable),
# v<nn> = value
# ss<nn> = stack slot
(r'(v|ss)\d+', Name.Variable),
# ebb<nn> = extended basic block
(r'(ebb)\d+', Name.Label),
(r'(=)( *)([a-z]\w*)', bygroups(Operator, Whitespace, Name.Function)),
(r'^( +)([a-z]\w*\b)(?! *[,=])', bygroups(Whitespace, Name.Function)),