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

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

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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/packages/petitparser/lib/src/lisp/environment.dart b/packages/petitparser/lib/src/lisp/environment.dart
deleted file mode 100644
index 579d4b9bb4b249f2b463ea275102f3d6cd57e138..0000000000000000000000000000000000000000
--- a/packages/petitparser/lib/src/lisp/environment.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-part of petitparser.lisp;
-
-/// Environment of bindings.
-class Environment {
-
- /// The owning environment.
- final Environment _owner;
-
- /// The internal environment bindings.
- final Map<Name, dynamic> _bindings;
-
- /// Constructor for the nested environment.
- Environment([this._owner]) : _bindings = new Map();
-
- /// Constructor for a nested environment.
- Environment create() => new Environment(this);
-
- /// Return the binding for [key].
- operator [](Name key) {
- if (_bindings.containsKey(key)) {
- return _bindings[key];
- } else if (_owner != null) {
- return _owner[key];
- } else {
- return _invalidBinding(key);
- }
- }
-
- /// Updates the binding for [key] with a [value].
- void operator []=(Name key, value) {
- if (_bindings.containsKey(key)) {
- _bindings[key] = value;
- } else if (_owner != null) {
- _owner[key] = value;
- } else {
- _invalidBinding(key);
- }
- }
-
- /// Defines a new binding from [key] to [value].
- define(Name key, value) {
- return _bindings[key] = value;
- }
-
- /// Returns the keys of the bindings.
- Iterable<Name> get keys => _bindings.keys;
-
- /// Returns the parent of the bindings.
- Environment get owner => _owner;
-
- /// 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