* cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
(pp_expr): do not abort on unknown input, just return.
(eval): abort if there are pending chars.
svn path=/trunk/mcs/; revision=4598
2002-05-13 Miguel de Icaza <miguel@ximian.com>
+ * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
+ (pp_expr): do not abort on unknown input, just return.
+ (eval): abort if there are pending chars.
+
* attribute.cs (Attribute.Resolve): Positional parameters are
optional. Deal with that case.
if (c == '('){\r
s = s.Substring (1);\r
bool val = pp_expr (ref s);\r
- if (s.Length > 0 && s [0] == ')')\r
+ if (s.Length > 0 && s [0] == ')'){\r
+ s = s.Substring (1);\r
return val;\r
+ }\r
Error_InvalidDirective ();\r
return false;\r
}\r
s = s.Trim ();\r
int len = s.Length;\r
if (len > 0){\r
- if (s [0] == '|'){\r
+ char c = s [0];\r
+ \r
+ if (c == '|'){\r
if (len > 2 && s [1] == '|'){\r
s = s.Substring (2);\r
return va || pp_and (ref s);\r
Error_InvalidDirective ();\r
return false;\r
}\r
- } else {\r
- Error_InvalidDirective ();\r
- return false;\r
- }\r
+ } \r
}\r
\r
return va;\r
bool eval (string s)\r
{\r
bool v = pp_expr (ref s);\r
+ s = s.Trim ();\r
+ if (s.Length != 0){\r
+ Error_InvalidDirective ();\r
+ return false;\r
+ }\r
\r
return v;\r
}\r