aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/prolog.lua
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-08-11 01:27:32 +0200
committerRandy Palamar <randy@rnpnr.xyz>2024-03-27 06:04:21 -0600
commit4c4392d29df777ff702dfe99b4f3c23142976e05 (patch)
tree5355324abe18952f7d19d6cfc5dbeb5d6cb72b84 /lua/lexers/prolog.lua
parent95bf9f59f8a9a37148bdc0787db378d62c7cd032 (diff)
downloadvis-4c4392d29df777ff702dfe99b4f3c23142976e05.tar.gz
vis-4c4392d29df777ff702dfe99b4f3c23142976e05.tar.xz
update lexers to orbitalquark/scintillua@b789dde
Rather than cherry pick patches from after 6.2 we will just grab everything as is.
Diffstat (limited to 'lua/lexers/prolog.lua')
-rw-r--r--lua/lexers/prolog.lua9
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