rename and deprecate field forms for #32
This commit is contained in:
@@ -29,18 +29,22 @@ class FieldForms {
|
|||||||
map[newName] = form;
|
map[newName] = form;
|
||||||
}
|
}
|
||||||
|
|
||||||
map["defvar"] = varOrProperty.bind("defvar");
|
map["defvar"] = varOrProperty.bind("classVar");
|
||||||
map["defprop"] = varOrProperty.bind("defprop");
|
renameAndDeprecate("defvar", "classVar");
|
||||||
|
map["defprop"] = varOrProperty.bind("classProp");
|
||||||
|
renameAndDeprecate("defprop", "classProp");
|
||||||
|
|
||||||
map["defun"] = funcOrMethod.bind("defun");
|
map["defun"] = funcOrMethod.bind("classFunction");
|
||||||
map["defmethod"] = funcOrMethod.bind("defmethod");
|
renameAndDeprecate("defun", "classFunction");
|
||||||
|
map["defmethod"] = funcOrMethod.bind("classMethod");
|
||||||
|
renameAndDeprecate("defmethod", "classMethod");
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function fieldAccess(formName:String, fieldName:String, nameExp:ReaderExp, ?access:Array<Access>) {
|
static function fieldAccess(formName:String, fieldName:String, nameExp:ReaderExp, ?access:Array<Access>) {
|
||||||
if (access == null) {
|
if (access == null) {
|
||||||
access = if (formName == "defvar" || formName == "defprop") {
|
access = if (["defvar", "defprop", "classVar", "classProp"].indexOf(formName) != -1) {
|
||||||
[AFinal];
|
[AFinal];
|
||||||
} else {
|
} else {
|
||||||
[];
|
[];
|
||||||
@@ -65,7 +69,7 @@ class FieldForms {
|
|||||||
access.push(AFinal);
|
access.push(AFinal);
|
||||||
fieldAccess(formName, fieldName, nameExp, access);
|
fieldAccess(formName, fieldName, nameExp, access);
|
||||||
default:
|
default:
|
||||||
if (formName == "defvar" || formName == "defun") {
|
if (["defvar", "defun", "classVar", "classFunction"].indexOf(formName) != -1) {
|
||||||
access.push(AStatic);
|
access.push(AStatic);
|
||||||
}
|
}
|
||||||
access.push(if (fieldName.startsWith("_")) APrivate else APublic);
|
access.push(if (fieldName.startsWith("_")) APrivate else APublic);
|
||||||
|
|||||||
Reference in New Issue
Block a user