-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmalltalk.html
More file actions
43 lines (39 loc) · 1.5 KB
/
smalltalk.html
File metadata and controls
43 lines (39 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Smalltalk Parser</title>
<link rel="stylesheet"
href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
<style>
textarea { width: 100%; height: 200px; }
#input, #output, #console, #environment { font-family: monospace; }
.error { color: red; }
</style>
</head>
<body>
<h1>Smalltalk Parser</h1>
<h2>Program</h2>
<textarea id="input">
exampleWithNumber: x
"A method that illustrates every part of Smalltalk method syntax
except primitives. It has unary, binary, and keyword messages,
declares arguments and temporaries, accesses a global variable
(but not and instance variable), uses literals (array, character,
symbol, string, integer, float), uses the pseudo variables
true false, nil, self, and super, and has sequence, assignment,
return and cascade. It has both zero argument and one argument blocks."
|y|
y := true & false not & (nil isNil) ifFalse: [self halt].
self size + super size.
#($a #a "a" 1 1.0)
do: [:each | Transcript show: (each class name); show: ' ' ]
</textarea>
<input type="submit" id="parse" value="Parse"/>
<h2>Output</h2>
<p id="output"></p>
<script src="smalltalk.dart.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QK0KCHXW3F"></script>
<script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-QK0KCHXW3F');</script>
</body>
</html>