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 11221122
11231123 } ;
11241124
1125- function Runtime ( interpreter ) {
1125+ function Runtime ( interpreter , options ) {
11261126 this . _interpreter = interpreter ;
11271127 this . functionTable = {
11281128 // name: [function, <signature>]
12031203 _signature : [ { types : [ TYPE_ANY ] , variadic : true } ]
12041204 }
12051205 } ;
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+ }
12061213 }
12071214
12081215 Runtime . prototype = {
16531660 return lexer . tokenize ( stream ) ;
16541661 }
16551662
1656- function search ( data , expression ) {
1663+ function search ( data , expression , options ) {
16571664 var parser = new Parser ( ) ;
16581665 // This needs to be improved. Both the interpreter and runtime depend on
16591666 // each other. The runtime needs the interpreter to support exprefs.
16601667 // There's likely a clean way to avoid the cyclic dependency.
1661- var runtime = new Runtime ( ) ;
1668+ var runtime = new Runtime ( undefined , options ) ;
16621669 var interpreter = new TreeInterpreter ( runtime ) ;
16631670 runtime . _interpreter = interpreter ;
16641671 var node = parser . parse ( expression ) ;
You can’t perform that action at this time.
0 commit comments