diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/qparser/idents.ml | 59 | ||||
-rw-r--r-- | lib/syntax/get_type.ml | 2 | ||||
-rw-r--r-- | lib/syntax/t.ml | 4 | ||||
-rw-r--r-- | lib/syntax/type_of.ml | 2 |
4 files changed, 26 insertions, 41 deletions
diff --git a/lib/qparser/idents.ml b/lib/qparser/idents.ml index 06bf32a..f96dd95 100644 --- a/lib/qparser/idents.ml +++ b/lib/qparser/idents.ml @@ -3,6 +3,20 @@ module T = Qsp_syntax.T let keyword_table = Hashtbl.create 53 +(* Thoses ident are considered as variables and not declared here + "BACKIMAGE", + "$BACKIMAGE", + "BCOLOR", + "DEBUG", + "DISABLESCROLL" + "DISABLESUBEX", + "FCOLOR", + "$FNAME", + "FSIZE", + "GC", + "LCOLOR", + "NOSAVE" +*) let _ = List.iter (fun (kwd, tok) -> Hashtbl.add keyword_table kwd tok) @@ -15,11 +29,7 @@ let _ = ("AND", AND); ("ARRCOMP", FUNCTION T.Arrcomp); ("ARRPOS", FUNCTION T.Arrpos); - ("ARRSIZE", FUNCTION T.Arrsize) - (* - ; "BACKIMAGE", KEYWORD "BACKIMAGE" - ; "$BACKIMAGE", KEYWORD "BACKIMAGE" - ; "BCOLOR", KEYWORD "BCOLOR" *); + ("ARRSIZE", FUNCTION T.Arrsize); ("CLA", KEYWORD T.Cla); ("CLEAR", KEYWORD T.Clear); ("*CLEAR", KEYWORD T.Clear'); @@ -35,21 +45,14 @@ let _ = ("CURACTS", IDENT "CURACTS"); ("$CURACTS", IDENT "$CURACTS"); ("CURLOC", IDENT "CURLOC"); - ("$CURLOC", IDENT "$CURLOC") - (* - ; "DEBUG", KEYWORD "DEBUG" -*); + ("$CURLOC", IDENT "$CURLOC"); ("DELACT", KEYWORD T.DelAct); ("DEL ACT", KEYWORD T.DelAct); ("DELLIB", KEYWORD T.FreeLib); ("DELOBJ", KEYWORD T.DelObj); ("DEL OBJ", KEYWORD T.DelObj); ("DESC", FUNCTION T.Desc); - ("$DESC", FUNCTION T.Desc') - (* - ; "DISABLESCROLL", KEYWORD "DISABLESCROLL" - ; "DISABLESUBEX", KEYWORD "DISABLESUBEX" -*); + ("$DESC", FUNCTION T.Desc'); ("DYNAMIC", KEYWORD T.Dynamic); ("DYNEVAL", FUNCTION T.Dyneval); ("$DYNEVAL", FUNCTION T.Dyneval'); @@ -57,23 +60,14 @@ let _ = ("ELSEIF", ELIF); ("END", END); ("EXEC", KEYWORD T.Exec); - ("EXIT", KEYWORD T.Exit) - (* - ; "FCOLOR", KEYWORD "FCOLOR" - ; "$FNAME", KEYWORD "$FNAME" -*); - ("FREELIB", KEYWORD T.FreeLib) - (* - ; "FSIZE", KEYWORD "FSIZE" -*); + ("EXIT", KEYWORD T.Exit); + ("FREELIB", KEYWORD T.FreeLib); ("FUNC", FUNCTION T.Func); ("$FUNC", FUNCTION T.Func'); ("GETOBJ", FUNCTION T.Getobj); ("$GETOBJ", FUNCTION T.Getobj'); ("GOSUB", KEYWORD T.Gosub); - ("GOTO", KEYWORD T.Goto) (* - ; "GC", KEYWORD "GC" -*); + ("GOTO", KEYWORD T.Goto); ("GS", KEYWORD T.Gosub); ("GT", KEYWORD T.Goto); ("IF", IF); @@ -91,10 +85,7 @@ let _ = ("KILLQST", KEYWORD T.FreeLib); ("KILLVAR", KEYWORD T.KillVar); ("LCASE", FUNCTION T.Lcase); - ("$LCASE", FUNCTION T.Lcase') - (* - ; "LCOLOR", KEYWORD "LCOLOR" -*); + ("$LCASE", FUNCTION T.Lcase'); ("LEN", FUNCTION T.Len); ("LET", LET); ("LOC", FUNCTION T.Loc); @@ -112,9 +103,7 @@ let _ = ("MSG", KEYWORD T.Msg); ("NL", KEYWORD T.Nl); ("*NL", KEYWORD T.Nl'); - ("NO", NO) (* - ; "NOSAVE", KEYWORD "NOSAVE" -*); + ("NO", NO); ("OBJ", OBJ); ("$ONACTSEL", IDENT "$ONACTSEL"); ("$ONGLOAD", IDENT "$ONGLOAD"); @@ -150,8 +139,8 @@ let _ = ("SHOWINPUT", KEYWORD T.ShowInput); ("SHOWOBJS", KEYWORD T.ShowObjs); ("SHOWSTAT", KEYWORD T.ShowStat); - ("STATTXT", FUNCTION T.Stattxt); - ("$STATTXT", FUNCTION T.Stattxt'); + ("STATTXT", IDENT "STATTXT"); + ("$STATTXT", IDENT "$STATTXT"); ("STR", FUNCTION T.Str); ("$STR", FUNCTION T.Str'); ("STRCOMP", FUNCTION T.Strcomp); diff --git a/lib/syntax/get_type.ml b/lib/syntax/get_type.ml index 4dee125..c8af9ec 100644 --- a/lib/syntax/get_type.ml +++ b/lib/syntax/get_type.ml @@ -85,8 +85,6 @@ let function_ : S.pos -> T.function_ -> t list -> t = | Rgb -> Raw Integer | Rnd -> Raw Integer | Selact -> Variable String - | Stattxt -> Variable String - | Stattxt' -> Variable String | Str | Str' -> Raw String | Strcomp -> Raw Bool | Strfind -> Variable String diff --git a/lib/syntax/t.ml b/lib/syntax/t.ml index 697b18e..cb9c7ce 100644 --- a/lib/syntax/t.ml +++ b/lib/syntax/t.ml @@ -70,8 +70,6 @@ type function_ = | Rgb | Rnd | Selact - | Stattxt - | Stattxt' | Str | Str' | Strcomp @@ -128,6 +126,8 @@ type keywords = | ShowInput | ShowObjs | ShowStat + | Stattxt + | Stattxt' | Unselect | View | Wait diff --git a/lib/syntax/type_of.ml b/lib/syntax/type_of.ml index 4344a11..239717c 100644 --- a/lib/syntax/type_of.ml +++ b/lib/syntax/type_of.ml @@ -273,8 +273,6 @@ module TypedExpression = struct let report = Helper.compare_args pos [] types report in (default, report) | Selact -> (default, report) - | Stattxt -> (default, report) - | Stattxt' -> (default, report) | Str | Str' -> let expected = Helper.[ Variable (Fixed Integer) ] in let report = Helper.compare_args pos expected types report in |