From 19e68d6974c3067814b818b4dfd7d15461a9ef29 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 13 Oct 2013 06:34:04 -0700 Subject: Rewrites the parser stack reduction logic. Centralizes the scattered logic surrounding erroneous pattern syntax. Consolidates the redundant lookahead implementations. Eliminates var manipulation in favor of recursion. --- test/files/neg/t421.check | 2 +- test/files/neg/t5702-neg-bad-and-wild.check | 2 +- test/files/neg/t5702-neg-bad-brace.check | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'test/files') diff --git a/test/files/neg/t421.check b/test/files/neg/t421.check index dc5fa425ac..d16e541868 100644 --- a/test/files/neg/t421.check +++ b/test/files/neg/t421.check @@ -1,4 +1,4 @@ t421.scala:5: error: star patterns must correspond with varargs parameters case Bar("foo",_*) => sys.error("huh?"); - ^ + ^ one error found diff --git a/test/files/neg/t5702-neg-bad-and-wild.check b/test/files/neg/t5702-neg-bad-and-wild.check index eae81ad5f2..3970c755bd 100644 --- a/test/files/neg/t5702-neg-bad-and-wild.check +++ b/test/files/neg/t5702-neg-bad-and-wild.check @@ -13,7 +13,7 @@ t5702-neg-bad-and-wild.scala:14: error: use _* to match a sequence t5702-neg-bad-and-wild.scala:15: error: trailing * is not a valid pattern case List(x*, 1) => // trailing * is not a valid pattern ^ -t5702-neg-bad-and-wild.scala:16: error: trailing * is not a valid pattern +t5702-neg-bad-and-wild.scala:16: error: illegal start of simple pattern case (1, x*) => // trailing * is not a valid pattern ^ t5702-neg-bad-and-wild.scala:17: error: bad use of _* (sequence pattern not allowed) diff --git a/test/files/neg/t5702-neg-bad-brace.check b/test/files/neg/t5702-neg-bad-brace.check index 503f7d95ed..a4a00814d3 100644 --- a/test/files/neg/t5702-neg-bad-brace.check +++ b/test/files/neg/t5702-neg-bad-brace.check @@ -1,10 +1,7 @@ t5702-neg-bad-brace.scala:14: error: Unmatched closing brace '}' ignored here case List(1, _*} => ^ -t5702-neg-bad-brace.scala:14: error: illegal start of simple pattern - case List(1, _*} => - ^ -t5702-neg-bad-brace.scala:15: error: ')' expected but '}' found. - } - ^ -three errors found +t5702-neg-bad-brace.scala:17: error: eof expected but '}' found. +} +^ +two errors found -- cgit v1.2.3