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

Unified Diff: petitparser/lib/lisp.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 | « petitparser/lib/json.dart ('k') | petitparser/lib/petitparser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: petitparser/lib/lisp.dart
diff --git a/petitparser/lib/lisp.dart b/petitparser/lib/lisp.dart
deleted file mode 100644
index 4bcd5a3996294541fd8793002b028216925ab90e..0000000000000000000000000000000000000000
--- a/petitparser/lib/lisp.dart
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * This package contains a simple grammar and evaluator for LISP.
- *
- * The code is reasonably complete to run and evaluate reasonably complex
- * programs from the console and from the web browser.
- */
-library lisp;
-
-import 'dart:collection';
-import 'package:petitparser/petitparser.dart';
-
-part 'src/lisp/cons.dart';
-part 'src/lisp/environment.dart';
-part 'src/lisp/grammar.dart';
-part 'src/lisp/name.dart';
-part 'src/lisp/natives.dart';
-part 'src/lisp/parser.dart';
-part 'src/lisp/standard.dart';
-
-/** The standard lisp parser definition. */
-final lispParser = new LispParser();
-
-/** The evaluation function. */
-eval(Environment env, expr) {
- if (expr is Cons) {
- return eval(env, expr.head)(env, expr.tail);
- } else if (expr is Name) {
- return env[expr];
- } else {
- return expr;
- }
-}
-
-/** Evaluate a cons of instructions. */
-evalList(Environment env, expr) {
- var result = null;
- while (expr is Cons) {
- result = eval(env, expr.head);
- expr = expr.tail;
- }
- return result;
-}
-
-/** The arguments evaluation function. */
-evalArguments(Environment env, args) {
- if (args is Cons) {
- return new Cons(eval(env, args.head), evalArguments(env, args.tail));
- } else {
- return null;
- }
-}
-
-/** Reads and evaluates a [script]. */
-evalString(Parser parser, Environment env, String script) {
- var result = null;
- for (var cell in parser.parse(script).value) {
- result = eval(env, cell);
- }
- return result;
-}
« no previous file with comments | « petitparser/lib/json.dart ('k') | petitparser/lib/petitparser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698