v0.0.0

ncw
2018-08-05T14:10:02Z

Changelog

c0de7de travis: don't test on go1.7 as it fails the math tests
46f8028 math: comment out some expm1 tests which fail on 32 bit
a910f3b travis: run tests in 32 bit mode as well
32e35ae math: fix compile on 32 bit systems
9e5c0d4 Change Type.Flags to uint to make gpython compile on 32 bit OSes
f75f21e Tidy junk files
9442150 Add goreleaser to make packages on github
77dde64 Test gpython with Travis CI
8b45fd5 Fix link to PSF licence
7418ece Add LICENSE, README and examples
5e6dfca Note about clang tools
97e4a0f compile: add line numbers to compiler and create line number table (lnotab)
bbab811 compile, symtable, parse: get lineno, offset, file into SyntaxErrors
4fc4f37 testparser: make it compile too and make a py3 comparison
c8b83ac py, parse: float - fix parsing of out of range floats and floats with spaces
bdc70db parser: testparser - script to parse all the python source
132a9f5 py: int - fix base conversion with base and sigil
c61c054 Make tests past with python3 too
b9545a4 py: type - fix initialisation and repr
eb7e8f3 py: fix GoInt and GoInt64 for BigInts
af1ba18 py: list fix add
066aaa7 math: implement math module
7e4f791 py: method - add eq and ne
40a2528 py: make == and != complain if comparing the same type with no eq method
f148ad3 Notes on dict implementation
20fb671 builtin: implement exec() and eval()
d0c72a9 vm: stop dict literals or dict comp panicing with non string keys
f16c0ab py: int: fix multiply
bf7e345 repl: allow """ strings to span lines
e1bc5aa parser: return correct errors for unterminated triple quoted strings
d9667bc repl: implement multi line code input with continuation lines
e352670 parser: fix "single" mode and return correct EOF error
5775015 repl: line editing with history and completion
5148b8e py: repr and str for bool, bytes, dict, ellipsis, list, module, none, string, tuple
3f14f3d py, builtin, vm: make str() and repr() and implement some str and repr
de8c04a builtin: make print end= and sep= work
1a6a2dd Remove debug print messages
bf490cc builtins: slightly improve print()
833d4da py: string - slightly better implementation of % operator
440aa7c py3test.py to run the unit tests with python3 as a cross check
d831b11 py: string: make getitem and contains work and unit tests
d95eafb py: fix Eq and Ne
7bea4c3 Fix errors spotted by go vet
648fc13 parser: fix error on setting someting which can't be set, eg f()=1
927e70d parser: fix reporting of errors and parsing of decimals with leading zeros
60d12b3 parser: implement string escapes
6125042 py: int: Fix neg(IntMin) and round(IntMin)
0e6bb4c py: implement round() for int/long, float() and complex()
2bc7a53 builtin: implement divmod
db8950c py: int: tests for *, <<, >> and fixes
313e2cb py: int: fix floor divide to be exactly the same as python
0dce941 py: Implement BigInt to extend Int and tests for it
b6756c7 py: fix arithmetic operations code generator and code
f863723 Make sys.args accurate and implement -cpuprofile flag
00ffff0 vm: keep locals local (5% speedup)
cf0f887 vm: compile debug out with a constant - 180% speed improvement!
4b9bdd5 Change from panic/recover error handling to go style error values
9d45873 vm, builtin, py: locals(), globals() and builtin fixes
4f76837 vm,py: fix generators called after end of code
8e7ded6 py: Fix SetAttr
28b616d pytest: factor python testing framework into own module
71b65b7 py: import - make work better in REPL and look for init.py
4ccf870 repl: very basic REPL
cae96e7 vm: implement CALL_FUNCTION, fast locals and make function calling work properly
7f90811 compile: fix kwonlyargs and raise SyntaxError on duplicated keywords
e4ed532 py: exception: bodge to return Exception.args
3a20288 py: code: remove extra brackets
db28072 py: dict: implement eq and ne
b306413 symtable: fix functions with no normal arguments (only args etc)
6a2dcc9 vm: Implement SETUP_WITH and WITH_CLEANUP
1d7e528 compile: fix continue in with block
e2cd6ef py: eq and ne for type
07d321a vm: tidy tests
7c07fd2 vm: tests for generators
447496c vm: give opcode its own type
0838829 vm: raise tests
30367ff vm: rename variables to be more like the python original code
87adad3 vm: fix continue
3d425a8 vm: fix exception handling
4865ebf py: ExceptionInfo - check for nil
5a57a8b compile: make SyntaxError on return outside function
19f32cb vm: Tests for STORE_ATTR, LOAD_ATTR, DELETE_ATTR
d059504 vm: implement IMPORT_NAME, IMPORT_FROM, IMPORT_STAR; py: factor Attribute code
a20d443 vm: implement in, not in; py: changed args to Iterate
acaa5df vm: more tests for lists and DELETE_SUBSCR, UNPACK_EX, UNPACK_SEQUENCE etc
bb6f44c py: implement DelItem
194e817 py: tuple - Reverse method
3a897b0 py: float and int - check for divide by zero
5a56e32 vm: tests for loops
ceed469 vm: remove STORE_LOCALS opcode as it is no longer used
5546ccd py: failing test for IsSubtype
0d4a6d4 vm: tests and fixes for exceptions
5ceac9c compile: more tests on exception handling
bf0f523 vm: class definitions
114c283 vm: functions & DELETE_NAME, DELETE_GLOBAL, LOAD_NAME, LOAD_GLOBAL, STORE_DEREF, DELETE_DEREF
f570f95 vm: tests for comprehensinos, SET_ADD and MAP_ADD opcodes
7ac88d9 py: dict.setitem and dict.getitem
4a7ad17 py: temporary set.eq and set.ne
44242f0 Remove emacs noise and coverage from .gitignore
1305651 vm: start of test suite
0273331 py: fix <<= for int
9402ed8 compile: improve coverage and tidy code
08f7c83 compile: Fix continue and loops in general
3965a79 compile: implement subscript and fix attribute
cd8c5fa compile: implement starred assignment
e03f367 compile: use c.Exprs where appropriate
5602724 compile: implement Ellipsis
43c7838 py: implement eq and ne for Ellipsis
069f460 compile: implement yield and yield from
cc7bc38 symtable: fix yield/yield from to set generator flag
6c151b7 compile: import/from import
8072a76 compile: implement try/except/finally
54e8dcb compile: with statement
ebc723a compile: implement comprehensions
3c0ad78 compile: class definitions and module docstrings
8f4bd41 py: code: add eq and ne methods
99c3f74 compile: make decorators for functions work
7686a57 compile: finish lambdas including closures
5a2a35a compile: make closures compile properly
329523c symtable: add Find() method
f0cbe48 compile: re-organise code
cc59dde Fix uses of Compile
e1d9f2c compile: implement return, docstrings, global
0acb046 compile: Fix Varnames
c7d19e1 compile: remove disassembly from test data which makes it stable and shorter
a0c3930 compile: make a simple function compile
f7003ed symtable: remove unused import * checking code
7a5b132 symtable: correct package name and stop panic's escaping the package
21129d0 symtable: make definitions public
08446c2 symtable: fix functions, add classes, lambda, increase coverage
efe2b0e ast: Walk - fix ExceptHandler traversal
88dcf55 symtable: fix tests after move
0f4c714 symtable: factor out from compile
de6c5dd compile: symtable: implement list/set/dict/generator comprehensions
940b430 compile: symtable: test and fix flags
44e6f63 compile: symtable: global and nonlocal
5d621d0 compiler: fill out symtable machinery
39eaaff compiler: symtable - stringer and fix test
f1c2c69 compiler: symbol table framework, plus test machinery
611c8dc ast: Walk - fix null pointer deref and increase test coverage
8eb8664 ast: implement Walk() function
3079681 compile: function definitions without body
a39de11 tuple: implement eq and ne
ff5d114 compiler: implement call
669e0e4 compile: implement for loop
50cdc44 compler: break, continue and framework for testing exceptions
1cfd200 compile: note that diffs are caused by bugs in python 3.4
6ab7061 lexer: fix whitespace issues
8d5c74e compile: Implement while and if
ac9ca13 compiler: del and raise
de8f9c5 compiler: assign and augmented assign
54f3149 compiler: pass, expr statement and assert
4826ccc compile: basic lambda: working
d0ea27b compile: implement Dict, Set, attribute lookup
532fd9c compile: implement named constant (True, False, None)
6b7f42a py.Bool eq and ne
5f5112a py.None: eq and ne
54f7fe1 compiler: implement tuple and list
9b2aead compile: implement Bytes
b881849 py.Bytes: implement comparisons
b8b5f4e compiler: implement comparators
67b9193 compiler: Factor instructions into own file and rename some compile methods
363ce43 compile: Fixup panics to have name of thing they are panicing about
0a8e720 compiler: make stack depth calcuations work
853ec56 Fix 3.4 CLASSDEREF opcode definition
3842c62 compiler: Make names work and detect duplicate constants and names
d7653f2 compile: Implement if expression and JUMP_FORWARD
6fa5265 compiler: Fix jump resolver
2ece17f compiler: Bool Ops, Labels, N pass assembly, Jump resolution
d84b599 compiler: Unary Ops
a9c21a1 compiler: basic infrastructure, constants and binops
c49e757 Add test machinery for compile
6f1f9b2 Add auto generated y.go and y.output now the code is done (almost)
bd6b992 Move grammar test data to its own file
1f41308 Improve coverage
f8f4d5e Fix Ctx
bf62f09 decorators
8ed83d0 Class definition
6ae1b00 Function definitions
0079df4 Lambda and varargs
bad0904 Assign and augmented assign
8858589 With statememt
034315f try / except statememts
79b119d Fix assert statement
a27bc28 Implement For and If
b685896 Simple statements
b3fe9bd Mark unfinished parts
f627870 Make Call with arguments work
133ce36 trailers - call and subscript - call not finished
6305d51 Fix Call to have correct Func name
f993dc7 Make nil items return as None
216cff9 BinOp, BoolOp and UnaryOp
058dc76 Fix Mod String
302a07f Get rid of uneccessary stacks and clear out yylval each lex
3078552 Generator, List, Set and Dictionary comprehensions
817f25d Add SetCtx and SetCtxer
a08810b Ast dump Comprehension structs properly
69f12ff Implement tuple and list in ast - comprehensions still to go
bdbd2d0 Fix parsing of Tuple within Set
13b545c Make simple set and dict literals work
debd25b Empty dict
1950ac4 Parse numbers
8c9be74 Parse string literals into AST
dc76883 Fix String dump
4ab8fc2 Dump Bytes
1d99034 More grammar
f23426a Fix Identifier dumping
eeaa6ed Add ellipsis
1455b43 Add str for None
3729af3 Implement True
aa058f1 Dump py.Objects with str if possible
adafadd Implement bool.str
a1a397a Fix ast.Dump to output to be the same as Python
dc4ddaa Make grammar tests
12ea25a Make testlist work
33659a5 Fix reduce/reduce conflict
571c05c More grammar to ast implementation
9efc2f4 More grammar to ast implementation
378d65e Fix exec mode - add \n on end if not present
41189eb Fix testparser after API changes
0adc14a Fix grammar for multiple entry points for compile mode
c2c5db0 ast.Pos updates, and make initial parse work
f76b12f Make parser return AST - some small parts working
a112b80 Add []Ast to ast.Dump
5084eeb Python AST for gpython
a1f34b2 Move to ast package
0bfa031 Make Go AST
77d414e Python.asdl and generator code straight from Python 3.4
4d6ae14 Tests for Lexer
1e62f18 Coverage of parseNumber and parseString
160b692 Fix ambiguity in try/except statement grammar
52f190f Fix ambiguity in FROM x IMPORT y
8dc6b03 Add backslash continuations and make lexer obey yyDebug so it isn't so noisy
4d27ead Implement implicit line joining * Redo indentation count code - better but still not 100% * Detect errors and return an error on Parse
acd7411 Add debug-ability to yacc code
431305f Fix dictorsetmaker and testlist_comp
1da31d7 Fix argumentlist parsing
9ad6324 A test script for parsing and lexing
ccfbbf6 go generate commands for building grammar
904ca07 Lexer for python 3.4
41a1540 Python 3.4 parser
bcab40c Python Grammar file from Python 3.4
8e1e0b2 Update to use compiler from python3.4
a7d0488 Fix build_class so that it passes its locals properly
9524f0b Fix typo in comment
f7c7648 Update marshal to v3 protocol from Python 3.4
85cf1cd Remove debugging
c6c0fbd Implement ASCII only str.getitem
e57a0df Implement chr()
338ca42 Implement COMPARE_OP IS and NOT_IS
3d702be Fix checking of object.new and init arguments
13dc258 Remove debug
d58e96a Add compile time option for debug messages
49bcc8f Rudimentary string % operator
b686bb2 Implement sys.exit and stdout/stderr/stdin
5f03d50 Basic file object
9a1bb3e Fix ParseTupleAndKeywords
9a3c5db Fix raising an exception in an except block
b30f5fb Implement len() and py.Len
bffb0f4 Implement int()
1e659f3 Skeleton sys module
0dedea3 Rich comparison for string
732ebed BUILD_SLICE, slice objects and slice indexing for lists and tuple implemented
287a1df Implement STORE_GLOBAL
be4d292 Implement + and * for string, list and tuple
21d01bf Implement UNPACK_SEQUENCE
e1f060c Set file when importing a module
7f0ea86 Implement parts of time module
63fe344 Implement ParseTuple and "d" option
47c8d26 Implement IMPORT_FROM
e906ee1 Redo import
e83891d Note on possible improvement
a18babf Execute .py files directly
0b3a137 Implement compile() by cheating and calling python3.3
a74eee3 Implement getattr(), hasattr() and setattr() builtins
96bfd77 Remove importlib as too ambitious right now
45034ef Notes on gpython strings
1827c0c Fix Free and Cell variables to make closures work properly
103d54d Fix Code.Cell2Arg creation
bb0b4cd Move iteration stuff into sequence.go
6bd194a Implement classmethod() and staticmethod()
d625bd9 Implement bytes() constructor
f72f347 Make iterate create the iterator itself
2cb6be9 Implement "s" type in ParseTupleAndKeywords
fc906f0 Implement string len and bool
7d197e6 Implement list() factoring common parts out of tuple() into SequenceList, SequenceTuple and Iterate.
d60fc6f Implement tuple.new
4eda964 Implement ord()
8cc57c1 Correct calling of init for new objects
13f5466 Make tracebacks work and show something useful
cbcda57 Fix function exception message
f9b0894 Implement py.DeleteAttr, py.NewStringDictSized and DELETE_ATTR, BUILD_MAP, STORE_MAP opcodes
e387540 Notes on type caching
3aadc0b Attributes for Function object
150601a Implementation of properties
22b9afd Rework GetAttr and SetAttr and related parts
611ef13 Loading of frozen module importlib/bootstrap.py
0f6ac1b Make import statement, import builtin and IMPORT_NAME opcode work (a bit)
5511993 Better error reporting in sequence
c1949ed Make modules have attributes and call methods in them
858b973 Implement "i" in ParseTupleAndKeywords
c1a8582 Turn marshal into a proper module
3770178 Fix parameter order in checkNumberOfArgs
04017d1 Implement BUILD_SET for set literals eg {1,2,3}
dd14ce9 Fill out Set interface - preliminary implementation only
5a8a876 Convert Set and FrozenSet into pointer types
e1cecbb Implement LIST_APPEND for list comprehensions and speed up BUILD_TUPLE and BUILD_LIST
f7bc949 Make List mutable - type is now *List
ced6726 Fix go vet warnings
08eff15 Implement closures and LOAD_CLOSURE, LOAD_DEREF, MAKE_CLOSURE opcodes
c85199b Raise internal errors properly using panic(ExceptionNewf(Exception, "msg"))
ef89736 Implement generator send() and stub out throw() and close()
e1f0bbd Make bound methods for built in types work properly
4dedb41 Implement builtin.next and py.IsException
84c03fa Implement YIELD_FROM and fix YIELD
9c120e6 Make generator protocol interface and adjust generator.go to use it
4a525b9 Make try/except/else/finally exception handling work
ca73609 Update comments now have decided how exceptions get propagated
8234f5b Make ExceptionInfo which is Type, Value, Traceback for panic propagation
778850d Make sure exception subclasses have TPFLAGS_BASE_EXC_SUBCLASS set for ExceptionClassCheck
5aeba6f Work on exceptions * Improve internal interfaces for making and using exceptions * Catch and check exceptions in the vm * raise exceptions in the vm * Unwind blocks (more work to do) in the vm
6980c03 Notes on the differences between cpython and gpython
7c4b61a Make NewBool and use it to simplify code
f18c29d Define exception heirachy
317101a Make a subclass of a type and implement Fast subclass flags
e90b958 Notes on list implementation
4974b6d Notes on strings
bc5ac4a Fix LOAD_NAME and remove incorrect workaround
03f02c0 Set name, doc and package in Module
0de7e76 Fix range object to step correctly
ee4f980 Fix name lookup in Function object
89966c1 Implement getitem & setitem for List and getitem for Tuple
9e25827 Generators and YIELD_VALUE
aa100dc Put the stack in the Frame like cpython in preparation for generators
ac76658 Notes on attributes of built in objects
7619a72 Make py.Iter and make FOR_ITER use it
b5c3273 Implement range() and object()
2a65fbd Sort out type Init and New so we can make built in objects too!
35eacd5 Implement STORE_ATTR / py.SetAttr
01e2121 Fix object init
fc9465a Fix default arguments
40e3f41 Return bound methods on attribute access
9510b77 Implement LOAD_ATTR/py.GetAttr
058a4e2 Implement py.GetItem/BINARY_SUBSCR and optimise some vm stack operations
6fd60a4 Remove unneeded nil check in STORE_LOCALS now build_class is fixed
984bfd8 Fix locals for class constructor call
daf467b Fix method calling for TypeCallX
17013ce Implement STORE_SUBSCR and SetItem and first attempt at attribute lookup
3fd76bb Dump the stack on exceptions in eval
9dc3e65 type() much more nearly working
9022860 Implement ParseTupleAndKeywords
c8a6976 Make Tuple.Copy()
11d5c5d More implementation of types. Not fully working yet.
edfec36 Start of Object operations
6cbdfef Sequence operations
b2aa6e4 Fix problems noted by go vet
46bb245 Ignore test files
44ee1c2 Working towards making classes work
c305f37 Implement py.None and NoneType
8ad766a Add missing STORE_LOCALS opcode and remove 3.4 LOAD_CLASSDEREF
e85f707 Rework python function calling in preparation for polymorphism
60dd952 Make Iter() and Iterator type and implement GET_ITER, FOR_ITER, BUILD_LIST/TUPLE
acc6057 Implement BREAK and CONTINUE opcodes
c8a27c6 Implement blocks and make while loop work. Fix args > 255 also
36faf9f Implement remaining JUMP opcodes
64c73d3 If statements and rich comparisons
e552306 Fix VM so calling functions works properly
3726302 Remove debug
2008d78 Fix CALL_FUNCTION opcode
7e4713c More builtins abs, round and pow plus more infrastructure
44e760e Implement Neg, Pos, Abs, Invert, MakeBool/Int/Float/Complex and Index
8131a31 Add remaining __ methods
110fc8a Implement divmod and pow and check and fix interfaces for int, float, complex
c1b8923 More arithmetic operations
c8d406d Fix complex type to complex128
6a21724 Auto generate boiler plate for arithmetic operations
55fd328 Implement add and subtract
d30fc55 Factor types into own files and rename some
810fccf Fix VM to use stack frames and not to re-instantiate itself
a217e4f Ignore all hello
21cd9f2 Cheap and nasty BINARY_ADD, fix LOAD_GLOBAL and vm.call()
51c26cc Implement STORE_FAST
3f7c1e2 Implement LOAD_GLOBAL
00d856f Fix integer unmarshal and add set & frozenset
adbc338 Log error on function call for the moment
98bb655 Use more native types
6b8c802 Impelement LOAD_FAST
6e4d79a Name those opcodes
af9a450 Work around circular import - now calls python functions
9a79b97 Notes on future plans
b52ac85 Work on getting the python functions running
dcccf9b Catch panics from vm
56baf07 Make builtin print sort of work
427419c Add module objects, method objects and a start at builtins
06dc53f Byte code loaded and partly executing
7a05a3c More work on basic types
1c83e6c Fix types and code object
507f2f9 Add illegal instruction as default
0827e7c More python types
f65c2cd Tidy output
1f52454 Main gpython binary - slightly working
8ad5ca3 Read .pyc files
92e6a2d Add comparison opcodes
993788c Remove unused opcodes
4c48b1f First commit - work in progress only