Skip to content

Commit

Permalink
[cs] support @:private metadata on fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Jan 31, 2018
1 parent 4bcf90f commit 7cdf13e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/meta.ml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ type strict_meta =
| PhpMagic
| PhpNoConstructor
| Pos
| Private
| PrivateAccess
| Property
| Protected
Expand Down Expand Up @@ -322,6 +323,7 @@ let get_info = function
| Pos -> ":pos",("Sets the position of a reified expression",[HasParam "Position";UsedOn TExpr])
| Public -> ":public",("Marks a class field as being public",[UsedOn TClassField;UsedInternally])
| PublicFields -> ":publicFields",("Forces all class fields of inheriting classes to be public",[UsedOn TClass])
| Private -> ":private",("Marks a class field as being private",[UsedOn TClassField;Platform Cs])
| PrivateAccess -> ":privateAccess",("Allow private access to anything for the annotated expression",[UsedOn TExpr])
| Protected -> ":protected",("Marks a class field as being protected",[UsedOn TClassField;Platforms [Cs;Java;Flash]])
| Property -> ":property",("Marks a property field to be compiled as a native C# property",[UsedOn TClassField;Platform Cs])
Expand Down
1 change: 1 addition & 0 deletions src/generators/gencs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ let rec get_class_modifiers meta cl_type cl_access cl_modifiers =
let rec get_fun_modifiers meta access modifiers =
match meta with
| [] -> access,modifiers
| (Meta.Private,[],_) :: meta -> get_fun_modifiers meta "private" modifiers
| (Meta.Protected,[],_) :: meta -> get_fun_modifiers meta "protected" modifiers
| (Meta.Internal,[],_) :: meta -> get_fun_modifiers meta "internal" modifiers
| (Meta.ReadOnly,[],_) :: meta -> get_fun_modifiers meta access ("readonly" :: modifiers)
Expand Down

0 comments on commit 7cdf13e

Please sign in to comment.