Last active
August 29, 2015 14:09
-
-
Save nlhepler/7627f46d8df73ffec062 to your computer and use it in GitHub Desktop.
patches to fix mono-3.10.0 parsing/relocation issues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mcs/mcs/cs-tokenizer.cs b/mcs/mcs/cs-tokenizer.cs | |
index 8637fda..9647a4b 100644 | |
--- a/mcs/mcs/cs-tokenizer.cs | |
+++ b/mcs/mcs/cs-tokenizer.cs | |
@@ -1268,6 +1268,7 @@ namespace Mono.CSharp | |
int next_token; | |
int parens = 0; | |
int generics = 0; | |
+ int brackets = 0; | |
var nt = xtoken (); | |
switch (nt) { | |
@@ -1319,7 +1320,6 @@ namespace Mono.CSharp | |
case Token.COMMA: | |
case Token.SEMICOLON: | |
case Token.OPEN_BRACE: | |
- case Token.CLOSE_PARENS: | |
case Token.IN: | |
next_token = Token.INTERR_NULLABLE; | |
break; | |
@@ -1334,6 +1334,15 @@ namespace Mono.CSharp | |
++parens; | |
goto default; | |
+ case Token.OPEN_BRACKET: | |
+ case Token.OPEN_BRACKET_EXPR: | |
+ ++brackets; | |
+ goto default; | |
+ | |
+ case Token.CLOSE_PARENS: | |
+ --parens; | |
+ goto default; | |
+ | |
case Token.OP_GENERICS_LT: | |
case Token.OP_GENERICS_LT_DECL: | |
case Token.GENERIC_DIMENSION: | |
@@ -1345,7 +1354,6 @@ namespace Mono.CSharp | |
int interrs = 1; | |
int colons = 0; | |
int braces = 0; | |
- int brackets = 0; | |
// | |
// All shorcuts failed, do it hard way | |
// | |
diff --git a/mcs/tests/gtest-409.cs b/mcs/tests/gtest-409.cs | |
index 1d2a5ad..2f5ea10 100644 | |
--- a/mcs/tests/gtest-409.cs | |
+++ b/mcs/tests/gtest-409.cs | |
@@ -150,6 +150,16 @@ public class ConditionalParsing | |
} | |
} | |
+ void Test_18 (bool b, Action a) | |
+ { | |
+ var e = b ? () => { } : a; | |
+ } | |
+ | |
+ void Test_19 (int[,] table) | |
+ { | |
+ var x = 1 > 0 ? table[5, 1] : 0; | |
+ } | |
+ | |
static void Helper<T> (T arg) | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment