From 9d925a30c73ee5856c83d3caab124f7dbeaa85a8 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Sun, 22 Apr 2012 02:58:26 -0700 Subject: SI-5702 Pattern parser halts on star In patterns, the parser halts when it sees stars. This means it does not handle infix notation for a case class named "*". This patch uses lookahead to decide whether to parse '_' '*' as a sequence pattern or as the start of infix. (For both normal and error cases, the tokens are always consumed immediately.) Error messages are improved for _* (as a help to learners) and slightly improved recovery helps the parse continue. The entry point for XML patterns is now distinct; otherwise, the change is local to pattern3-simplepattern; the entry point for simplepattern() is unchanged because it is commented "hook for IDE." --- test/pending/neg/t3189.check | 7 ------- test/pending/neg/t3189.scala | 3 --- 2 files changed, 10 deletions(-) delete mode 100644 test/pending/neg/t3189.check delete mode 100644 test/pending/neg/t3189.scala (limited to 'test/pending') diff --git a/test/pending/neg/t3189.check b/test/pending/neg/t3189.check deleted file mode 100644 index 43dd0f29a0..0000000000 --- a/test/pending/neg/t3189.check +++ /dev/null @@ -1,7 +0,0 @@ -t3189.scala:2: error: illegal start of simple pattern - val Array(a,b*) = ("": Any) - ^ -t3189.scala:3: error: ')' expected but '}' found. -} -^ -two errors found diff --git a/test/pending/neg/t3189.scala b/test/pending/neg/t3189.scala deleted file mode 100644 index 4ea4bb7581..0000000000 --- a/test/pending/neg/t3189.scala +++ /dev/null @@ -1,3 +0,0 @@ -object A { - val Array(a,b*) = ("": Any) -} \ No newline at end of file -- cgit v1.2.3