mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 08:46:53 +08:00
Deprecate GLOBAL #247
This commit is contained in:
parent
3b1e9011e7
commit
bd736eddec
@ -2172,7 +2172,7 @@ namespace chaiscript
|
|||||||
throw exception::eval_error("Incomplete variable declaration", File_Position(m_position.line, m_position.col), *m_filename);
|
throw exception::eval_error("Incomplete variable declaration", File_Position(m_position.line, m_position.col), *m_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (Keyword("GLOBAL") || Keyword("global")) {
|
} else if (Keyword("global")) {
|
||||||
retval = true;
|
retval = true;
|
||||||
|
|
||||||
if (!(Reference() || Id(true))) {
|
if (!(Reference() || Id(true))) {
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
// Test global
|
// Test global
|
||||||
|
|
||||||
GLOBAL g = 3;
|
global g = 3;
|
||||||
assert_true(g == 3);
|
assert_true(g == 3);
|
||||||
|
|
||||||
var v := g;
|
var v := g;
|
||||||
assert_true(v == 3);
|
assert_true(v == 3);
|
||||||
|
|
||||||
GLOBAL g = 2;
|
global g = 2;
|
||||||
assert_true(g == 2);
|
assert_true(g == 2);
|
||||||
assert_true(v == 2);
|
assert_true(v == 2);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user