diff options
| -rw-r--r-- | lexlua/lexer.lua | 3 | ||||
| -rw-r--r-- | test/test_lexlua.lua | 2 | 
2 files changed, 4 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 diff --git a/test/test_lexlua.lua b/test/test_lexlua.lua index c692e0fb1..276f8273c 100644 --- a/test/test_lexlua.lua +++ b/test/test_lexlua.lua @@ -931,6 +931,8 @@ function test_php()    }    local initial_style = php._TOKENSTYLES['html_whitespace']    assert_lex(php, code, tokens, initial_style) +  initial_style = php._TOKENSTYLES['default'] -- also test non-ws init style +  assert_lex(php, code, tokens, initial_style)    -- Starting in PHP.    code = [[echo "hi";]]    initial_style = php._TOKENSTYLES['php_whitespace'] | 
