diff options
author | John Hodge <tpg@mutabah.net> | 2016-03-05 21:49:35 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-03-05 21:49:35 +0800 |
commit | f430222343e18fec9f97c9b9fdfdc17667b94505 (patch) | |
tree | 4b5e82d2e4bf3b03b4e368e582c761cf8deb3834 | |
parent | 2e34ca9516343185c9beee0ed83e7be247812c28 (diff) | |
download | mrust-f430222343e18fec9f97c9b9fdfdc17667b94505.tar.gz |
Parse - Starting on run-fail
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | src/parse/expr.cpp | 12 |
2 files changed, 16 insertions, 3 deletions
@@ -60,7 +60,12 @@ output/core.ast: $(RUSTCSRC)src/libcore/lib.rs $(BIN) .PHONY: rust_tests RUST_TESTS_DIR := $(RUSTCSRC)src/test/ -rust_tests: $(sort $(patsubst $(RUST_TESTS_DIR)%.rs,output/rust/%.txt,$(wildcard $(RUST_TESTS_DIR)run-pass/*.rs))) +rust_tests: rust_tests-run-pass rust_tests-run-fail rust_tests-compile-fail + +DEF_RUST_TESTS = $(sort $(patsubst $(RUST_TESTS_DIR)%.rs,output/rust/%.txt,$(wildcard $(RUST_TESTS_DIR)$1/*.rs))) +rust_tests-run-pass: $(call DEF_RUST_TESTS,run-pass) +rust_tests-run-fail: $(call DEF_RUST_TESTS,run-fail) +rust_tests-compile-fail: $(call DEF_RUST_TESTS,compile-fail) output/rust/%.txt: $(RUST_TESTS_DIR)%.rs $(BIN) @mkdir -p $(dir $@) diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp index 2f723ef9..a57cf487 100644 --- a/src/parse/expr.cpp +++ b/src/parse/expr.cpp @@ -939,8 +939,16 @@ ExprNodeP Parse_ExprVal_Closure(TokenStream& lex, bool is_move) CHECK_TOK(tok, TOK_PIPE);
TypeRef rt;
- if( GET_TOK(tok, lex) == TOK_THINARROW )
- rt = Parse_Type(lex);
+ if( GET_TOK(tok, lex) == TOK_THINARROW ) {
+
+ if( GET_TOK(tok, lex) == TOK_EXCLAM ) {
+ rt = TypeRef(TypeRef::TagInvalid());
+ }
+ else {
+ lex.putback(tok);
+ rt = Parse_Type(lex);
+ }
+ }
else
lex.putback(tok);
|