Skip to content

Commit 0d13f80

Browse files
committed
update README.mkd
1 parent 8c63d1a commit 0d13f80

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

README.mkd

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1-
# Vim Script Parsers
1+
# VimL Parsers
22

33
[![Build Status](https://travis-ci.org/vim-jp/vim-vimlparser.svg?branch=master)](https://travis-ci.org/vim-jp/vim-vimlparser) [![codecov](https://codecov.io/gh/vim-jp/vim-vimlparser/branch/master/graph/badge.svg)](https://codecov.io/gh/vim-jp/vim-vimlparser)
44

5+
This is Vim script (a.k.a. VimL) parsers.
56

6-
TODO: write something.
7+
## Features
8+
9+
* The string tokenizer allows scripts to break a string into tokens.
10+
* The parser to make AST (Abstract Syntax Tree)
11+
12+
## Supported languages
13+
14+
This parser provide same feature for following languages.
15+
16+
* Vim script
17+
* Python
18+
* Javascript
19+
20+
## Example
21+
22+
All of interfaces are provided from vimlparser module. make StringReader to break a string into tokens, and VimLParser to parse into AST, Compiler to compile nodes.
23+
24+
```vim
25+
let s:vimlparser = vimlparser#import()
26+
let code = [
27+
\ 'let s:message = printf("hello %d", 1+(2*3))'
28+
\]
29+
let r = s:StringReader.new(code)
30+
let p = s:VimLParser.new()
31+
let c = s:Compiler.new()
32+
echo join(c.compile(p.parse(r)), "\n")
33+
```
34+
35+
This above code output following.
36+
37+
```
38+
(let = s:message (printf "hello %d" (+ 1 (* 2 3))))
39+
```

0 commit comments

Comments
 (0)