File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1122
1122
1123
1123
} ;
1124
1124
1125
- function Runtime ( interpreter ) {
1125
+ function Runtime ( interpreter , options ) {
1126
1126
this . _interpreter = interpreter ;
1127
1127
this . functionTable = {
1128
1128
// name: [function, <signature>]
1203
1203
_signature : [ { types : [ TYPE_ANY ] , variadic : true } ]
1204
1204
}
1205
1205
} ;
1206
+ if ( options . functionTable ) {
1207
+ for ( var property in options . functionTable ) {
1208
+ if ( options . functionTable . hasOwnProperty ( property ) ) {
1209
+ this . functionTable [ property ] = options . functionTable [ property ] ;
1210
+ }
1211
+ }
1212
+ }
1206
1213
}
1207
1214
1208
1215
Runtime . prototype = {
1653
1660
return lexer . tokenize ( stream ) ;
1654
1661
}
1655
1662
1656
- function search ( data , expression ) {
1663
+ function search ( data , expression , options ) {
1657
1664
var parser = new Parser ( ) ;
1658
1665
// This needs to be improved. Both the interpreter and runtime depend on
1659
1666
// each other. The runtime needs the interpreter to support exprefs.
1660
1667
// There's likely a clean way to avoid the cyclic dependency.
1661
- var runtime = new Runtime ( ) ;
1668
+ var runtime = new Runtime ( undefined , options ) ;
1662
1669
var interpreter = new TreeInterpreter ( runtime ) ;
1663
1670
runtime . _interpreter = interpreter ;
1664
1671
var node = parser . parse ( expression ) ;
You can’t perform that action at this time.
0 commit comments