- 11 May, 2017 3 commits
-
-
Kirill Smelkov authored
* origin/master: Make map() and zip() clean up after StopIteration Implement sys.exc_clear()
-
Dylan Trotter authored
This came to light because of this issue report: https://github.com/google/grumpy/issues/305 Basically, map() and zip() were detecting StopIteration but were calling ExcRestore(nil, nil) in the wrong place, so under normal circumstances, exc info would be set to StopIteration after they returned. Normally this would not cause a problem, but the code in the bug report was calling a native function (time.Now()) subsequent to a map() and nativeInvoke checks ExcInfo() to determine whether the Go function manually triggered an exception. See: https://github.com/google/grumpy/blob/master/runtime/native.go#L572 In this case, nativeInvoke was being fooled because exc info had been set previously. nativeInvoke should probably be smarter about this by resetting the exception before the native call.
-
Dylan Trotter authored
-
- 10 May, 2017 5 commits
-
-
Kirill Smelkov authored
-
Kirill Smelkov authored
-
Kirill Smelkov authored
-
Kirill Smelkov authored
-
Kirill Smelkov authored
* master: (199 commits) Implement Complex.Add and Sub (#294) Implement complex hash. (#293) Fix .d file generation on OS X (#292) Move pythonparser into grumpy package (#291) Implement future unicode_literals. (#286) Implement relative imports. (#284) Importer class that subsumes ImportVisitor & Path (#283) Comment out TestPrint Comment out TestRawInput Implement complex comparison operations (#281) implement a simple builtin sum Fix broken unit tests Include compiler test srcs in pass file deps. Implement absolute_import. Clean up a few tests. Simplify future features a little bit Import stdlib colorsys and implement round function for ndigits. (#278) Update README.md Import third_party/ouroboros/operator (#275) Tool that creates makefile that builds Python mods ...
-
- 27 Apr, 2017 1 commit
-
-
Dong-hee Na authored
-
- 24 Apr, 2017 1 commit
-
-
Dong-hee Na authored
-
- 23 Apr, 2017 2 commits
-
-
Dylan Trotter authored
The awk script that was processing modulefinder output to produce .d files was not working because it was using \> to match a word ending, but that is only supported in GNU awk: https://www.math.utah.edu/docs/info/gawk_5.html#SEC29 Switched that for a more portable equivalent.
-
Dylan Trotter authored
make install was broken since we moved to pythonparser because it was not being copied into the install dir. Rather than just copying it into the PYTHONPATH alongside grumpy, I thought it better to embed it within the grumpy package so that it won't conflict with an installed pythonparser. This addresses: https://github.com/google/grumpy/issues/288
-
- 07 Apr, 2017 6 commits
-
-
Dylan Trotter authored
-
Dylan Trotter authored
-
Dylan Trotter authored
Previously importing logic was spread across two classes: Path which looked for files in a list of directories and ImportVisitor which processed import nodes and used a Path to resolve modules. That became cumbersome when attempting to support relative imports because now two modes of module resolution were necessary and a "level" param carried through the calls. This change collapses the Path and ImportVisitor functionality into a single Importer class that processes import nodes and resolves to modules directly. This class is stateless which makes it easier to test and work with. It will also make it easier to implement relative imports since the node processing and module resolution are integrated.
-
Dylan Trotter authored
This test is causing too many Travis failures. Will re-enable when #282 is addressed.
-
Dylan Trotter authored
This test is causing too many Travis failures. Will re-enable when https://github.com/google/grumpy/issues/282 is addressed.
-
Mansour Rahimi authored
-
- 05 Apr, 2017 1 commit
-
-
Long Ang authored
-
- 03 Apr, 2017 6 commits
-
-
Dylan Trotter authored
In bc04caf4 I moved a bunch of tests into imputil_test.py but I failed to add a __main__ check so the tests were never run. This change remedies that and fixes the tests that were broken the whole time.
-
Dylan Trotter authored
-
Dylan Trotter authored
-
Dylan Trotter authored
-
Dylan Trotter authored
-
Dong-hee Na authored
-
- 28 Mar, 2017 3 commits
-
-
Dylan Trotter authored
-
Dong-hee Na authored
-
Dylan Trotter authored
genmake looks in the src/__python__ subdir of a dir specified on the command line and generates a makefile that describes how to build Go packages from the .py sources. The project Makefile now uses genmake to generate targets for the stdlib.
-
- 25 Mar, 2017 1 commit
-
-
Dylan Trotter authored
-
- 24 Mar, 2017 8 commits
-
-
Dylan Trotter authored
-
Dylan Trotter authored
-
Dylan Trotter authored
-
Dylan Trotter authored
Modules being imported are now detected at compile time. So it's possible to determine whether "from x import y" is importing module y or a member y of module x. This change uses this capability to choose whether to import a module or a member. This fixes https://github.com/google/grumpy/issues/99
-
Dylan Trotter authored
-
Dylan Trotter authored
Previously, grumpc assumed that all imports were valid Python modules. So there was no way to distinguish between, for example, importing a module within a package, or a package member of the same name. This change makes it so that during code generation, Python source files corresponding to the modules being imported exist on the GOPATH. If no such Python source file exists, then an ImportError is raised. Additionally, this change fixes an issue where imports within packages or within modules within packages were not first checking for the named import within the package directory. Now, package-relative imports work as expected.
-
Dylan Trotter authored
-
Dylan Trotter authored
-
- 23 Mar, 2017 2 commits
-
-
Dong-hee Na authored
-
Dong-hee Na authored
-
- 22 Mar, 2017 1 commit
-
-
Dylan Trotter authored
Import logic is currently embedded in the StatementVisitor class which makes it difficult to reuse. This change factors that logic out into an ImportVisitor class in util.py. The newly exposed logic can now be used by other tools.
-