Permalink
Browse files

NullExpr class

  • Loading branch information...
1 parent 0df8bce commit bf89811febde1746077c281a8c7b9e25b8181d17 @NotFound committed May 17, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 winxedst2.winxed
View
@@ -3773,6 +3773,22 @@ class FunctionRef : FinalExpr
}
}
+class NullExpr : FinalExpr
+{
+ function NullExpr(owner, start)
+ {
+ self.Expr(owner, start);
+ }
+ function isnull() { return true; }
+ function checkresult() { return REGvar; }
+ function emit_void(e) { }
+ function emit(e, string result)
+ {
+ self.annotate(e);
+ e.emitnull(result);
+ }
+}
+
class IdentifierExpr : SimpleExpr
{
var name;
@@ -3880,6 +3896,8 @@ class IdentifierExpr : SimpleExpr
var sym = self.scopesearch([name], 0);
switch {
case sym == null:
+ if (name.iskeyword(NULL))
+ return new NullExpr(self.owner, name);
break;
case sym instanceof FunctionStatement:
if (!sym.ismulti()) {

0 comments on commit bf89811

Please sign in to comment.