Skip to content

vim-jp/vim-vimlparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9766ea9 · Jun 22, 2023
Jan 15, 2022
Jun 22, 2023
Jun 22, 2023
Jun 22, 2023
Jan 16, 2022
Aug 7, 2022
Jul 18, 2019
Aug 12, 2019
Jul 31, 2019
Feb 2, 2023
May 8, 2018
Jan 15, 2022
Jan 13, 2022

Repository files navigation

Vim script parsers

Build Status codecov

This is Vim script language (a.k.a. VimL) parsers.

Features

The parser to make AST (Abstract Syntax Tree)

Supported languages

This parser provide same feature for following languages.

  • Vim script
  • Python
  • JavaScript

Example

All of interfaces are provided from vimlparser module. VimLParser parse into AST using StringReader, and Compiler to compile nodes.

let s:VP = vimlparser#import()
let code = [
\ 'let s:message = printf("hello %d", 1+(2*3))'
\]
let r = s:VP.StringReader.new(code)
let p = s:VP.VimLParser.new()
let c = s:VP.Compiler.new()
echo join(c.compile(p.parse(r)), "\n")

This above code output following.

(let = s:message (printf "hello %d" (+ 1 (* 2 3))))

About project name

We know a name "VimL" is not the common short form of "Vim scripting language". But we choice "VimL" for historical and practical reasons and compatibility.