Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: packages/petitparser/lib/src/lisp/environment.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/petitparser/lib/src/lisp/cons.dart ('k') | packages/petitparser/lib/src/lisp/grammar.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
}
« no previous file with comments | « packages/petitparser/lib/src/lisp/cons.dart ('k') | packages/petitparser/lib/src/lisp/grammar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698