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

Side by Side Diff: packages/petitparser/example/lispweb/lispweb.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 library petitparser.example.lispweb;
2
3 import 'dart:html';
4 import 'package:petitparser/lisp.dart';
5
6 void inspector(Element element, Environment environment) {
7 var result = '';
8 while (environment != null) {
9 result = '$result<ul>';
10 for (var symbol in environment.keys) {
11 result = '$result<li><b>$symbol</b>: ${environment[symbol]}</li>';
12 }
13 result = '$result</ul>';
14 result = '$result<hr/>';
15 environment = environment.owner;
16 }
17 element.innerHtml = result;
18 }
19
20 void main() {
21 var root = new Environment();
22 var native = Natives.import(root);
23 var standard = Standard.import(native.create());
24 var environment = standard.create();
25
26 var input = querySelector('#input') as TextAreaElement;
27 var output = querySelector('#output') as TextAreaElement;
28
29 querySelector('#evaluate').onClick.listen((event) {
30 var result = evalString(lispParser, environment, input.value);
31 output.value = result.toString();
32 inspector(querySelector('#inspector'), environment);
33 });
34 inspector(querySelector('#inspector'), environment);
35 }
OLDNEW
« no previous file with comments | « packages/petitparser/example/lispweb/lispweb.css ('k') | packages/petitparser/example/lispweb/lispweb.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698