Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions json_parser/json_data.c2
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ public fn const char* Iter.value(const Iter* i) {

// Note: key == nil returns first child TODO
public fn Iter Iter.get_child(const Iter* i, const char* key) {
Iter i2 = { i.data, 0 };
Iter i2 = { i.data, 0 }
if (i.cur_idx == 0) return i2;

i2.cur_idx = find_nested_child(i.data, i.cur_idx, key);
return i2;
}

public fn Iter Iter.get_child_iter(const Iter* i) {
Iter iter = { i.data, 0 };
Iter iter = { i.data, 0 }
const Node* n = &i.data.nodes.data[i.cur_idx];
if (n.is_value()) return iter;
iter.cur_idx = n.child_idx;
Expand Down Expand Up @@ -429,7 +429,7 @@ fn bool Iter.check_schema_priv(const Iter* i, const char** schema) {
if (!n.is_object()) return false;
if ((*schema)[1] == '(') {
*schema += 2;
Iter obj = { i.data, n.child_idx };
Iter obj = { i.data, n.child_idx }
if (!obj.check_schema_priv(schema)) return false;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion json_parser/json_parser.c2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public fn bool Parser.parse(Parser* p, const char* text) {
}

public fn Iter Parser.get_root(const Parser* p) {
Iter node = { p.data, 1 };
Iter node = { p.data, 1 }
return node;
}

Expand Down
16 changes: 8 additions & 8 deletions sudoku/sudoku.c2
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ fn void Board.checkFields(Board* board) {
}

fn void Board.checkRow(Board* board, u8 row) {
u8[10] count = { 0 };
u8[10] pos = { 0 };
u8[10] count = { 0 }
u8[10] pos = { 0 }
for (u8 x=0; x<9; x++) {
u32 idx = 9*row + x;
const Field* f = &board.fields[idx];
Expand All @@ -223,8 +223,8 @@ fn void Board.checkRow(Board* board, u8 row) {
}

fn void Board.checkColumn(Board* board, u8 col) {
u8[10] count = { 0 };
u8[10] pos = { 0 };
u8[10] count = { 0 }
u8[10] pos = { 0 }
for (u8 y=0; y<9; y++) {
u32 idx = 9*y + col;
const Field* f = &board.fields[idx];
Expand All @@ -246,10 +246,10 @@ fn bool Board.checkSquares(Board* board, bool extra) {
for (u8 x=0; x<3; x++) {
// check square
u8 topleft = (y*9 + x) *3;
u8[10] count = { 0 };
u8[10] pos = { 0 };
u8[10] localRows = { 0 };
u8[10] localCols = { 0 };
u8[10] count = { 0 }
u8[10] pos = { 0 }
u8[10] localRows = { 0 }
u8[10] localCols = { 0 }
const Field* f = &board.fields[topleft + 0];
for (u32 o=1; o<10; o++) {
// TODO refactor with block below
Expand Down
4 changes: 2 additions & 2 deletions toml_parser/toml_parser.c2
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public fn NodeIter Reader.getNodeIter(const Reader* r, const char* key) {
if (node && getKind(node.nameOffset) == NodeKind.TableArray) {
node = &r.blocks.nodes[node.child];
}
NodeIter iter = { r.blocks, node };
NodeIter iter = { r.blocks, node }
return iter;
}

Expand All @@ -537,7 +537,7 @@ public type ValueIter struct {
}

fn ValueIter ValueIter.create(const char* values, bool isArray) {
ValueIter iter = { values, isArray };
ValueIter iter = { values, isArray }
return iter;
}

Expand Down
4 changes: 2 additions & 2 deletions unit_test/mod1_test.c2
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ fn void Test.test4(Test* t) @(skip) {
*/

fn void Test.test5(Test* t) {
u8[] a = { 0x1, 0x2, 0x3, 0x4 };
u8[] b = { 0x1, 0x2, 0x8, 0x4 };
u8[] a = { 0x1, 0x2, 0x3, 0x4 }
u8[] b = { 0x1, 0x2, 0x8, 0x4 }
check_data(a, elemsof(a), b, elemsof(b));
}

Expand Down
4 changes: 2 additions & 2 deletions yaml_parser/yaml_iterator.c2
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public type Iter struct {
}

public fn Iter Parser.getNodeChildIter(const Parser* p, const Node* n) {
Iter iter = { .data = &p.data, .node = nil };
Iter iter = { .data = &p.data, .node = nil }
if (n && n.kind != NodeKind.Scalar && n.child_idx) {
iter.node = p.data.idx2node(n.child_idx);
}
Expand Down Expand Up @@ -108,7 +108,7 @@ public fn const char* Iter.getValue(const Iter* iter) {
}

public fn Iter Iter.getChildIter(Iter* parent) {
Iter iter = { .data = parent.data, .node = nil };
Iter iter = { .data = parent.data, .node = nil }
if (parent.node == nil) return iter;

const Node* n = parent.node;
Expand Down