(parser)
| 258 | } |
| 259 | |
| 260 | static parse(parser) { |
| 261 | if (!parser.matchToken("make")) return; |
| 262 | parser.matchToken("a") || parser.matchToken("an"); |
| 263 | |
| 264 | var expr = parser.requireElement("expression"); |
| 265 | |
| 266 | var args = []; |
| 267 | if (expr.type !== "queryRef" && parser.matchToken("from")) { |
| 268 | do { |
| 269 | args.push(parser.requireElement("expression")); |
| 270 | } while (parser.matchOpToken(",")); |
| 271 | } |
| 272 | |
| 273 | if (parser.matchToken("called")) { |
| 274 | var target = parser.requireElement("symbol"); |
| 275 | } |
| 276 | |
| 277 | if (expr.type === "queryRef") { |
| 278 | return new MakeCommand("queryRef", expr, null, target); |
| 279 | } else { |
| 280 | return new MakeCommand("constructor", expr, args, target); |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | resolve(ctx, { expr, constructorArgs } = {}) { |
| 285 | if (this.variant === "queryRef") { |
nothing calls this directly
no test coverage detected