shedskin:mainline.git
5 years agowe only need one warning for 'isinstance'
Mark Dufour [Mon, 10 Jun 2013 17:51:19 +0000 (19:51 +0200)]
we only need one warning for 'isinstance'

5 years agoadd tests for warnings in cpp.py (warning=True)
Mark Dufour [Mon, 10 Jun 2013 17:46:47 +0000 (19:46 +0200)]
add tests for warnings in cpp.py (warning=True)

5 years agoadd tests for several important errors
Mark Dufour [Mon, 10 Jun 2013 17:11:57 +0000 (19:11 +0200)]
add tests for several important errors

5 years agoThe function error in the module named error has a new argument (gx) which wasn't...
Ernesto Ferro [Sun, 9 Jun 2013 04:42:04 +0000 (23:42 -0500)]
The function error in the module named error has a new argument (gx) which wasn't been sent. This commit fixes that.

5 years agoafter all the recent changes, I decided to manually check each example to see if...
Mark Dufour [Thu, 6 Jun 2013 18:56:41 +0000 (20:56 +0200)]
after all the recent changes, I decided to manually check each example to see if the output still looks okay. here's a description of the type of output of each example, which may be useful later if we decide to automatically compare outputs (I didn't really find any problems, so perhaps that would be overkill)

5 years agoREADME: fix minilight instructions
Mark Dufour [Thu, 6 Jun 2013 18:19:23 +0000 (20:19 +0200)]
README: fix minilight instructions

5 years agoexamples: improve instructions for neural1.py
Mark Dufour [Thu, 6 Jun 2013 17:57:41 +0000 (19:57 +0200)]
examples: improve instructions for neural1.py

5 years agoexamples: fix mastermind_main.py instructions
Mark Dufour [Thu, 6 Jun 2013 17:48:51 +0000 (19:48 +0200)]
examples: fix mastermind_main.py instructions

5 years agoREADME: update instructions for go.py
Mark Dufour [Thu, 6 Jun 2013 17:00:21 +0000 (19:00 +0200)]
README: update instructions for go.py

5 years agograph.py: merge globals-checking code, use it in more places (fixes added problem)
Mark Dufour [Thu, 6 Jun 2013 12:50:37 +0000 (14:50 +0200)]
graph.py: merge globals-checking code, use it in more places (fixes added problem)

5 years agoWhen sending integer (int or long in Python) from Python to C, the value will be...
Ernesto Ferro [Wed, 5 Jun 2013 04:16:41 +0000 (23:16 -0500)]
When sending integer (int or long in Python) from Python to C, the value will be converted to its type in C (long or long long) as long as there is no overflow. If there is overflow, an exception is raised.

5 years agotests: add test for problem reported by alex susu
Mark Dufour [Tue, 4 Jun 2013 19:52:11 +0000 (21:52 +0200)]
tests: add test for problem reported by alex susu

5 years agoMinor change to the Gh0stenstein example to make it follow PEP8
Ernesto Ferro [Sat, 1 Jun 2013 17:35:07 +0000 (12:35 -0500)]
Minor change to the Gh0stenstein example to make it follow PEP8

5 years agoMoved the functions used in struct_.py to the modules where they are used.
Mark Dufour [Sun, 2 Jun 2013 20:28:21 +0000 (22:28 +0200)]
Moved the functions used in struct_.py to the modules where they are used.

5 years agobump version number to 0.9.4
Mark Dufour [Sun, 2 Jun 2013 19:50:49 +0000 (21:50 +0200)]
bump version number to 0.9.4

5 years agoupdate README
Mark Dufour [Sun, 2 Jun 2013 19:47:52 +0000 (21:47 +0200)]
update README

5 years agonew example: C image processing (Paul Haeberli)
Mark Dufour [Sun, 2 Jun 2013 19:46:04 +0000 (21:46 +0200)]
new example: C image processing (Paul Haeberli)

5 years agoupdate example count as well.. sigh
Mark Dufour [Sun, 2 Jun 2013 19:20:55 +0000 (21:20 +0200)]
update example count as well.. sigh

5 years agonew example: 3D Convex hull
Mark Dufour [Sun, 2 Jun 2013 19:17:04 +0000 (21:17 +0200)]
new example: 3D Convex hull

also update README..

5 years agocomment in top gs_main.py
Mark Dufour [Sat, 1 Jun 2013 11:37:32 +0000 (13:37 +0200)]
comment in top gs_main.py

5 years agoplus fix
Mark Dufour [Sat, 1 Jun 2013 11:29:21 +0000 (13:29 +0200)]
plus fix

5 years agonew wolfenstein-like example: Gh0stenstein! (thanks to Ernesto Ferro)
Mark Dufour [Sat, 1 Jun 2013 11:28:13 +0000 (13:28 +0200)]
new wolfenstein-like example: Gh0stenstein! (thanks to Ernesto Ferro)

5 years agoforgot to remove graph import from cpp
Mark Dufour [Wed, 29 May 2013 21:01:18 +0000 (23:01 +0200)]
forgot to remove graph import from cpp

5 years agoremove final usage of getmv outside of graph module; so setmv in cpp.py can be remove...
Mark Dufour [Wed, 29 May 2013 20:48:11 +0000 (22:48 +0200)]
remove final usage of getmv outside of graph module; so setmv in cpp.py can be removed as well

5 years agofinally, we can remove getmv from typestr.py
Mark Dufour [Wed, 29 May 2013 19:44:03 +0000 (21:44 +0200)]
finally, we can remove getmv from typestr.py

5 years agoextmod.py: work towards removing getmv() from nodetypestr
Mark Dufour [Wed, 29 May 2013 19:24:33 +0000 (21:24 +0200)]
extmod.py: work towards removing getmv() from nodetypestr

5 years agoremove getmv usage from infer.default_var
Mark Dufour [Wed, 29 May 2013 19:14:32 +0000 (21:14 +0200)]
remove getmv usage from infer.default_var

5 years agoremove crazy setmv calls from infer.py
Mark Dufour [Tue, 28 May 2013 20:03:02 +0000 (22:03 +0200)]
remove crazy setmv calls from infer.py

5 years agoRemoved the global variable gx (GlobalInfo)
Ernesto Ferro [Sat, 25 May 2013 23:45:46 +0000 (18:45 -0500)]
Removed the global variable gx (GlobalInfo)

5 years agoPart of the logic in copy_ was only used in cpp.py and the rest was only used in...
Ernesto Ferro [Sat, 25 May 2013 20:02:19 +0000 (15:02 -0500)]
Part of the logic in copy_ was only used in cpp.py and the rest was only used in infer.py. I moved those functions to the files in which they are used

5 years agoadd sudo to the shedkin install line in README
elmasry [Fri, 24 May 2013 22:16:34 +0000 (00:16 +0200)]
add sudo to the shedkin install line in README

5 years agoremove graph import from extmod.py
Mark Dufour [Mon, 20 May 2013 20:23:15 +0000 (22:23 +0200)]
remove graph import from extmod.py

5 years agofinally, we can remove the graph import from python.py
Mark Dufour [Mon, 20 May 2013 20:16:11 +0000 (22:16 +0200)]
finally, we can remove the graph import from python.py

5 years agopython.py: avoid getmv in def_class
Mark Dufour [Mon, 20 May 2013 19:44:40 +0000 (21:44 +0200)]
python.py: avoid getmv in def_class

5 years agoannotate.py: improve things further so setmv is not necessary
Mark Dufour [Mon, 20 May 2013 19:16:40 +0000 (21:16 +0200)]
annotate.py: improve things further so setmv is not necessary

5 years agocpp.py, annotate.py: avoid about 100 usages of getmv()
Mark Dufour [Mon, 20 May 2013 18:45:11 +0000 (20:45 +0200)]
cpp.py, annotate.py: avoid about 100 usages of getmv()

5 years agostruct_.py: avoid graph import, by locally passing mv
Mark Dufour [Mon, 20 May 2013 17:10:31 +0000 (19:10 +0200)]
struct_.py: avoid graph import, by locally passing mv

5 years agopython.py: lessen dependency on graph.py import
Mark Dufour [Sat, 18 May 2013 14:42:11 +0000 (16:42 +0200)]
python.py: lessen dependency on graph.py import

5 years agoCPPnamer: merge some things
Mark Dufour [Sat, 18 May 2013 13:36:54 +0000 (15:36 +0200)]
CPPnamer: merge some things

5 years agoand one more
Mark Dufour [Sat, 18 May 2013 12:39:06 +0000 (14:39 +0200)]
and one more

5 years agofix next case
Mark Dufour [Sat, 18 May 2013 11:37:18 +0000 (13:37 +0200)]
fix next case

5 years agoavoid some use of CPPNamer.name_str
Mark Dufour [Sat, 18 May 2013 11:13:03 +0000 (13:13 +0200)]
avoid some use of CPPNamer.name_str

5 years agopython.py: merge lookup_var with def_var. separate out var creation.
Mark Dufour [Fri, 17 May 2013 20:03:15 +0000 (22:03 +0200)]
python.py: merge lookup_var with def_var. separate out var creation.

5 years agofinally, we can remove the infer import from python.py
Mark Dufour [Fri, 17 May 2013 19:16:19 +0000 (21:16 +0200)]
finally, we can remove the infer import from python.py

5 years agopython.py: split def_var into a lookup and 'infer' part. move the latter out of pytho...
Mark Dufour [Fri, 17 May 2013 18:56:23 +0000 (20:56 +0200)]
python.py: split def_var into a lookup and 'infer' part. move the latter out of python.py.

5 years agoCPPNamer: improve 'init'/'add' check, simplify name_str
Mark Dufour [Thu, 16 May 2013 19:41:27 +0000 (21:41 +0200)]
CPPNamer: improve 'init'/'add' check, simplify name_str

5 years agoadd test for 'init'/'add'+main_module.ident named variables in extmods
Mark Dufour [Thu, 16 May 2013 19:11:37 +0000 (21:11 +0200)]
add test for 'init'/'add'+main_module.ident named variables in extmods

5 years agoMoved all the cpp naming logic to its own class
Ernesto Ferro [Wed, 15 May 2013 23:19:00 +0000 (18:19 -0500)]
Moved all the cpp naming logic to its own class

5 years agoannotate.py: some minor cleanups
Mark Dufour [Wed, 15 May 2013 15:14:43 +0000 (17:14 +0200)]
annotate.py: some minor cleanups

5 years agofinally, rename 'hmcpa' to something sensible. also simplify it and move some stuff...
Mark Dufour [Tue, 14 May 2013 21:29:38 +0000 (23:29 +0200)]
finally, rename 'hmcpa' to something sensible. also simplify it and move some stuff around
 Please enter the commit message for your changes. Lines starting

5 years agoclass Bitpair in cpp.py looks crufty, remove it
Mark Dufour [Tue, 14 May 2013 19:15:49 +0000 (21:15 +0200)]
class Bitpair in cpp.py looks crufty, remove it

5 years agomove find_module and some smaller funcs to python.py
Mark Dufour [Tue, 14 May 2013 18:53:44 +0000 (20:53 +0200)]
move find_module and some smaller funcs to python.py

5 years agomove function that has nothing to do with python to cpp.py, so we can remove the...
Mark Dufour [Sun, 12 May 2013 19:02:12 +0000 (21:02 +0200)]
move function that has nothing to do with python to cpp.py, so we can remove the ugly typestr import

5 years agoStaticClass: remove some unused attributes
Mark Dufour [Sun, 12 May 2013 18:40:15 +0000 (20:40 +0200)]
StaticClass: remove some unused attributes

5 years agopython.py: finally, rename class_ to Class
Mark Dufour [Sun, 12 May 2013 11:51:11 +0000 (13:51 +0200)]
python.py: finally, rename class_ to Class

5 years agoimport Class as ClassNode also in cpp.py
Mark Dufour [Sun, 12 May 2013 11:29:51 +0000 (13:29 +0200)]
import Class as ClassNode also in cpp.py

5 years agograph.py: import Class as ClassNode, in preparation of renaming class_ to Class
Mark Dufour [Sun, 12 May 2013 09:38:41 +0000 (11:38 +0200)]
graph.py: import Class as ClassNode, in preparation of renaming class_ to Class

5 years agoMassive reorganization of the functions and class in shared.py different modules.
Ernesto Ferro [Sat, 11 May 2013 07:29:44 +0000 (02:29 -0500)]
Massive reorganization of the functions and class in shared.py different modules.

This is rather big commit because it wasn't possible to break it down into smaller pieces due to their interrelations (circular dependencies)

Also, the order of the functions and classes within some modules has changed in order to group similar functions/classes.

This are the modules where the functions/classes have been moved:
    python.py:
        Variable
        Function
        Module
        Class
        StaticClass
        default_var
        def_var
        register_temp_var
        def_class
        lookup_var
        lookup_variable
        lookup_module
        lookup_class
        lookup_func
        lookup_class_module
        lookup_implementor
        subclass
        is_method
        is_enum
        is_zip2
        is_fastfor
        is_literal
        is_property_setter
        assign_rec
        aug_msg

    infer.py:
        CNode
        add_to_worklist
        in_out
        add_constraint
        inode
        merged
        analyze_callfunc
        callfunc_targets
        connect_actual_formal
        analyze_args
        parent_func
        is_anon_callable
        get_types
        hmcpa
        nrargs

    types.py:
        lowest_common_parents
        polymorphic_cl
        polymorphic_t
        singletype
        singletype2
        unboxable
        types_classes
        types_var_types

    cpp.py:
        nokeywords
        namespaceclass

5 years agoMoved the following functions/classes from shared.py to graph.ph FakeGetattr FakeGeta...
Ernesto Ferro [Fri, 10 May 2013 23:48:34 +0000 (18:48 -0500)]
Moved the following functions/classes from shared.py to graph.ph FakeGetattr FakeGetattr2 FakeGetattr3 getmv setmv

5 years agoMoved the following functions/classes from shared.py to error.py error format_error...
Ernesto Ferro [Fri, 10 May 2013 23:38:49 +0000 (18:38 -0500)]
Moved the following functions/classes from shared.py to error.py error format_error print_errors

5 years agoprevious patch forgot to add config.py
Mark Dufour [Sun, 12 May 2013 07:49:11 +0000 (09:49 +0200)]
previous patch forgot to add config.py

5 years agoMoved the following functions/classes from shared.py to config.py GlobalInfo newgx...
Ernesto Ferro [Fri, 10 May 2013 23:07:06 +0000 (18:07 -0500)]
Moved the following functions/classes from shared.py to config.py GlobalInfo newgx getgx setgx

5 years agoRenamed the following functions: from fastfor to is_fastfor from const_literal to...
Ernesto Ferro [Fri, 10 May 2013 22:56:10 +0000 (17:56 -0500)]
Renamed the following functions: from fastfor to is_fastfor from const_literal to is_literal from property_setter to is_property_setter

5 years agoshared.py: is_listcomp unused
Ernesto Ferro [Fri, 10 May 2013 07:51:26 +0000 (09:51 +0200)]
shared.py: is_listcomp unused

5 years agofix corner case, removing the last element of a list while changing the list (reporte...
Mark Dufour [Sun, 5 May 2013 15:30:58 +0000 (17:30 +0200)]
fix corner case, removing the last element of a list while changing the list (reported by akatopaz)

5 years agodon't warn about incorrect argument count for builtins for now, as this is a bit...
Mark Dufour [Sat, 4 May 2013 17:53:59 +0000 (19:53 +0200)]
don't warn about incorrect argument count for builtins for now, as this is a bit trickier

5 years agofix problem with default args and inheritance (reported by paul haeberli)
Mark Dufour [Sat, 4 May 2013 17:42:11 +0000 (19:42 +0200)]
fix problem with default args and inheritance (reported by paul haeberli)

5 years agodon't warn about None being mix with functions
Mark Dufour [Mon, 29 Apr 2013 15:26:48 +0000 (17:26 +0200)]
don't warn about None being mix with functions

5 years agonot sure why this check disappeared; add test this time
Mark Dufour [Mon, 29 Apr 2013 13:55:54 +0000 (15:55 +0200)]
not sure why this check disappeared; add test this time

5 years agoinclude function references in dynamic typing warnings
Mark Dufour [Mon, 29 Apr 2013 12:53:18 +0000 (14:53 +0200)]
include function references in dynamic typing warnings

5 years agofix warning/error tests (python run.py -x)
Mark Dufour [Mon, 29 Apr 2013 11:31:31 +0000 (13:31 +0200)]
fix warning/error tests (python run.py -x)

5 years agotype inference: improve wholesale splitting by merging creating sites on the same...
Mark Dufour [Sun, 28 Apr 2013 20:52:25 +0000 (22:52 +0200)]
type inference: improve wholesale splitting by merging creating sites on the same path

5 years agotests: type inference bug uncovered by C64 SVN
Mark Dufour [Sun, 28 Apr 2013 17:27:22 +0000 (19:27 +0200)]
tests: type inference bug uncovered by C64 SVN

5 years agoChanged the testprogs.py script to using the module multiprocessing.
Ernesto Ferro [Sat, 27 Apr 2013 18:47:07 +0000 (13:47 -0500)]
Changed the testprogs.py script to using the module multiprocessing.

It's not customizable like tests/run.py, but in this one there is no conflict between the tests. And unlike tests/run.py, the output is shown, but only after the test has finished. This means that the output is not shown in "real time", but rather as whole after the test is completed

5 years agoFix: For the absolute paths at least, first search using the builtin directories...
Ernesto Ferro [Sat, 27 Apr 2013 17:53:35 +0000 (12:53 -0500)]
Fix: For the absolute paths at least, first search using the builtin directories (I might simplify this in the future)

5 years agoimprove checks in redirection during inference, fixing test 201
Mark Dufour [Sat, 27 Apr 2013 19:42:15 +0000 (21:42 +0200)]
improve checks in redirection during inference, fixing test 201

5 years agolet's add a small test for this, even though it's not really supported
Mark Dufour [Sat, 27 Apr 2013 17:36:45 +0000 (19:36 +0200)]
let's add a small test for this, even though it's not really supported

5 years agoavoid crash on class passing
Mark Dufour [Sat, 27 Apr 2013 17:29:15 +0000 (19:29 +0200)]
avoid crash on class passing

5 years agoChanged some method and functions from names like wordandword to word_and_word. The...
Ernesto Ferro [Mon, 22 Apr 2013 01:52:43 +0000 (20:52 -0500)]
Changed some method and functions from names like wordandword to word_and_word. The only expections are visitSomething since those overwrite the method from ASTVisitor

5 years agoUsing CamelCase for all the classes names.
Ernesto Ferro [Sun, 21 Apr 2013 22:26:10 +0000 (17:26 -0500)]
Using CamelCase for all the classes names.

The only exception (and is subjective) is class_ since that one has to match the one in builtins.py. And since all of the builtin classes are in lowercase, I decided to leave it as class_ and not Class.

Another consequence of this is that the class that used to be called "function" and now is "Function" collides with the other class called "Function" from compiler.ast.
To solve this conflict I'm importing Function from compiler.ast as FunctionNode

5 years agotests/201: method called 'set'; add similar cases later
Mark Dufour [Sat, 27 Apr 2013 08:41:42 +0000 (10:41 +0200)]
tests/201: method called 'set'; add similar cases later

5 years agomakefile: fix forward/backslash inconsistency under windows
Mark Dufour [Wed, 24 Apr 2013 16:09:57 +0000 (18:09 +0200)]
makefile: fix forward/backslash inconsistency under windows

5 years agoBug fix: The current folder should always be in the paths where the modules are searc...
Ernesto Ferro [Sat, 20 Apr 2013 22:52:15 +0000 (17:52 -0500)]
Bug fix: The current folder should always be in the paths where the modules are searched. The priority is: [localfolder, parent's folder, sys lib]

5 years agoRefactored the function parse_module and the class Module to rely on the module imp...
Ernesto Ferro [Sat, 20 Apr 2013 17:08:42 +0000 (12:08 -0500)]
Refactored the function parse_module and the class Module to rely on the module imp to find the filename of the module. Based on that filename and the import path, the absolute module name and if the module is a built-in module is calculated.

5 years agovirtual function: merge parent args as well, or we may lose types
Mark Dufour [Sat, 20 Apr 2013 15:13:50 +0000 (17:13 +0200)]
virtual function: merge parent args as well, or we may lose types

5 years agorandom.vonmisesvariate changed in 2.7.4
Mark Dufour [Sat, 20 Apr 2013 14:50:11 +0000 (16:50 +0200)]
random.vonmisesvariate changed in 2.7.4

5 years agoI forgot to remove a line of code that I was using to test the -f option with multipr...
Ernesto Ferro [Sun, 7 Apr 2013 22:58:31 +0000 (17:58 -0500)]
I forgot to remove a line of code that I was using to test the -f option with multiprocessing

5 years agoAdded the -p option to run the testing using as many cores as possible. When this...
Ernesto Ferro [Sun, 7 Apr 2013 22:27:54 +0000 (00:27 +0200)]
Added the -p option to run the testing using as many cores as possible. When this is activated, the output of each process is ignored.

5 years agoRan autopep8 on run.py
Ernesto Ferro [Sun, 7 Apr 2013 22:20:30 +0000 (00:20 +0200)]
Ran autopep8 on run.py

5 years agotests/run.py -n: skip import check in case of SystemExit (reported by Ernesto Ferro)
Mark Dufour [Sat, 6 Apr 2013 22:42:11 +0000 (00:42 +0200)]
tests/run.py -n: skip import check in case of SystemExit (reported by Ernesto Ferro)

5 years agoRan autopep8 in order to comply with PEP8.
Ernesto Ferro [Fri, 5 Apr 2013 03:48:16 +0000 (22:48 -0500)]
Ran autopep8 in order to comply with PEP8.

The final result is generally accepted to be more readable

5 years agoExpanded imports "from XXX import *" to "from XXX import X, Y, Z"
Ernesto Ferro [Fri, 5 Apr 2013 02:48:37 +0000 (21:48 -0500)]
Expanded imports "from XXX import *" to "from XXX import X, Y, Z"

5 years agoRemoved unused function relative_path
Ernesto Ferro [Wed, 3 Apr 2013 22:20:10 +0000 (17:20 -0500)]
Removed unused function relative_path

5 years agoReplaced the function connect_paths with os.path.join
Ernesto Ferro [Wed, 3 Apr 2013 22:19:43 +0000 (17:19 -0500)]
Replaced the function connect_paths with os.path.join

5 years agookay I still suck with git, revert last patch for now
Mark Dufour [Sat, 6 Apr 2013 20:39:46 +0000 (22:39 +0200)]
okay I still suck with git, revert last patch for now

5 years agoRemoved unused function relative_path
Ernesto Ferro [Sat, 6 Apr 2013 20:29:02 +0000 (22:29 +0200)]
Removed unused function relative_path

5 years agoRemoved trailing spaces
Ernesto Ferro [Wed, 3 Apr 2013 22:13:52 +0000 (17:13 -0500)]
Removed trailing spaces

5 years agoplus test
Mark Dufour [Thu, 21 Mar 2013 20:10:31 +0000 (21:10 +0100)]
plus test

5 years agoWhen removing the commented code between {# and #}, we should also include all the...
Ernesto Ferro [Thu, 21 Mar 2013 01:59:26 +0000 (20:59 -0500)]
When removing the commented code between {# and #}, we should also include all the charaters between #} and the next newline Example: Commented code

5 years agomake __to_py__ virtual to better support inheritance
Ernesto Ferro [Sat, 9 Mar 2013 19:23:00 +0000 (20:23 +0100)]
make __to_py__ virtual to better support inheritance