| 209 | } |
| 210 | |
| 211 | function statement(type) { |
| 212 | if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); |
| 213 | if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); |
| 214 | if (type == "keyword b") return cont(pushlex("form"), statement, poplex); |
| 215 | if (type == "{") return cont(pushlex("}"), block, poplex); |
| 216 | if (type == ";") return cont(); |
| 217 | if (type == "function") return cont(functiondef); |
| 218 | if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), |
| 219 | poplex, statement, poplex); |
| 220 | if (type == "variable") return cont(pushlex("stat"), maybelabel); |
| 221 | if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), |
| 222 | block, poplex, poplex); |
| 223 | if (type == "case") return cont(expression, expect(":")); |
| 224 | if (type == "default") return cont(expect(":")); |
| 225 | if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), |
| 226 | statement, poplex, popcontext); |
| 227 | return pass(pushlex("stat"), expression, expect(";"), poplex); |
| 228 | } |
| 229 | function expression(type) { |
| 230 | if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); |
| 231 | if (type == "function") return cont(functiondef); |