aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/lexer.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lexers/lexer.lua')
-rw-r--r--lua/lexers/lexer.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lua/lexers/lexer.lua b/lua/lexers/lexer.lua
index e7d749f..d4af90c 100644
--- a/lua/lexers/lexer.lua
+++ b/lua/lexers/lexer.lua
@@ -1028,10 +1028,14 @@ end
-- @param name The name of the lexing language.
-- @param alt_name The alternate name of the lexing language. This is useful for
-- embedding the same child lexer with multiple sets of start and end tokens.
+-- @param cache Flag indicating whether or not to load lexers from the cache.
+-- This should only be `true` when initially loading a lexer (e.g. not from
+-- within another lexer for embedding purposes).
+-- The default value is `false`.
-- @return lexer object
-- @name load
-function M.load(name, alt_name)
- if M.lexers[alt_name or name] then return M.lexers[alt_name or name] end
+function M.load(name, alt_name, cache)
+ if cache and M.lexers[alt_name or name] then return M.lexers[alt_name or name] end
parent_lexer = nil -- reset
-- When using Scintillua as a stand-alone module, the `property` and