Skip to content

Commit

Permalink
feat: Loop labels
Browse files Browse the repository at this point in the history
closes #199
  • Loading branch information
giann committed May 15, 2024
1 parent 1f93e9c commit ceaf256
Show file tree
Hide file tree
Showing 5 changed files with 394 additions and 195 deletions.
7 changes: 5 additions & 2 deletions src/Ast.zig
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ pub const Node = struct {
Block: []Node.Index,
BlockExpression: []Node.Index,
Boolean: bool,
Break: void,
Break: ?Node.Index,
Call: Call,
Continue: void,
Continue: ?Node.Index,
Dot: Dot,
DoUntil: WhileDoUntil,
Enum: Enum,
Expand Down Expand Up @@ -458,6 +458,7 @@ pub const For = struct {
condition: Node.Index,
post_loop: []Node.Index,
body: Node.Index,
label: ?TokenIndex,
};

pub const ForEach = struct {
Expand All @@ -466,6 +467,7 @@ pub const ForEach = struct {
value: Node.Index,
body: Node.Index,
key_omitted: bool,
label: ?TokenIndex,
};

pub const Function = struct {
Expand Down Expand Up @@ -697,6 +699,7 @@ pub const VarDeclaration = struct {
pub const WhileDoUntil = struct {
condition: Node.Index,
body: Node.Index,
label: ?TokenIndex,
};

pub const Zdef = struct {
Expand Down
Loading

0 comments on commit ceaf256

Please sign in to comment.