vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit df92eb2a37edbdc1d3aad4a1c173a08a4d10be26 parent fd5a622482d55a5f10ba37c8c6d58950fb2c4bb0 Author: S. Gilles <sgilles@math.umd.edu> Date: Sun, 1 Jan 2017 15:04:01 -0500 lua: adjust C lexer to recognize POSIX types Diffstat:
| M | lua/lexers/ansi_c.lua | | | 9 | ++++++--- |
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git 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)