https://github.com/gaubee/acorn-qml
qml parser base on acorn
https://github.com/gaubee/acorn-qml
Last synced: 7 months ago
JSON representation
qml parser base on acorn
- Host: GitHub
- URL: https://github.com/gaubee/acorn-qml
- Owner: Gaubee
- Created: 2016-04-02T07:46:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-02T07:47:03.000Z (about 10 years ago)
- Last Synced: 2024-12-28T17:44:53.071Z (over 1 year ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# acorn-qml
Base on [eclipse/cdt/qt/org.eclipse.cdt.qt.core/acorn-qml/](https://github.com/eclipse/cdt/tree/master/qt/org.eclipse.cdt.qt.core/acorn-qml)
Add ES7 Mix compilation.
支持与ES7混合编译(PS:import关键字使用qml的语法解析)
## Install
```shell
# acorn module has been installed
npm install acorn-qml --save
```
# Usage
正常ES5的QML-Parser
```js
const acorn = require("acorn");
require("acorn-qml").install(acorn);
var code = `YOUR QML CODE.`
acorn.parse(code, {
plugins: {
qml: true
},
ecmaVersion: 5,
});
```
与ES7混编的QML-Parser
```js
const acorn = require("acorn");
require("acorn-qml").install(acorn);
var code = `YOUR QML CODE.`
const res = acorn.parse(code, {
plugins: {
qml: true
},
ecmaVersion: 7,
ignoreQmlEcmaVersion: true
});
```