diff options
| author | S. Gilles <sgilles@math.umd.edu> | 2017-01-01 15:04:01 -0500 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-01-05 22:00:47 +0100 |
| commit | 030ba53fbfb267c35a1440f7761020fc6a4a24db (patch) | |
| tree | 1385750b93ae37e18745ebd4752f6dd309f6f651 /lua | |
| parent | cc776730a7ddfb535d95548df6f50387be8718ff (diff) | |
| download | vis-030ba53fbfb267c35a1440f7761020fc6a4a24db.tar.gz vis-030ba53fbfb267c35a1440f7761020fc6a4a24db.tar.xz | |
lua: adjust C lexer to recognize POSIX types
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lexers/ansi_c.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lua/lexers/ansi_c.lua b/lua/lexers/ansi_c.lua index 5c8e007..68f8a9f 100644 --- a/lua/lexers/ansi_c.lua +++ b/lua/lexers/ansi_c.lua @@ -40,9 +40,12 @@ local keyword = token(l.KEYWORD, word_match{ -- Types. local type = token(l.TYPE, word_match{ - 'char', 'double', 'enum', 'float', 'int', 'long', 'short', 'signed', 'struct', - 'union', 'unsigned', 'void', '_Bool', '_Complex', '_Imaginary' -}) + 'bool', 'char', 'double', 'enum', 'float', 'int', 'long', 'short', + 'signed', 'struct', 'union', 'unsigned', 'void', '_Bool', '_Complex', + '_Imaginary', 'ptrdiff_t', 'size_t', 'max_align_t', 'wchar_t', + 'intptr_t', 'uintptr_t', 'intmax_t', 'uintmax_t'} + + (P('u')^-1 * P('int') * (P('_least') + P('_fast'))^-1 * l.dec_num^1 * P('_t')) +) -- Identifiers. local identifier = token(l.IDENTIFIER, l.word) |
