+2009-04-15 Ankit Jain <jankit@novell.com>
+
+ * MethodDef.cs (GetNamedLocalSlot): Return -1 if local var not found.
+
2009-03-31 Rodrigo Kumpera <rkumpera@novell.com>
* MethodDef.cs (WriteCode): Emit labels which use offsets as absolute PEAPI
public int GetNamedLocalSlot (string name)
{
Local local = (Local) named_local_table[name];
+ if (local == null)
+ return -1;
return local.Slot;
}
+2009-04-15 Ankit Jain <jankit@novell.com>
+
+ * ILParser.jay (instr): Handle unidentified local var id.
+
2009-03-31 Rodrigo Kumpera <rkumpera@novell.com>
* ILParser.jay: Fix integer labels in handler blocks.
| INSTR_LOCAL id\r
{\r
int slot = codegen.CurrentMethodDef.GetNamedLocalSlot ((string) $2);\r
+ if (slot < 0)\r
+ Report.Error (String.Format ("Undeclared identifier '{0}'", (string) $2));\r
codegen.CurrentMethodDef.AddInstr (\r
new IntInstr ((IntOp) $1, slot, tokenizer.Location));\r
}\r
| INSTR_I id\r
{\r
int slot = codegen.CurrentMethodDef.GetNamedLocalSlot ((string) $2);\r
+ if (slot < 0)\r
+ Report.Error (String.Format ("Undeclared identifier '{0}'", (string) $2));\r
codegen.CurrentMethodDef.AddInstr (new\r
IntInstr ((IntOp) $1, slot, tokenizer.Location));\r
}\r
+2009-04-15 Ankit Jain <jankit@novell.com>
+
+ * StringHelper.cs (startIdChars): New. Set of chars that can start an
+ identifier.
+ (Start): Use startIdChars instead of idchars.
+
2009-04-08 Ankit Jain <jankit@novell.com>
Fix bug #487155.
/// </summary>\r
internal class StringHelper : StringHelperBase {\r
\r
+ private static readonly string startIdChars = "#$@_";\r
private static readonly string idChars = "_$@?`";\r
\r
/// <summary>\r
{\r
mode = Token.UNKNOWN;\r
\r
- if (Char.IsLetter (ch) || idChars.IndexOf (ch) != -1) {\r
+ if (Char.IsLetter (ch) || startIdChars.IndexOf (ch) != -1) {\r
mode = Token.ID;\r
} else if (ch == '\'') {\r
mode = Token.SQSTRING;\r