diff options
| author | mitchell <unknown> | 2020-03-29 20:12:40 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2020-03-29 20:12:40 -0400 |
| commit | d8dfede4dc16846dd15ceeafa79a51c446d7f84e (patch) | |
| tree | e8beb7aedeb7700426714bc53ad821571f95e774 /lexlua | |
| parent | 852fb493c9557b0f20ce74b5079506152f1955e4 (diff) | |
| download | scintilla-mirror-d8dfede4dc16846dd15ceeafa79a51c446d7f84e.tar.gz | |
lexlua: Fixed incorrect grammar building for lexers that embed themselves.
When there is no initial '*_whitespace' style, child lexers should prefer their
parent's grammar rather than their own.
Diffstat (limited to 'lexlua')
| -rw-r--r-- | lexlua/lexer.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lexlua/lexer.lua b/lexlua/lexer.lua index 8b8afe548..68183aa29 100644 --- a/lexlua/lexer.lua +++ b/lexlua/lexer.lua @@ -1245,7 +1245,8 @@ function M.lex(lexer, text, init_style) if lexer._CHILDREN then for style, style_num in pairs(lexer._TOKENSTYLES) do if style_num == init_style then - local lexer_name = style:match('^(.+)_whitespace') or lexer._NAME + local lexer_name = style:match('^(.+)_whitespace') or + lexer._PARENTNAME or lexer._NAME if lexer._INITIALRULE ~= lexer_name then lexer:build_grammar(lexer_name) end |
