diff --git a/ast_generic_v1.atd b/ast_generic_v1.atd index 70477e8..1884a88 100644 --- a/ast_generic_v1.atd +++ b/ast_generic_v1.atd @@ -287,6 +287,7 @@ type field_name = [ type special = [ (* special vars *) | This | Super (* called 'base' in C# *) + | Cls (* similar to `self`, but indicating the type of the class, not the instance *) | Self | Parent (* different from This/Super? *) (* special calls *) diff --git a/ast_generic_v1_j.ml b/ast_generic_v1_j.ml index 68488cd..682c5d8 100644 --- a/ast_generic_v1_j.ml +++ b/ast_generic_v1_j.ml @@ -1361,6 +1361,7 @@ let write_special = ( match x with | `This -> Buffer.add_string ob "\"This\"" | `Super -> Buffer.add_string ob "\"Super\"" + | `Cls -> Buffer.add_string ob "\"Cls\"" | `Self -> Buffer.add_string ob "\"Self\"" | `Parent -> Buffer.add_string ob "\"Parent\"" | `Eval -> Buffer.add_string ob "\"Eval\"" @@ -1435,6 +1436,10 @@ let read_special = ( Yojson.Safe.read_space p lb; Yojson.Safe.read_gt p lb; `Super + | "Cls" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Cls | "Self" -> Yojson.Safe.read_space p lb; Yojson.Safe.read_gt p lb; @@ -1578,6 +1583,8 @@ let read_special = ( `This | "Super" -> `Super + | "Cls" -> + `Cls | "Self" -> `Self | "Parent" ->