Skip to content

Commit

Permalink
alphabetize things for easier comprehension, and make debug output wo…
Browse files Browse the repository at this point in the history
…rk with multiple files (#106)
  • Loading branch information
JalonSolov authored Mar 16, 2024
1 parent 3108b84 commit 362048d
Show file tree
Hide file tree
Showing 4 changed files with 433 additions and 431 deletions.
160 changes: 80 additions & 80 deletions transpiler/ast.v
Original file line number Diff line number Diff line change
Expand Up @@ -78,64 +78,27 @@ type Statement = ArrayStmt
| UnsafeStmt
| VariableStmt

struct NotYetImplStmt {}

struct MultipleStmt {
mut:
stmts []Statement
}

struct FunctionStmt {
mut:
comment string
public bool
generic bool
method []string
name string
args map[string]string
ret_vals []string
type_ctx bool
body []Statement
}

struct VariableStmt {
mut:
comment string
names []string
middle string
values []Statement
mutable bool = true
@type string
}

struct ArrayStmt {
mut:
@type string
values []Statement
len string
}

struct SliceStmt {
mut:
value string
low Statement
high Statement
}

struct BasicValueStmt {
mut:
value string
}

struct OptionalStmt {
struct BlockStmt {
mut:
stmt Statement
body []Statement
}

struct IncDecStmt {
struct BranchStmt {
mut:
var string
inc string
name string
label string
}

struct CallStmt {
Expand All @@ -145,16 +108,17 @@ mut:
args []Statement
}

struct IfStmt {
struct DeferStmt {
mut:
init_vars []VariableStmt
branchs []IfElse
body []Statement
}

struct IfElse {
struct ForInStmt {
mut:
condition Statement
body []Statement
idx string
element string
variable Statement
body []Statement
}

struct ForStmt {
Expand All @@ -165,40 +129,59 @@ mut:
body []Statement
}

struct ForInStmt {
struct FunctionStmt {
mut:
idx string
element string
variable Statement
comment string
public bool
generic bool
method []string
name string
args map[string]string
ret_vals []string
type_ctx bool
body []Statement
}

struct BranchStmt {
struct GoStmt {
mut:
name string
label string
stmt Statement
}

struct ReturnStmt {
struct IfElse {
mut:
values []Statement
condition Statement
body []Statement
}

struct DeferStmt {
struct IfStmt {
mut:
body []Statement
init_vars []VariableStmt
branchs []IfElse
}

struct UnsafeStmt {
struct IncDecStmt {
mut:
body []Statement
var string
inc string
}

struct MatchStmt {
struct KeyValStmt {
mut:
init VariableStmt
key string
value Statement
cases []MatchCase
}

struct LabelStmt {
mut:
name string
stmt Statement
}

struct MapStmt {
mut:
key_type string
value_type string
values []Statement
}

struct MatchCase {
Expand All @@ -207,23 +190,23 @@ mut:
body []Statement
}

struct StructStmt {
struct MatchStmt {
mut:
name string
fields []Statement
init VariableStmt
value Statement
cases []MatchCase
}

struct KeyValStmt {
struct MultipleStmt {
mut:
key string
value Statement
stmts []Statement
}

struct MapStmt {
struct NotYetImplStmt {}

struct OptionalStmt {
mut:
key_type string
value_type string
values []Statement
stmt Statement
}

struct PushStmt {
Expand All @@ -232,18 +215,35 @@ mut:
value Statement
}

struct LabelStmt {
struct ReturnStmt {
mut:
name string
stmt Statement
values []Statement
}

struct GoStmt {
struct SliceStmt {
mut:
stmt Statement
value string
low Statement
high Statement
}

struct BlockStmt {
struct StructStmt {
mut:
name string
fields []Statement
}

struct UnsafeStmt {
mut:
body []Statement
}

struct VariableStmt {
mut:
comment string
names []string
middle string
values []Statement
mutable bool = true
@type string
}
Loading

0 comments on commit 362048d

Please sign in to comment.