成员改为默认公有,并为构造成员添加访问修饰符 #1

Closed
opened 2023-08-28 14:44:52 +00:00 by szTom · 1 comment
Collaborator
  • 改为仅 private 修饰的成员不能在外部访问;
  • 构造成员支持添加访问修饰符,例如 struct A(private x: X, y: Y) {...}
- 改为仅 `private` 修饰的成员不能在外部访问; - 构造成员支持添加访问修饰符,例如 `struct A(private x: X, y: Y) {...}`
szTom added this to the 8月迭代计划 project 2023-08-28 14:44:53 +00:00
szTom added the
enhancement
label 2023-08-28 15:05:37 +00:00
Author
Collaborator

更新后的 BNF 片段:

结构体定义 ::= "struct" <标识符> [模板参数列表] <结构体参数列表> "{" 结构体内容 "}" ";"

结构体参数列表 ::= "(" [结构体参数项 "," {结构体参数项}] ")"

结构体参数项 ::= ["private"] <类型和变量>

结构体内容 ::= <结构体语句>
             | <结构体语句>  <结构体内容>

结构体语句 ::= ["private"] <语句>
更新后的 BNF 片段: ``` 结构体定义 ::= "struct" <标识符> [模板参数列表] <结构体参数列表> "{" 结构体内容 "}" ";" 结构体参数列表 ::= "(" [结构体参数项 "," {结构体参数项}] ")" 结构体参数项 ::= ["private"] <类型和变量> 结构体内容 ::= <结构体语句> | <结构体语句> <结构体内容> 结构体语句 ::= ["private"] <语句> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ez_lcw/acpa#1
No description provided.