Skip to content

Commit d13f838

Browse files
ktprogramsalecthomas
authored andcommitted
Added uint8_t to c lexer.
Copied the KeywordType rule from the c++ lexer (but removed wchar_t since it doesn't exist in c).
1 parent 402a150 commit d13f838

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lexers/c/c.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func cRules() Rules {
4343
{`[~!%^&*+=|?:<>/-]`, Operator, nil},
4444
{`[()\[\],.]`, Punctuation, nil},
4545
{Words(``, `\b`, `asm`, `auto`, `break`, `case`, `const`, `continue`, `default`, `do`, `else`, `enum`, `extern`, `for`, `goto`, `if`, `register`, `restricted`, `return`, `sizeof`, `static`, `struct`, `switch`, `typedef`, `union`, `volatile`, `while`), Keyword, nil},
46-
{`(bool|int|long|float|short|double|char|unsigned|signed|void)\b`, KeywordType, nil},
46+
{`(bool|int|long|float|short|double|char((8|16|32)_t)?|unsigned|signed|void|u?int(_fast|_least|)(8|16|32|64)_t)\b`, KeywordType, nil},
4747
{Words(``, `\b`, `inline`, `_inline`, `__inline`, `naked`, `restrict`, `thread`, `typename`), KeywordReserved, nil},
4848
{`(__m(128i|128d|128|64))\b`, KeywordReserved, nil},
4949
{Words(`__`, `\b`, `asm`, `int8`, `based`, `except`, `int16`, `stdcall`, `cdecl`, `fastcall`, `int32`, `declspec`, `finally`, `int64`, `try`, `leave`, `wchar_t`, `w64`, `unaligned`, `raise`, `noop`, `identifier`, `forceinline`, `assume`), KeywordReserved, nil},

0 commit comments

Comments
 (0)