diff options
Diffstat (limited to 'lib/syntax')
-rw-r--r-- | lib/syntax/S.ml | 2 | ||||
-rw-r--r-- | lib/syntax/t.ml | 20 | ||||
-rw-r--r-- | lib/syntax/tree.ml | 4 | ||||
-rw-r--r-- | lib/syntax/tree.mli | 2 | ||||
-rw-r--r-- | lib/syntax/type_of.ml | 2 |
5 files changed, 11 insertions, 19 deletions
diff --git a/lib/syntax/S.ml b/lib/syntax/S.ml index 3873eed..63fcd08 100644 --- a/lib/syntax/S.ml +++ b/lib/syntax/S.ml @@ -53,7 +53,7 @@ module type Instruction = sig type expression type variable - val call : pos -> string -> expression list -> repr + val call : pos -> T.keywords -> expression list -> repr (** Call for an instruction like [GT] or [*CLR] *) val location : pos -> string -> repr diff --git a/lib/syntax/t.ml b/lib/syntax/t.ml index e9a901d..bf31253 100644 --- a/lib/syntax/t.ml +++ b/lib/syntax/t.ml @@ -78,7 +78,7 @@ type function_ = [@@deriving eq, show] type keywords = - | Inclib + | IncLib | Addobj | Cla | Clear @@ -88,10 +88,6 @@ type keywords = | Cls | CmdClear | CopyArr - | CurActs - | CurActs' - | CurLoc - | CurLoc' | DelAct | FreeLib | DelObj @@ -100,7 +96,6 @@ type keywords = | Exit | Gosub | Goto - | IncLib | Jump | KillAll | KillObj @@ -113,23 +108,20 @@ type keywords = | Nl' | P | P' + | Pl + | Pl' | Play - | Play' + | OpenGame + | OpenQst | RefInt | SaveGame - | SelAct' - | SelObj - | SelObj' | SetTimer | ShowActs | ShowInput | ShowObjs | ShowStat | Unselect - | UseHTML - | UserCom' - | UserText - | UserText' | View | Wait | XGoto +[@@deriving eq, show] diff --git a/lib/syntax/tree.ml b/lib/syntax/tree.ml index bb31253..ecad1b4 100644 --- a/lib/syntax/tree.ml +++ b/lib/syntax/tree.ml @@ -28,7 +28,7 @@ module Ast = struct | Declaration of ('a * 'a variable * T.assignation_operator * 'a expression) | Expression of 'a expression | Comment of 'a - | Call of 'a * string * 'a expression list + | Call of 'a * T.keywords * 'a expression list | Location of 'a * string [@@deriving eq, show] end @@ -64,7 +64,7 @@ module Instruction : type expression = Expression.repr type variable = Expression.variable - let call : pos -> string -> expression list -> repr = + let call : pos -> T.keywords -> expression list -> repr = fun pos name args -> Ast.Call (pos, name, args) let location : pos -> string -> repr = diff --git a/lib/syntax/tree.mli b/lib/syntax/tree.mli index ca5a639..ad052e9 100644 --- a/lib/syntax/tree.mli +++ b/lib/syntax/tree.mli @@ -37,7 +37,7 @@ module Ast : sig | Declaration of ('a * 'a variable * T.assignation_operator * 'a expression) | Expression of 'a expression | Comment of 'a - | Call of 'a * string * 'a expression list + | Call of 'a * T.keywords * 'a expression list | Location of 'a * string [@@deriving eq, show] end diff --git a/lib/syntax/type_of.ml b/lib/syntax/type_of.ml index d578700..462f1cd 100644 --- a/lib/syntax/type_of.ml +++ b/lib/syntax/type_of.ml @@ -310,7 +310,7 @@ module Instruction = struct type variable = Expression.variable (** Call for an instruction like [GT] or [*CLR] *) - let call : pos -> string -> expression list -> repr = + let call : pos -> T.keywords -> expression list -> repr = fun _pos _ expressions report -> List.fold_left expressions ~init:report ~f:(fun report expression -> let result = expression report in |