replace leading _ for private symbols with keyword hide
This commit is contained in:
@@ -4,6 +4,16 @@ Core syntax
|
||||
|
||||
io :: import "@std/io"
|
||||
|
||||
hide private_value :: 1
|
||||
|
||||
hide private_counter i32 = 0
|
||||
|
||||
hide Private :: opaque
|
||||
|
||||
hide private_sum func(a, b i32) i32 {
|
||||
return a + b
|
||||
}
|
||||
|
||||
Status :: enum {
|
||||
ok
|
||||
bad
|
||||
@@ -30,6 +40,38 @@ sum func(a, b i32) i32 ! Status {
|
||||
(identifier)
|
||||
(string
|
||||
(string_content)))
|
||||
(global_constant_declaration
|
||||
(identifier)
|
||||
(expression
|
||||
(integer)))
|
||||
(global_variable_declaration
|
||||
(identifier)
|
||||
(type
|
||||
(builtin_type))
|
||||
(expression
|
||||
(integer)))
|
||||
(type_declaration
|
||||
(identifier)
|
||||
(opaque_type))
|
||||
(function_declaration
|
||||
(identifier)
|
||||
(parameter_list
|
||||
(parameter
|
||||
(identifier)
|
||||
(identifier)
|
||||
(type
|
||||
(builtin_type))))
|
||||
(type
|
||||
(builtin_type))
|
||||
(block
|
||||
(statement
|
||||
(return_statement
|
||||
(expression
|
||||
(binary_expression
|
||||
(expression
|
||||
(identifier))
|
||||
(expression
|
||||
(identifier))))))))
|
||||
(type_declaration
|
||||
(identifier)
|
||||
(enum_type
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
hide helper func() void {}
|
||||
# <- keyword
|
||||
|
||||
main func() void {
|
||||
_ = sizeof!(i32)
|
||||
# ^^^^^^ function.builtin
|
||||
# ^ operator
|
||||
# ^ operator
|
||||
_ = sizeof(i32)
|
||||
# ^^^^^^ function
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user