| 251 | } |
| 252 | |
| 253 | function statement(type) { |
| 254 | if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); |
| 255 | if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); |
| 256 | if (type == "keyword b") return cont(pushlex("form"), statement, poplex); |
| 257 | if (type == "{") return cont(pushlex("}"), block, poplex); |
| 258 | if (type == ";") return cont(); |
| 259 | if (type == "function") return cont(functiondef); |
| 260 | if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), |
| 261 | poplex, statement, poplex); |
| 262 | if (type == "variable") return cont(pushlex("stat"), maybelabel); |
| 263 | if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), |
| 264 | block, poplex, poplex); |
| 265 | if (type == "case") return cont(expression, expect(":")); |
| 266 | if (type == "default") return cont(expect(":")); |
| 267 | if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), |
| 268 | statement, poplex, popcontext); |
| 269 | return pass(pushlex("stat"), expression, expect(";"), poplex); |
| 270 | } |
| 271 | function expression(type) { |
| 272 | if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); |
| 273 | if (type == "function") return cont(functiondef); |