ast: remove const hack for global_table, use a proper global instead
parent
d421f28de4
commit
7531f78f67
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
||||||
// Use of this source code is governed by an MIT license
|
// Use of this source code is governed by an MIT license
|
||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
|
[has_globals]
|
||||||
module ast
|
module ast
|
||||||
|
|
||||||
import v.cflag
|
import v.cflag
|
||||||
|
@ -186,13 +187,10 @@ pub fn new_table() &Table {
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
const global_table = &Table(0)
|
__global global_table = &Table(0)
|
||||||
|
|
||||||
pub fn set_global_table(t &Table) {
|
pub fn set_global_table(t &Table) {
|
||||||
unsafe {
|
global_table = t
|
||||||
mut pg := &ast.global_table
|
|
||||||
*pg = t
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// used to compare fn's & for naming anon fn's
|
// used to compare fn's & for naming anon fn's
|
||||||
|
|
Loading…
Reference in New Issue