Deprecate GLOBAL #247

This commit is contained in:
Jason Turner 2017-05-30 11:33:12 -06:00
parent 3b1e9011e7
commit bd736eddec
2 changed files with 3 additions and 3 deletions

View File

@ -2172,7 +2172,7 @@ namespace chaiscript
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;
if (!(Reference() || Id(true))) {

View File

@ -1,12 +1,12 @@
// Test global
GLOBAL g = 3;
global g = 3;
assert_true(g == 3);
var v := g;
assert_true(v == 3);
GLOBAL g = 2;
global g = 2;
assert_true(g == 2);
assert_true(v == 2);