Skip to content

Syntax error (Python3) debug #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open

Conversation

JesterI3D
Copy link

File "rusthon.py", line 541
print 'making new rusthon cache folder: ' + GITCACHE
File "rusthon.py", line 558
print 'rebuilding git repo: ' + tag
File "rusthon.py", line 566
print '>>'+line
...
and 982, 991,1023,1526,1884,1943

hartsantler added 30 commits September 12, 2014 03:14
updated readme, added gython.py build script.
allow subclasses to call parent class methods (extend).
self types now passed to Go backend.
… `int self.x = 1`, new pointer syntax `*myclass self.y = a`.

updated richards benchmark with typed syntax.
…ointer to arrays in arguments that take arrays.

changed `.append` method to operate on an array pointer. updated `len` builtin to operate on a pointer.
fixed passing an array to another function that appends to it.
…to functions (so they can modify its contents inplace).
… the same generic function that can call methods on the instances and return a value. only the first variable in a generic function may be a subclass instance.

in the function def the shared base class is given by name: `def g( a:MyBaseClass ):`
…to output fast and clean javascript (breaks some python rules, like using objects as dict keys)
…is likely needed for programs that do not depend much on too many pythonic features.
…r loops act like python loops, this is safe to use if you only loop over arrays.
using hack `_tmp := make([]A,n); TARGET=&_tmp` because go compiler complains about taking the address of make.
…eneric in __init__ will become `interface{}` which can then be used by methods that use the attribute as an argument and retype it as a Generic.
hartsantler added 28 commits October 5, 2014 05:34
… cast to subclass type.

TODO: do not include super class in generic type switch, and gather all classes and subclasses before doing main translation (to generate the generic switch properly)
…subclass can define its "own" attributes and these will be inserted into the struct of the other subclasses (but not used).
…`object` that contains `__class__` the name of the class, and in a generic function switch on the name instead of `G.(type)` because that can be wrong because methods in a base class that return self cast any subclass it returns to the type of the class instance the method is called from.

added debug printing to catch nil pointer in unsafe switch using __class__ name.
…rns `self` - only works in an assignment to a variable, a type switch is generated in the caller, and the function body is branched from that point.
…ace or pointer to a struct,

fails with hack using reflect and type switch because the Go compiler will not allow the case the
invalid case (even if it never happens at runtime).  TODO: internally track the type of `A`, or run the output code two times through the Go compiler to see which variables are structs or interfaces from errors printed to stdout.
…itch in the caller to convert the item back to the correct subclass.
…ss, and infact its another subclass type, when passed to a generic function, if the first switch case that switches on the struct name fails, then fallback to using a `switch X.(type)` to convert to the struct type that the Go compiler thinks it is, and then force it to be of the subclass type that was known by the first switch (the embedded struct name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant