-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: more lenient parsing for non-vim9script code
- Loading branch information
Showing
6 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let mapleader = "\\<Space>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
crates/vim9-gen/testdata/output/vim9_gen__test__mapleader.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: crates/vim9-gen/src/lib.rs | ||
expression: "generate(contents, ParserOpts { mode: ParserMode::Standalone }).unwrap().lua" | ||
--- | ||
---------------------------------------- | ||
-- This file is generated via github.com/tjdevries/vim9jit | ||
-- For any bugs, please first consider reporting there. | ||
---------------------------------------- | ||
|
||
-- Ignore "value assigned to a local variable is unused" because | ||
-- we can't guarantee that local variables will be used by plugins | ||
-- luacheck: ignore 311 | ||
|
||
local vim9 = require('_vim9script') | ||
local M = {} | ||
pcall(vim.cmd, [[ let mapleader = "\<Space>" ]]) | ||
return M | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
crates/vim9-parser/testdata/output/vim9_parser__test__mapleader.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: crates/vim9-parser/src/lib.rs | ||
expression: snapshot_parsing(contents) | ||
--- | ||
[ | ||
SharedCommand( | ||
SharedCommand { | ||
contents: "let mapleader = \\\\<Space>", | ||
eol: Token(EndOfLine, (0,27)->(0,27)), | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
vim.cmd([[ | ||
if 1 | ||
finish | ||
endif | ||
]]) |