+16
-1
lines changedFilter options
+16
-1
lines changed Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ function M.require_language(lang, path, silent)
14
14
return true
15
15
end
16
16
if path == nil then
17
-
local fname = 'parser/' .. lang .. '.*'
17
+
local fname = 'parser/' .. vim.fn.fnameescape(lang) .. '.*'
18
18
local paths = a.nvim_get_runtime_file(fname, false)
19
19
if #paths == 0 then
20
20
if silent then
Original file line number Diff line number Diff line change
@@ -666,6 +666,21 @@ int x = INT_MAX;
666
666
-- READ_STRING_OK(x, y) (char_u *)read_string((x), (size_t)(y))
667
667
}, get_ranges())
668
668
end)
669
+
670
+
it("should not inject bad languages", function()
671
+
if helpers.pending_win32(pending) then return end
672
+
exec_lua([=[
673
+
vim.treesitter.add_directive("inject-bad!", function(match, _, _, pred, metadata)
674
+
metadata.language = "{"
675
+
metadata.combined = true
676
+
metadata.content = pred[2]
677
+
end)
678
+
679
+
parser = vim.treesitter.get_parser(0, "c", {
680
+
injections = {
681
+
c = "(preproc_function_def value: ((preproc_arg) @_a (#inject-bad! @_a)))"}})
682
+
]=])
683
+
end)
669
684
end)
670
685
671
686
describe("when using the offset directive", function()
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4