Browse Source

callback keyword.

Nicolas Cannasse 19 years ago
parent
commit
3068e7b10d
6 changed files with 7 additions and 3 deletions
  1. 2 0
      ast.ml
  2. 1 0
      doc/CHANGES.txt
  3. 1 1
      lexer.mll
  4. 1 0
      parser.ml
  5. 1 1
      std/flash/ContextMenu.hx
  6. 1 1
      std/flash/ContextMenuItem.hx

+ 2 - 0
ast.ml

@@ -59,6 +59,7 @@ type keyword =
 	| Typedef
 	| F9Dynamic
 	| Package
+	| Callback
 
 type binop =
 	| OpAdd
@@ -322,6 +323,7 @@ let s_keyword = function
 	| Typedef -> "typedef"
 	| F9Dynamic -> "f9dynamic"
 	| Package -> "package"
+	| Callback -> "callback"
 
 let rec s_binop = function
 	| OpAdd -> "+"

+ 1 - 0
doc/CHANGES.txt

@@ -17,6 +17,7 @@
 	changed "cast" codegeneration (fix some F9 usages)
 	change in POST data handling in mod_neko (max 256K, except multipart)
 	added neko.Web.getClientHeaders and neko.Web.flush
+	"callback" is now a keyword
 
 2006-10-29: 1.08
 	fixed bug in flash -debug

+ 1 - 1
lexer.mll

@@ -55,7 +55,7 @@ let keywords =
 		Break;Return;Continue;Extends;Implements;Import;
 		Switch;Case;Default;Public;Private;Try;Untyped;
 		Catch;New;This;Throw;Extern;Enum;In;Interface;
-		Cast;Override;F9Dynamic;Typedef;Package];
+		Cast;Override;F9Dynamic;Typedef;Package;Callback];
 	h
 
 let init file =

+ 1 - 0
parser.ml

@@ -418,6 +418,7 @@ and expr = parser
 	| [< '(BrOpen,p1); e = block1; '(BrClose,p2) >] -> (e,punion p1 p2)
 	| [< '(Const c,p); s >] -> expr_next (EConst c,p) s
 	| [< '(Kwd This,p); s >] -> expr_next (EConst (Ident "this"),p) s
+	| [< '(Kwd Callback,p); s >] -> expr_next (EConst (Ident "callback"),p) s
 	| [< '(Kwd Cast,p1); s >] ->
 		(match s with parser
 		| [< '(POpen,_); e = expr; s >] ->

+ 1 - 1
std/flash/ContextMenu.hx

@@ -1,7 +1,7 @@
 package flash;
 
 extern class ContextMenu {
-	public function new( ?callback:Dynamic->ContextMenu->Void ) : Void;
+	public function new( ?callb:Dynamic->ContextMenu->Void ) : Void;
 	public function hideBuiltInItems():Void;
 	public function copy() : ContextMenu;
 

+ 1 - 1
std/flash/ContextMenuItem.hx

@@ -1,7 +1,7 @@
 package flash;
 
 extern class ContextMenuItem {
-	public function new(caption:String, callback:Dynamic->ContextMenuItem->Void, ?separatorBefore:Bool, ?enabled:Bool, ?visible:Bool) : Void;
+	public function new(caption:String, callb:Dynamic->ContextMenuItem->Void, ?separatorBefore:Bool, ?enabled:Bool, ?visible:Bool) : Void;
 	public function copy() : ContextMenuItem;
 
 	public function onSelect( v : Dynamic, c : ContextMenuItem ) : Void;