From: mitchell <70453897+orbitalquark@users.noreply.github.com>
---
lua/lexers/lexer.lua | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lua/lexers/lexer.lua b/lua/lexers/lexer.lua
index f860d668..12a1404f 100644
--- a/lua/lexers/lexer.lua
+++ b/lua/lexers/lexer.lua
@@ -1269,8 +1269,7 @@ function M.fold(lexer, text, start_line, start_level)
local folds = {}
if text == '' then return folds end
local fold = M.property_int['fold'] > 0
- local FOLD_BASE = M.FOLD_BASE or 0x400
- local FOLD_HEADER, FOLD_BLANK = M.FOLD_HEADER or 0x2000, M.FOLD_BLANK or 0x1000
+ local FOLD_BASE, FOLD_HEADER, FOLD_BLANK = M.FOLD_BASE, M.FOLD_HEADER, M.FOLD_BLANK
if M._standalone then M._text, M.line_state = text, {} end
if fold and lexer._fold_points then
local lines = {}
@@ -1443,8 +1442,8 @@ function M.new(name, opts)
return lexer
end
---- Creates a substitute for some Scintilla tables and functions that Scintillua depends on
--- when using it as a standalone module.
+--- Creates a substitute for some Scintilla tables, functions, and fields that Scintillua
+-- depends on when using it as a standalone module.
local function initialize_standalone_library()
M.property = setmetatable({['scintillua.lexers'] = package.path:gsub('/%?%.lua', '/lexers')}, {
__index = function() return '' end, __newindex = function(t, k, v) rawset(t, k, tostring(v)) end
@@ -1471,6 +1470,8 @@ local function initialize_standalone_library()
end
})
+ M.FOLD_BASE, M.FOLD_HEADER, M.FOLD_BLANK = 0x400, 0x2000, 0x1000
+
M._standalone = true
end
--
2.45.2
Relates-to: https://github.com/orbitalquark/scintillua/issues/68
Relates-to: https://github.com/orbitalquark/scintillua/commit/dee7d765a005
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
---
lua/lexers/vbscript.lua | 63 -----------------------------------------
1 file changed, 63 deletions(-)
delete mode 100644 lua/lexers/vbscript.lua
diff --git a/lua/lexers/vbscript.lua b/lua/lexers/vbscript.lua
deleted file mode 100644
index 69e3dca4..00000000
--- a/lua/lexers/vbscript.lua
@@ -1,63 +0,0 @@
--- Copyright 2006-2017 Mitchell mitchell.att.foicica.com. See LICENSE.
--- VisualBasic LPeg lexer.
-
-local l = require('lexer')
-local token, word_match = l.token, l.word_match
-local P, R, S = lpeg.P, lpeg.R, lpeg.S
-
-local M = {_NAME = 'vbscript'}
-
--- Whitespace.
-local ws = token(l.WHITESPACE, l.space^1)
-
--- Comments.
-local comment = token(l.COMMENT, (P("'") + word_match({'rem'}, nil, true)) * l.nonnewline^0)
-
--- Strings.
-local string = token(l.STRING, l.range('"', true, true))
-
--- Numbers.
-local number = token(l.NUMBER, (l.float + l.integer) * S('LlUuFf')^-2)
-
--- Keywords.
-local keyword = token(l.KEYWORD, word_match({
- -- Control.
- 'If', 'Then', 'Else', 'ElseIf', 'While', 'Wend', 'For', 'To', 'Each',
- 'In', 'Step', 'Case', 'Select', 'Return', 'Continue', 'Do',
- 'Until', 'Loop', 'Next', 'With', 'Exit',
- -- Operators.
- 'Mod', 'And', 'Not', 'Or', 'Xor', 'Is',
- -- Storage types.
- 'Call', 'Class', 'Const', 'Dim', 'ReDim', 'Preserve', 'Function', 'Sub',
- 'Property', 'End', 'Set', 'Let', 'Get', 'New', 'Randomize', 'Option',
- 'Explicit', 'On', 'Error', 'Execute',
- -- Storage modifiers.
- 'Private', 'Public', 'Default',
- -- Constants.
- 'Empty', 'False', 'Nothing', 'Null', 'True'
-}, nil, true))
-
--- Types.
-local type = token(l.TYPE, word_match({
- 'Boolean', 'Byte', 'Char', 'Date', 'Decimal', 'Double', 'Long', 'Object',
- 'Short', 'Single', 'String'
-}, nil, true))
-
--- Identifiers.
-local identifier = token(l.IDENTIFIER, l.word)
-
--- Operators.
-local operator = token(l.OPERATOR, S('=><+-*^&:.,_()'))
-
-M._rules = {
- {'whitespace', ws},
- {'keyword', keyword},
- {'type', type},
- {'comment', comment},
- {'identifier', identifier},
- {'string', string},
- {'number', number},
- {'operator', operator},
-}
-
-return M
--
2.45.2