reflection foundation, tuples, debug.print
This commit is contained in:
@@ -277,3 +277,91 @@ choose func() i32 {
|
||||
(return_statement
|
||||
(expression
|
||||
(identifier)))))))
|
||||
|
||||
==================
|
||||
Tuples and inline for
|
||||
==================
|
||||
|
||||
Pair :: struct { i32, []u8 }
|
||||
|
||||
main func() void {
|
||||
pair Pair = Pair {42, "bro"}
|
||||
singleton :: {1,}
|
||||
empty :: {}
|
||||
_ = pair.0
|
||||
inline for singleton |value| {
|
||||
_ = value
|
||||
}
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(source_file
|
||||
(type_declaration
|
||||
(identifier)
|
||||
(struct_type
|
||||
(record_body
|
||||
(record_field
|
||||
(type
|
||||
(builtin_type)))
|
||||
(record_field
|
||||
(type
|
||||
(array_type
|
||||
(type
|
||||
(builtin_type))))))))
|
||||
(function_declaration
|
||||
(identifier)
|
||||
(parameter_list)
|
||||
(type
|
||||
(builtin_type))
|
||||
(block
|
||||
(statement
|
||||
(variable_declaration
|
||||
(identifier)
|
||||
(type
|
||||
(named_type
|
||||
(qualified_identifier
|
||||
(identifier))))
|
||||
(expression
|
||||
(struct_literal
|
||||
(qualified_identifier
|
||||
(identifier))
|
||||
(initializer_list
|
||||
(expression
|
||||
(integer))
|
||||
(expression
|
||||
(string
|
||||
(string_content))))))))
|
||||
(statement
|
||||
(constant_declaration
|
||||
(identifier)
|
||||
(expression
|
||||
(tuple_literal
|
||||
(expression
|
||||
(integer))))))
|
||||
(statement
|
||||
(constant_declaration
|
||||
(identifier)
|
||||
(expression
|
||||
(tuple_literal))))
|
||||
(statement
|
||||
(assignment_statement
|
||||
(expression
|
||||
(sink))
|
||||
(expression
|
||||
(field_expression
|
||||
(expression
|
||||
(identifier))
|
||||
(integer)))))
|
||||
(statement
|
||||
(for_statement
|
||||
(expression
|
||||
(identifier))
|
||||
(identifier)
|
||||
(block
|
||||
(statement
|
||||
(assignment_statement
|
||||
(expression
|
||||
(sink))
|
||||
(expression
|
||||
(identifier))))))))))
|
||||
|
||||
Reference in New Issue
Block a user