(options = {})
| 157 | } |
| 158 | |
| 159 | createTarget(options = {}) { |
| 160 | const fns = this.getFunctions(); |
| 161 | |
| 162 | return { |
| 163 | language: 'rpn', |
| 164 | operators: () => undefined, |
| 165 | functions: (id) => fns[id], |
| 166 | var: (id) => id, |
| 167 | string: (str) => str, |
| 168 | number: (n) => n.toString(), |
| 169 | indent: 0, |
| 170 | ws: () => '', |
| 171 | preamble: '', |
| 172 | ...options, |
| 173 | }; |
| 174 | } |
| 175 | |
| 176 | compileToExecutable(expr, options = {}) { |
| 177 | const target = this.createTarget(); |
no test coverage detected