Index: packages/petitparser/lib/src/lisp/environment.dart |
diff --git a/petitparser/lib/src/lisp/environment.dart b/packages/petitparser/lib/src/lisp/environment.dart |
similarity index 62% |
rename from petitparser/lib/src/lisp/environment.dart |
rename to packages/petitparser/lib/src/lisp/environment.dart |
index 79d2b086f0cde744b28f88d267203c59c3a69769..579d4b9bb4b249f2b463ea275102f3d6cd57e138 100644 |
--- a/petitparser/lib/src/lisp/environment.dart |
+++ b/packages/petitparser/lib/src/lisp/environment.dart |
@@ -1,23 +1,21 @@ |
-part of lisp; |
+part of petitparser.lisp; |
-/** |
- * Environment of bindings. |
- */ |
+/// Environment of bindings. |
class Environment { |
- /** The owning environment. */ |
+ /// The owning environment. |
final Environment _owner; |
- /** The internal environment bindings. */ |
+ /// The internal environment bindings. |
final Map<Name, dynamic> _bindings; |
- /** Constructor for the nested environment. */ |
+ /// Constructor for the nested environment. |
Environment([this._owner]) : _bindings = new Map(); |
- /** Constructor for a nested environment. */ |
+ /// Constructor for a nested environment. |
Environment create() => new Environment(this); |
- /** Return the binding for [key]. */ |
+ /// Return the binding for [key]. |
operator [](Name key) { |
if (_bindings.containsKey(key)) { |
return _bindings[key]; |
@@ -28,7 +26,7 @@ class Environment { |
} |
} |
- /** Updates the binding for [key] with a [value]. */ |
+ /// Updates the binding for [key] with a [value]. |
void operator []=(Name key, value) { |
if (_bindings.containsKey(key)) { |
_bindings[key] = value; |
@@ -39,18 +37,18 @@ class Environment { |
} |
} |
- /** Defines a new binding from [key] to [value]. */ |
+ /// Defines a new binding from [key] to [value]. |
define(Name key, value) { |
return _bindings[key] = value; |
} |
- /** Returns the keys of the bindings. */ |
+ /// Returns the keys of the bindings. |
Iterable<Name> get keys => _bindings.keys; |
- /** Returns the parent of the bindings. */ |
+ /// Returns the parent of the bindings. |
Environment get owner => _owner; |
- /** Called when a missing binding is accessed. */ |
+ /// Called when a missing binding is accessed. |
_invalidBinding(Name key) { |
throw new ArgumentError('Unknown binding for $key'); |
} |