Add lexing, parsing and some semantic checking for constant buffers.
This commit is contained in:
8
AST.jai
8
AST.jai
@@ -20,6 +20,7 @@ AST_Kind :: enum {
|
||||
// Operator;
|
||||
Call;
|
||||
Struct;
|
||||
CBuffer;
|
||||
FieldList;
|
||||
ArgList;
|
||||
Variable;
|
||||
@@ -39,7 +40,8 @@ AST_Node :: struct {
|
||||
|
||||
// @Note(niels): Children nodes can be interpreted as anything useful.
|
||||
// for an if-statement we would have at most 2 children
|
||||
// a property block has a child node for each field declaration etc.
|
||||
// a property block has a field list child node which has
|
||||
// a child node for each field declaration etc.
|
||||
children : [..]*AST_Node;
|
||||
parent : *AST_Node;
|
||||
|
||||
@@ -52,8 +54,6 @@ AST_Node :: struct {
|
||||
|
||||
token : Token;
|
||||
|
||||
assignment : bool;
|
||||
|
||||
source_location : Source_Range;
|
||||
|
||||
type_variable : Type_Variable_Handle;
|
||||
@@ -312,6 +312,8 @@ pretty_print_declaration :: (declaration : *AST_Node, indentation : int, builder
|
||||
else {
|
||||
if declaration.kind == .Struct {
|
||||
append(builder, "struct ");
|
||||
} else if declaration.kind == .CBuffer {
|
||||
append(builder, "constant_buffer ");
|
||||
}
|
||||
print_to_builder(builder, "%", declaration.name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user