built-in variables can be used in outer scopes.

This commit is contained in:
gnembon committed 2019-11-20 23:37:16 -04:00
1 parent 18edddcade
commit dd2630579b
1 file changed
+4 -1
@@ -1,10 +1,13 @@
package carpet.script.value;
import carpet.script.exception.InternalExpressionException;
public class GlobalValue extends Value
{
public GlobalValue(Value variable)
{
variable.assertAssignable();
if (variable.boundVariable == null)
throw new InternalExpressionException("You can only borrow variables from the outer scope");
this.boundVariable = variable.boundVariable;
}