tjdevries / vim9jit

a vim9script -> lua transpiler (written in Rust)
MIT License
510 stars 21 forks source link

Fails to parse `let mapleader` #41

Open jonhoo opened 5 months ago

jonhoo commented 5 months ago
$ cargo r --release -- --file (echo 'let mapleader = "\\<Space>"' | psub) --outdir converted
    Finished release [optimized] target(s) in 0.03s
     Running `/home/jon/.cargo-target/release/vim9jit --file /tmp/.psub.RwbSA8XMXW --outdir converted`
thread 'main' panicked at '
Failed to parse command.
Current Commands:Program {
    commands: [],
}.
Error: No prefix function: Parser {
    lexer: Lexer { position: 27, read_position: 28, ch: None },
    token_buffer: RefCell {
        value: [
            Token(Equal, "=", (0,14)->(0,15)),
            Token(DoubleQuoteString, "\\<Space>", (0,17)->(0,24)),
            Token(EndOfLine, "\n", (0,26)->(0,26)),
        ],
    },
}', crates/vim9-parser/src/lib.rs:2559:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tjdevries commented 3 months ago

I think this will work now after latest commit, it has some problems with parsing non-vim9script code, particularly at the toplevel. But I think this would be fine now.

Just wondering why you were trying it out btw as well :) just out of curiousity.

jonhoo commented 3 months ago

Heh, to try and automate my way out of what ended up being a very manual https://github.com/jonhoo/configs/commit/9f771e0d78b627ac77d0f640a6f0515608345ab8 + https://github.com/jonhoo/configs/commit/5ee3683a436b644a13b297859c3ea43700c4389c :sweat_smile: