diff options
Diffstat (limited to 'lua/lexers/prolog.lua')
| -rw-r--r-- | lua/lexers/prolog.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lua/lexers/prolog.lua b/lua/lexers/prolog.lua index 53e25c8..b595fcc 100644 --- a/lua/lexers/prolog.lua +++ b/lua/lexers/prolog.lua @@ -1,4 +1,4 @@ --- Copyright 2006-2022 Mitchell. See LICENSE. +-- Copyright 2006-2024 Mitchell. See LICENSE. -- Lexer enhanced to conform to the realities of Prologs on the ground by -- Michael T. Richter. Copyright is explicitly assigned back to Mitchell. -- Prolog LPeg lexer. @@ -30,9 +30,8 @@ local P, S = lpeg.P, lpeg.S local lex = lexer.new('prolog') -local dialects = setmetatable({gprolog = 'gprolog', swipl = 'swipl'}, - {__index = function(_, _) return 'iso' end}) -local dialect = dialects[lexer.property['prolog.dialect']] +local dialect = lexer.property['prolog.dialect'] +if dialect ~= 'gprolog' and dialog ~= 'swipl' then dialect = 'iso' end -- Directives. local directives = {} @@ -350,4 +349,6 @@ local sq_str = lexer.range("'", true) local dq_str = lexer.range('"', true) lex:add_rule('string', token(lexer.STRING, sq_str + dq_str)) +lexer.property['scintillua.comment'] = '%' + return lex |
