aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/cpp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lexers/cpp.lua')
-rw-r--r--lua/lexers/cpp.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/lua/lexers/cpp.lua b/lua/lexers/cpp.lua
index 6ee1ffb..ec3daad 100644
--- a/lua/lexers/cpp.lua
+++ b/lua/lexers/cpp.lua
@@ -26,10 +26,13 @@ local number = token(l.NUMBER, l.float + l.integer)
-- Preprocessor.
local preproc_word = word_match{
'define', 'elif', 'else', 'endif', 'error', 'if', 'ifdef', 'ifndef', 'import',
- 'include', 'line', 'pragma', 'undef', 'using', 'warning'
+ 'line', 'pragma', 'undef', 'using', 'warning'
}
-local preproc = token(l.PREPROCESSOR,
- l.starts_line('#') * S('\t ')^0 * preproc_word)
+local preproc = #l.starts_line('#') *
+ (token(l.PREPROCESSOR, '#' * S('\t ')^0 * preproc_word) +
+ token(l.PREPROCESSOR, '#' * S('\t ')^0 * 'include') *
+ (token(l.WHITESPACE, S('\t ')^1) *
+ token(l.STRING, l.delimited_range('<>', true, true)))^-1)
-- Keywords.
local keyword = token(l.KEYWORD, word_match{