diff options
| author | mitchell <unknown> | 2019-06-04 18:08:37 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2019-06-04 18:08:37 -0400 |
| commit | 63312643ed52032ad9516533279c6b946478f562 (patch) | |
| tree | 3759e37106bb3bbb606b567c81ac66ce995b9b27 /lexlua/cpp.lua | |
| parent | 3d215b3c8e6238147a1fc7906076f7714fa4d39c (diff) | |
| download | scintilla-mirror-63312643ed52032ad9516533279c6b946478f562.tar.gz | |
lexlua: Support single quotes in C++14 integer literals.
Diffstat (limited to 'lexlua/cpp.lua')
| -rw-r--r-- | lexlua/cpp.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lexlua/cpp.lua b/lexlua/cpp.lua index b38e0120e..91a04f650 100644 --- a/lexlua/cpp.lua +++ b/lexlua/cpp.lua @@ -46,7 +46,11 @@ local block_comment = '/*' * (lexer.any - '*/')^0 * P('*/')^-1 lex:add_rule('comment', token(lexer.COMMENT, line_comment + block_comment)) -- Numbers. -lex:add_rule('number', token(lexer.NUMBER, lexer.float + lexer.integer)) +local dec = lexer.digit^1 * ("'" * lexer.digit^1)^0 +local hex = '0' * S('xX') * lexer.xdigit^1 * ("'" * lexer.xdigit^1)^0 +local bin = '0' * S('bB') * S('01')^1 * ("'" * S('01')^1)^0 +local integer = S('+-')^-1 * (hex + bin + dec) +lex:add_rule('number', token(lexer.NUMBER, lexer.float + integer)) -- Preprocessor. local preproc_word = word_match[[ |
