Skip to content

Commit c767992

Browse files
authored
Merge pull request #76 from vim-jp/synopsis
update README.mkd
2 parents 8c63d1a + 1a5ca6f commit c767992

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

README.mkd

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
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 parser to make AST (Abstract Syntax Tree)
10+
11+
## Supported languages
12+
13+
This parser provide same feature for following languages.
14+
15+
* Vim script
16+
* Python
17+
* Javascript
18+
19+
## Example
20+
21+
All of interfaces are provided from vimlparser module. VimLParser parse into AST using StringReader, and Compiler to compile nodes.
22+
23+
```vim
24+
let s:vimlparser = vimlparser#import()
25+
let code = [
26+
\ 'let s:message = printf("hello %d", 1+(2*3))'
27+
\]
28+
let r = s:StringReader.new(code)
29+
let p = s:VimLParser.new()
30+
let c = s:Compiler.new()
31+
echo join(c.compile(p.parse(r)), "\n")
32+
```
33+
34+
This above code output following.
35+
36+
```
37+
(let = s:message (printf "hello %d" (+ 1 (* 2 3))))
38+
```

0 commit comments

Comments
 (0)