From 91ece782af24ced0e444849b8317559141cf56dc Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 28 Aug 2019 21:23:46 +0300 Subject: [PATCH] compiler: move Var back to table.v now that the struct bug is fixed --- compiler/parser.v | 22 ---------------------- compiler/table.v | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 22 deletions(-) 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