diff --git a/parse.cm b/parse.cm index 77fcbe60..da590c27 100644 --- a/parse.cm +++ b/parse.cm @@ -1196,6 +1196,36 @@ var parse = function(tokens, src, filename, tokenizer) { } if (k == "name") { + if (tok.value == "try" || tok.value == "catch" || tok.value == "finally") { + parse_error(start, "'" + tok.value + "' is not supported; use disrupt/disruption instead") + sync_to_statement() + return null + } + if (tok.value == "throw") { + parse_error(start, "'throw' is not supported; use disrupt instead") + sync_to_statement() + return null + } + if (tok.value == "class") { + parse_error(start, "'class' is not supported; use meme()/proto() instead") + sync_to_statement() + return null + } + if (tok.value == "new") { + parse_error(start, "'new' is not supported; use meme()/proto() instead") + sync_to_statement() + return null + } + if (tok.value == "switch" || tok.value == "case") { + parse_error(start, "'" + tok.value + "' is not supported; use if/else instead") + sync_to_statement() + return null + } + if (tok.value == "let" || tok.value == "const") { + parse_error(start, "'" + tok.value + "' is not supported; use var/def instead") + sync_to_statement() + return null + } p1_tok = peek_ahead(1) if (p1_tok.kind == ":") { node = ast_node("label", start) diff --git a/parse.mach b/parse.mach index 71adc627..02f25e6f 100644 Binary files a/parse.mach and b/parse.mach differ