(nodes: Node, kind: Kind)
| 1197 | } |
| 1198 | |
| 1199 | function compileGet(nodes: Node, kind: Kind): (s: any) => any { |
| 1200 | return (s) => { |
| 1201 | for (let i = 0; i < nodes.length; i++) { |
| 1202 | const op = nodes[i] |
| 1203 | const result = op.get(s) |
| 1204 | if (hasFailingGet(op.kind)) { |
| 1205 | if (Result.isFailure(result)) { |
| 1206 | return result |
| 1207 | } |
| 1208 | s = result.success |
| 1209 | } else { |
| 1210 | s = result |
| 1211 | } |
| 1212 | } |
| 1213 | return hasFailingGet(kind) ? Result.succeed(s) : s |
| 1214 | } |
| 1215 | } |
| 1216 | |
| 1217 | function compileSet(nodes: Node, kind: Kind): (a: any, s: any) => any { |
| 1218 | if (hasSourceFreeSet(kind)) { |
no test coverage detected