Skip to content

Commit

Permalink
[xml] add Classdef.isFinal (closes HaxeFoundation#9276)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gama11 committed Apr 6, 2020
1 parent 8b89413 commit 3d5cc4c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/codegen/genxml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ let rec gen_type_decl com pos t =
let meta = gen_meta c.cl_meta in
let ext = (if c.cl_extern then [("extern","1")] else []) in
let interf = (if c.cl_interface then [("interface","1")] else []) in
node "class" (gen_type_params pos c.cl_private (tpath t) c.cl_params c.cl_pos m @ ext @ interf) (tree @ stats @ fields @ constr @ doc @ meta)
let final = (if c.cl_final then [("final","1")] else []) in
node "class" (gen_type_params pos c.cl_private (tpath t) c.cl_params c.cl_pos m @ ext @ interf @ final) (tree @ stats @ fields @ constr @ doc @ meta)
| TEnumDecl e ->
let doc = gen_doc_opt e.e_doc in
let meta = gen_meta e.e_meta in
Expand Down
1 change: 1 addition & 0 deletions src/core/json/genjson.ml
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ let generate_class ctx c =
"init",jopt (generate_texpr ctx) c.cl_init;
"overrides",jlist (classfield_ref ctx) c.cl_overrides;
"isExtern",jbool c.cl_extern;
"isFinal",jbool c.cl_final;
]

let generate_enum ctx e =
Expand Down
1 change: 1 addition & 0 deletions std/haxe/display/JsonModuleTypes.hx
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ typedef JsonClass = {
var kind:JsonClassKind<Dynamic>;
var isInterface:Bool;
var isExtern:Bool;
var isFinal:Bool;
var superClass:Null<JsonTypePathWithParams>;
var interfaces:Array<JsonTypePathWithParams>;
var fields:JsonClassFields;
Expand Down
5 changes: 5 additions & 0 deletions std/haxe/rtti/CType.hx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ typedef Classdef = TypeInfos & {
**/
var isExtern:Bool;

/**
Whether or not the class is `final`.
**/
var isFinal:Bool;

/**
Whether or not the class is actually an [interface](https://haxe.org/manual/types-interfaces.html).
**/
Expand Down
1 change: 1 addition & 0 deletions std/haxe/rtti/XmlParser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ class XmlParser {
doc: doc,
isPrivate: x.x.exists("private"),
isExtern: x.x.exists("extern"),
isFinal: x.x.exists("final"),
isInterface: x.x.exists("interface"),
params: mkTypeParams(x.att.params),
superClass: csuper,
Expand Down

0 comments on commit 3d5cc4c

Please sign in to comment.