File tree 2 files changed +56
-3
lines changed
2 files changed +56
-3
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,29 @@ astyle --style=java --add-brackets < x.c > x.go
33
33
34
34
Roadmap
35
35
=======
36
- * make pystone.py work
36
+ * make pystone.py work - DONE
37
37
* make enough of internals work so can run python tests
38
38
* import python tests and write go test runner to run them
39
39
* make lots of them pass
40
40
41
+
42
+ Exceptions
43
+ ==========
44
+
45
+ Currently uses a panic/recover mechanism
46
+
47
+ Change to an error passing mechanism using go error type (so can use go vet etc to check)
48
+
49
+ panic/recover only within single modules (like compiler/parser)
50
+
41
51
Missing parts
42
52
=============
43
53
* repr/str
44
54
* subclassing built in types
55
+ * integers > 64 bit
56
+ * make py.Int be a wrapper for int
57
+ * make it promote to py.BigInt
58
+ * StringDict vs Dict
45
59
46
60
Polymorphism
47
61
============
@@ -170,7 +184,9 @@ Introspection idea
170
184
Parser
171
185
======
172
186
173
- Use Python's Grammar file - converted into parser/grammar.y
187
+ Used Python's Grammar file - converted into parser/grammar.y
188
+
189
+ Used go tool yacc and a hand built lexer in parser/lexer.go
174
190
175
- Use go tool yacc and a hand built lexer in parser/lexer.go
191
+ DONE
176
192
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3.4
2
+
3
+ class C :
4
+ attr1 = 42
5
+ def __init__ (self ):
6
+ self .attr2 = 43
7
+ self .attr3 = 44
8
+ c = C ()
9
+
10
+ # Test LOAD_ATTR
11
+ assert c .attr1 == 42
12
+ assert C .attr1 == 42
13
+ assert c .attr2 == 43
14
+ assert c .attr3 == 44
15
+
16
+ # Test DELETE_ATTR
17
+ del c .attr3
18
+
19
+ # FIXME - exception handling broken
20
+ # ok = False
21
+ # try:
22
+ # c.attr3
23
+ # except AttributeError:
24
+ # ok = True
25
+ # assert ok
26
+
27
+ # Test STORE_ATTR
28
+ c .attr1 = 100
29
+ c .attr2 = 101
30
+ c .attr3 = 102
31
+ assert c .attr1 == 100
32
+ assert C .attr1 == 42
33
+ assert c .attr2 == 101
34
+ assert c .attr3 == 102
35
+
36
+ # End with this
37
+ finished = True
You can’t perform that action at this time.
0 commit comments