├── .gitignore ├── .jshintignore ├── .jshintrc ├── .npmignore ├── .travis.yml ├── AUTHORS ├── History.md ├── Makefile ├── README.md ├── bin └── velocity ├── docs ├── differ-from-java-edition.md └── grammar.md ├── examples ├── data-dump-method │ ├── context.js │ ├── how-to.md │ ├── index.vm │ └── velocity-config.js ├── data-dump │ ├── context.js │ ├── how-to.md │ ├── index.vm │ └── velocity-config.js ├── data-structure-method │ ├── context.js │ ├── index.vm │ └── velocity-config.js ├── data-structure │ ├── context.js │ ├── index.vm │ └── velocity-config.js ├── dependency │ ├── root1 │ │ ├── a.vm │ │ ├── b.vm │ │ ├── c.vm │ │ ├── d.vm │ │ ├── e.txt │ │ └── index.vm │ ├── root2 │ │ └── f.vm │ └── velocity-config.js ├── directive │ ├── context.js │ ├── index.vm │ └── velocity-config.js ├── errors │ ├── child.vm │ ├── context.js │ ├── index.vm │ └── velocity-config.js ├── expression │ ├── context.js │ ├── index.vm │ └── velocity-config.js ├── hello │ ├── context.js │ ├── index.vm │ └── velocity-config.js ├── macro │ ├── context.js │ ├── index.vm │ ├── macro.vm │ └── velocity-config.js ├── method-lookup │ ├── context.js │ ├── index.vm │ └── velocity-config.js ├── parse │ ├── context.js │ ├── root1 │ │ ├── index.vm │ │ └── plain-text.txt │ ├── root2 │ │ └── root2.vm │ ├── root3 │ │ └── root3.vm │ └── velocity-config.js └── reference │ ├── context.js │ ├── index.vm │ └── velocity-config.js ├── index.js ├── lib ├── common.js ├── data │ ├── data-direc.js │ ├── data-expr.js │ ├── data-formatter.js │ ├── data-ref.js │ ├── data-stats.js │ └── index.js ├── dep │ ├── index.js │ ├── render.js │ └── scan.js ├── engine │ ├── engine-direc.js │ ├── engine-expr.js │ ├── engine-ref.js │ ├── engine-stack.js │ ├── engine-stats.js │ ├── index.js │ ├── lex.js │ ├── lex.yy │ ├── velocity.js │ ├── velocity.l │ └── velocity.yy ├── handle-cfg.js ├── index.js └── logger.js ├── package.json └── test ├── engine.test.js ├── fixtures ├── if-else-end.vm ├── if-elseif-elseif-end.vm ├── if-elseif-end.vm ├── if-end.vm └── macro-result.txt ├── parser.test.js └── utils.js /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/.gitignore -------------------------------------------------------------------------------- /.jshintignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | coverage/ 3 | .git/ 4 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/.jshintrc -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/.npmignore -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/.travis.yml -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/AUTHORS -------------------------------------------------------------------------------- /History.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/History.md -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/Makefile -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/README.md -------------------------------------------------------------------------------- /bin/velocity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/bin/velocity -------------------------------------------------------------------------------- /docs/differ-from-java-edition.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/docs/differ-from-java-edition.md -------------------------------------------------------------------------------- /docs/grammar.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/docs/grammar.md -------------------------------------------------------------------------------- /examples/data-dump-method/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-dump-method/context.js -------------------------------------------------------------------------------- /examples/data-dump-method/how-to.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-dump-method/how-to.md -------------------------------------------------------------------------------- /examples/data-dump-method/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-dump-method/index.vm -------------------------------------------------------------------------------- /examples/data-dump-method/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-dump-method/velocity-config.js -------------------------------------------------------------------------------- /examples/data-dump/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-dump/context.js -------------------------------------------------------------------------------- /examples/data-dump/how-to.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-dump/how-to.md -------------------------------------------------------------------------------- /examples/data-dump/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-dump/index.vm -------------------------------------------------------------------------------- /examples/data-dump/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-dump/velocity-config.js -------------------------------------------------------------------------------- /examples/data-structure-method/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-structure-method/context.js -------------------------------------------------------------------------------- /examples/data-structure-method/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-structure-method/index.vm -------------------------------------------------------------------------------- /examples/data-structure-method/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-structure-method/velocity-config.js -------------------------------------------------------------------------------- /examples/data-structure/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-structure/context.js -------------------------------------------------------------------------------- /examples/data-structure/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-structure/index.vm -------------------------------------------------------------------------------- /examples/data-structure/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/data-structure/velocity-config.js -------------------------------------------------------------------------------- /examples/dependency/root1/a.vm: -------------------------------------------------------------------------------- 1 | File /a.vm 2 | #parse('/c.vm') 3 | 4 | -------------------------------------------------------------------------------- /examples/dependency/root1/b.vm: -------------------------------------------------------------------------------- 1 | File /b.vm 2 | #parse('/d.vm') 3 | -------------------------------------------------------------------------------- /examples/dependency/root1/c.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/dependency/root1/c.vm -------------------------------------------------------------------------------- /examples/dependency/root1/d.vm: -------------------------------------------------------------------------------- 1 | File /d.vm -------------------------------------------------------------------------------- /examples/dependency/root1/e.txt: -------------------------------------------------------------------------------- 1 | File /e.txt -------------------------------------------------------------------------------- /examples/dependency/root1/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/dependency/root1/index.vm -------------------------------------------------------------------------------- /examples/dependency/root2/f.vm: -------------------------------------------------------------------------------- 1 | File /f.vm -------------------------------------------------------------------------------- /examples/dependency/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/dependency/velocity-config.js -------------------------------------------------------------------------------- /examples/directive/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/directive/context.js -------------------------------------------------------------------------------- /examples/directive/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/directive/index.vm -------------------------------------------------------------------------------- /examples/directive/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/directive/velocity-config.js -------------------------------------------------------------------------------- /examples/errors/child.vm: -------------------------------------------------------------------------------- 1 | ## Parse error 2 | #set(4 = $a) 3 | -------------------------------------------------------------------------------- /examples/errors/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/errors/context.js -------------------------------------------------------------------------------- /examples/errors/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/errors/index.vm -------------------------------------------------------------------------------- /examples/errors/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/errors/velocity-config.js -------------------------------------------------------------------------------- /examples/expression/context.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'fool2fish', 3 | start: 1 4 | } 5 | -------------------------------------------------------------------------------- /examples/expression/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/expression/index.vm -------------------------------------------------------------------------------- /examples/expression/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/expression/velocity-config.js -------------------------------------------------------------------------------- /examples/hello/context.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'velocity' 3 | } 4 | -------------------------------------------------------------------------------- /examples/hello/index.vm: -------------------------------------------------------------------------------- 1 | Hello, ${name}! 2 | -------------------------------------------------------------------------------- /examples/hello/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/hello/velocity-config.js -------------------------------------------------------------------------------- /examples/macro/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/macro/context.js -------------------------------------------------------------------------------- /examples/macro/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/macro/index.vm -------------------------------------------------------------------------------- /examples/macro/macro.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/macro/macro.vm -------------------------------------------------------------------------------- /examples/macro/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/macro/velocity-config.js -------------------------------------------------------------------------------- /examples/method-lookup/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/method-lookup/context.js -------------------------------------------------------------------------------- /examples/method-lookup/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/method-lookup/index.vm -------------------------------------------------------------------------------- /examples/method-lookup/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/method-lookup/velocity-config.js -------------------------------------------------------------------------------- /examples/parse/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/parse/context.js -------------------------------------------------------------------------------- /examples/parse/root1/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/parse/root1/index.vm -------------------------------------------------------------------------------- /examples/parse/root1/plain-text.txt: -------------------------------------------------------------------------------- 1 | Plain text content. 2 | -------------------------------------------------------------------------------- /examples/parse/root2/root2.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/parse/root2/root2.vm -------------------------------------------------------------------------------- /examples/parse/root3/root3.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/parse/root3/root3.vm -------------------------------------------------------------------------------- /examples/parse/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/parse/velocity-config.js -------------------------------------------------------------------------------- /examples/reference/context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/reference/context.js -------------------------------------------------------------------------------- /examples/reference/index.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/reference/index.vm -------------------------------------------------------------------------------- /examples/reference/velocity-config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/examples/reference/velocity-config.js -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib') 2 | -------------------------------------------------------------------------------- /lib/common.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/common.js -------------------------------------------------------------------------------- /lib/data/data-direc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/data/data-direc.js -------------------------------------------------------------------------------- /lib/data/data-expr.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/data/data-expr.js -------------------------------------------------------------------------------- /lib/data/data-formatter.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/data/data-formatter.js -------------------------------------------------------------------------------- /lib/data/data-ref.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/data/data-ref.js -------------------------------------------------------------------------------- /lib/data/data-stats.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/data/data-stats.js -------------------------------------------------------------------------------- /lib/data/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/data/index.js -------------------------------------------------------------------------------- /lib/dep/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/dep/index.js -------------------------------------------------------------------------------- /lib/dep/render.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/dep/render.js -------------------------------------------------------------------------------- /lib/dep/scan.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/dep/scan.js -------------------------------------------------------------------------------- /lib/engine/engine-direc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/engine-direc.js -------------------------------------------------------------------------------- /lib/engine/engine-expr.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/engine-expr.js -------------------------------------------------------------------------------- /lib/engine/engine-ref.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/engine-ref.js -------------------------------------------------------------------------------- /lib/engine/engine-stack.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/engine-stack.js -------------------------------------------------------------------------------- /lib/engine/engine-stats.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/engine-stats.js -------------------------------------------------------------------------------- /lib/engine/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/index.js -------------------------------------------------------------------------------- /lib/engine/lex.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/lex.js -------------------------------------------------------------------------------- /lib/engine/lex.yy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/lex.yy -------------------------------------------------------------------------------- /lib/engine/velocity.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/velocity.js -------------------------------------------------------------------------------- /lib/engine/velocity.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/velocity.l -------------------------------------------------------------------------------- /lib/engine/velocity.yy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/engine/velocity.yy -------------------------------------------------------------------------------- /lib/handle-cfg.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/handle-cfg.js -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/index.js -------------------------------------------------------------------------------- /lib/logger.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/lib/logger.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/package.json -------------------------------------------------------------------------------- /test/engine.test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/test/engine.test.js -------------------------------------------------------------------------------- /test/fixtures/if-else-end.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/test/fixtures/if-else-end.vm -------------------------------------------------------------------------------- /test/fixtures/if-elseif-elseif-end.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/test/fixtures/if-elseif-elseif-end.vm -------------------------------------------------------------------------------- /test/fixtures/if-elseif-end.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/test/fixtures/if-elseif-end.vm -------------------------------------------------------------------------------- /test/fixtures/if-end.vm: -------------------------------------------------------------------------------- 1 | #if($user.getAge(18)) 2 | welcome board 3 | #end 4 | -------------------------------------------------------------------------------- /test/fixtures/macro-result.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/test/fixtures/macro-result.txt -------------------------------------------------------------------------------- /test/parser.test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/test/parser.test.js -------------------------------------------------------------------------------- /test/utils.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fool2fish/velocity/HEAD/test/utils.js --------------------------------------------------------------------------------