diff --git a/compiler/parser.v b/compiler/parser.v index b36b3141c6..046d6b21b5 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -10,28 +10,6 @@ import ( strings ) -struct Var { -mut: - typ string - name string - is_arg bool - is_const bool - args []Var // function args - attr string // [json] etc - is_mut bool - is_alloc bool - ptr bool - ref bool - parent_fn string // Variables can only be defined in functions - mod string // module where this var is stored - line_nr int - access_mod AccessMod - is_global bool // __global (translated from C only) - is_used bool - is_changed bool - scope_level int -} - struct Parser { file_path string // "/home/user/hello.v" file_name string // "hello.v" diff --git a/compiler/table.v b/compiler/table.v index 82a310b22d..f4e151ce7a 100644 --- a/compiler/table.v +++ b/compiler/table.v @@ -7,6 +7,29 @@ module main import math import strings +struct Var { +mut: + typ string + name string + is_arg bool + is_const bool + args []Var // function args + attr string // [json] etc + is_mut bool + is_alloc bool + ptr bool + ref bool + parent_fn string // Variables can only be defined in functions + mod string // module where this var is stored + line_nr int + access_mod AccessMod + is_global bool // __global (translated from C only) + is_used bool + is_changed bool + scope_level int +} + + struct Table { mut: types []Type