Skip to content

Commit

Permalink
zig fmt: preserve comments in front of test blocks
Browse files Browse the repository at this point in the history
 * refactor std.zig.parser
 * fix compiler crashing for some compile errors
 * take advantage of @field in std.zig.ast
 * move ast.NodeFoo to ast.Node.Foo
 * comment preservation is more explicit

See #911
  • Loading branch information
andrewrk committed Apr 20, 2018
1 parent cc35f08 commit 6e57243
Show file tree
Hide file tree
Showing 3 changed files with 1,820 additions and 1,852 deletions.
4 changes: 4 additions & 0 deletions src/ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6523,6 +6523,8 @@ static IrInstruction *ir_gen_node_raw(IrBuilder *irb, AstNode *node, Scope *scop
case NodeTypeFieldAccessExpr:
{
IrInstruction *ptr_instruction = ir_gen_field_access(irb, scope, node);
if (ptr_instruction == irb->codegen->invalid_instruction)
return ptr_instruction;
if (lval.is_ptr)
return ptr_instruction;

Expand Down Expand Up @@ -15556,6 +15558,8 @@ static TypeTableEntry *ir_analyze_instruction_field_parent_ptr(IrAnalyze *ira,
}

ensure_complete_type(ira->codegen, container_type);
if (type_is_invalid(container_type))
return ira->codegen->builtin_types.entry_invalid;

TypeStructField *field = find_struct_type_field(container_type, field_name);
if (field == nullptr) {
Expand Down

0 comments on commit 6e57243

Please sign in to comment.