File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " func-formula-parser" ,
3- "version" : " 0.1.5 " ,
3+ "version" : " 0.1.6 " ,
44 "description" : " a AST parser for formula & formula function" ,
55 "main" : " dist/index.js" ,
66 "types" : " src/index.d.ts" ,
1010 "cover-test" : " node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha" ,
1111 "build" : " npm run lint && tsc" ,
1212 "lint" : " tslint -c tslint.json -p tsconfig.json && eslint test/" ,
13- "benchmark" : " node test/benchmark/"
13+ "benchmark" : " node test/benchmark/" ,
14+ "declaration" : " tsc --declaration src/index.ts && git clean -f src/*.js && git clean -f src/*/*.d.ts"
1415 },
1516 "pre-commit" : [
1617 " commit"
Original file line number Diff line number Diff line change 1- export * from './' ;
1+ import { IFormulaOption } from './interfaces/common' ;
2+ import { INodeItem } from './interfaces/node' ;
3+ import { ITokenItem } from './interfaces/token' ;
4+ /**
5+ * 公式函数解析器
6+ * formula function parser
7+ */
8+ declare class FuncFormulaParser {
9+ private option ;
10+ private sourceFormula ;
11+ private tokenArr ;
12+ private nodeTree ;
13+ constructor ( customOpt ?: IFormulaOption ) ;
14+ /**
15+ * 创建令牌词法分析结果
16+ * @param {string } formula 公式字符串
17+ * @return {ITokenItem[] } 令牌流
18+ */
19+ public setFormula ( formula : string ) : ITokenItem [ ] ;
20+ /**
21+ * 编译当前令牌的语法节点
22+ * @return {INodeItem } 语法节点树
23+ */
24+ public parseNode ( ) : INodeItem ;
25+ /**
26+ * 获取令牌词法分析结果
27+ * @return {ITokenItem[] } 令牌流
28+ */
29+ public getTokens ( ) : ITokenItem [ ] ;
30+ /**
31+ * 获取已经编译后的语法节点
32+ * @return {INodeItem } 语法节点树
33+ */
34+ public getNodeTree ( ) : INodeItem ;
35+ }
36+ export default FuncFormulaParser ;
You can’t perform that action at this time.
0 commit comments