projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
82bc0ca
)
[mcs] Add parser sequence for case type pattern matching
author
Marek Safar
<marek.safar@gmail.com>
Mon, 31 Jul 2017 14:13:59 +0000
(16:13 +0200)
committer
Marek Safar
<marek.safar@gmail.com>
Mon, 31 Jul 2017 15:01:12 +0000
(17:01 +0200)
mcs/mcs/cs-parser.jay
patch
|
blob
|
history
diff --git
a/mcs/mcs/cs-parser.jay
b/mcs/mcs/cs-parser.jay
index 64652ccfcdad7e6f15f700c97b393608e04acad9..514113a6bf7734da8fd148ae1ddfb3fcbf89ca1c 100644
(file)
--- a/
mcs/mcs/cs-parser.jay
+++ b/
mcs/mcs/cs-parser.jay
@@
-4547,7
+4547,7
@@
additive_expression
}
| additive_expression IS pattern_type_expr opt_identifier
{
}
| additive_expression IS pattern_type_expr opt_identifier
{
- var is_expr = new Is ((Expression) $1, (
Expression) $3
, GetLocation ($2));
+ var is_expr = new Is ((Expression) $1, (
(FullNamedExpression) $3)
, GetLocation ($2));
if ($4 != null) {
if (lang_version < LanguageVersion.V_7)
FeatureIsNotAvailable (GetLocation ($4), "pattern matching");
if ($4 != null) {
if (lang_version < LanguageVersion.V_7)
FeatureIsNotAvailable (GetLocation ($4), "pattern matching");
@@
-6194,6
+6194,18
@@
switch_label
lbag.AddLocation ($$, GetLocation ($3));
}
*/
lbag.AddLocation ($$, GetLocation ($3));
}
*/
+
+ | CASE pattern_type_expr IDENTIFIER COLON
+ {
+ if (lang_version < LanguageVersion.V_7)
+ FeatureIsNotAvailable (GetLocation ($1), "pattern matching");
+
+// $$ = new SwitchLabel ((FullNamedExpression) $2), GetLocation ($1)) {
+// PatternMatching = true
+// };
+
+ throw new NotImplementedException ("type pattern matching");
+ }
| DEFAULT_COLON
{
$$ = new SwitchLabel (null, GetLocation ($1));
| DEFAULT_COLON
{
$$ = new SwitchLabel (null, GetLocation ($1));