-
Notifications
You must be signed in to change notification settings - Fork 67
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
Valq7711 fix imports all #195
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now, `from package import module` is supported!
Now, it is possible in package modules: # just_dir/pack/baz.pyj import .foo, .bar # will expanded to: import pack.foo as foo, pack.bar as bar from .mod import fun # will expanded to: from pack.mod import fun
`__init__` should go after package submodules
@atsepkov Hi Alexander! |
import improvements # now supported:
# assume classFoo, funBar are defined in package/__init__.pyj
from package import classFoo, moduleA, moduleB, funBar
# suppose there is a package:
# foo/
# |_ __init__.pyj
# |_ bar.pyj
# |_ baz.pyj
# in modules you can:
#foo/bar.pyj
import .baz
# or
from .baz import some_fun, some_var
#foo/__init__.pyj
import .bar
from .baz import some_fun
|
valq7711
added a commit
to valq7711/RapydScript
that referenced
this pull request
Sep 25, 2019
* fix parser's readfile default option value * fix ObjectLiteral.resolveType (Related to issue#140) bugs are fixed: ``` h = {a: None, b: 123} # - causes an error because of the trying expected.indexOf("Function"), but expected==null h = {a: None, b: None} # - is resolved to '{String:null}' - deadlock hash! '{String:?}' is more suitable, isn't it? h = {a: def(): ...; , b: def(x): ...;, c: 123} # - is resolved to '{String:Function}', because of the premature return without checking the remaining elements ``` * removing extra spaces * fix issue atsepkov#154 * fix pollution by `chr` * improve browser integration * improve browser integration * change `this` to `parent` My bad! `this` is undefined when "use strict;" * Update rapydscript.pyj * Add test of class extends mod.class There is es6 bug * Improved readability * add some complexity;) * fix import * small fixes (atsepkov#178) * add `getOwnPropertyDescriptor(s)` * fix js_error add filename * improve traceback on errors (atsepkov#179) * Update test.pyj (atsepkov#181) * fix In-browser-compilation (atsepkov#174) In-browser-compilation the embedded baselib string is used instead of parsing a file, so `toplevel.baselib['...']>0` if only it is used in user code * fix super (atsepkov#180) * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Create classes_es6.pyj * Update test.pyj * superCall -> superCall_expr * Update README.md (atsepkov#183) * Valq7711 patch fix yield (atsepkov#184) * fix yield now OK: - `a = yield` - `yield from [1,2,3]` - `yield 1, 3, 4` # turns into yield [1, 3, 4] as `return 1 ,3, 4` * add init_mod() add init_mod() to allow reinitialize all static object * Update rapydscript.pyj * Update rapydscript.pyj * improve in-browser usage * Update parser.pyj * Update parser.pyj * fix generator as class method (atsepkov#185) * fix generator as class method * Update output.pyj * keep parentheses around yield * keep parentheses around yield * parentheses around yield * parentheses around yield * added support for sets in iterable logic * implemented sets and fixed deep equality * tweaked rounding error for travis * dropping support for old versions of node * further travis node version bump * fixed math test by using epsilon comparisons * added date support to equality operator * Extend ImportError Improve traceback for import errors * Update parser.pyj * Update imports.pyj * Update imports.pyj * Delete .DS_Store * Update .gitignore * fix mixin * fix merge/mixin * fix mixin/merge add test * check if `require` exists (atsepkov#196) * fix `eq` (atsepkov#197) * Valq7711 fix imports all (atsepkov#195) see comment * fix typo
valq7711
added a commit
to valq7711/RapydScript
that referenced
this pull request
Sep 25, 2019
* fix parser's readfile default option value * fix ObjectLiteral.resolveType (Related to issue#140) bugs are fixed: ``` h = {a: None, b: 123} # - causes an error because of the trying expected.indexOf("Function"), but expected==null h = {a: None, b: None} # - is resolved to '{String:null}' - deadlock hash! '{String:?}' is more suitable, isn't it? h = {a: def(): ...; , b: def(x): ...;, c: 123} # - is resolved to '{String:Function}', because of the premature return without checking the remaining elements ``` * removing extra spaces * fix issue atsepkov#154 * fix pollution by `chr` * improve browser integration * improve browser integration * change `this` to `parent` My bad! `this` is undefined when "use strict;" * Update rapydscript.pyj * Add test of class extends mod.class There is es6 bug * Improved readability * add some complexity;) * fix import * small fixes (atsepkov#178) * add `getOwnPropertyDescriptor(s)` * fix js_error add filename * improve traceback on errors (atsepkov#179) * Update test.pyj (atsepkov#181) * fix In-browser-compilation (atsepkov#174) In-browser-compilation the embedded baselib string is used instead of parsing a file, so `toplevel.baselib['...']>0` if only it is used in user code * fix super (atsepkov#180) * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Create classes_es6.pyj * Update test.pyj * superCall -> superCall_expr * Update README.md (atsepkov#183) * Valq7711 patch fix yield (atsepkov#184) * fix yield now OK: - `a = yield` - `yield from [1,2,3]` - `yield 1, 3, 4` # turns into yield [1, 3, 4] as `return 1 ,3, 4` * add init_mod() add init_mod() to allow reinitialize all static object * Update rapydscript.pyj * Update rapydscript.pyj * improve in-browser usage * Update parser.pyj * Update parser.pyj * fix generator as class method (atsepkov#185) * fix generator as class method * Update output.pyj * keep parentheses around yield * keep parentheses around yield * parentheses around yield * parentheses around yield * added support for sets in iterable logic * implemented sets and fixed deep equality * tweaked rounding error for travis * dropping support for old versions of node * further travis node version bump * fixed math test by using epsilon comparisons * added date support to equality operator * Extend ImportError Improve traceback for import errors * Update parser.pyj * Update imports.pyj * Update imports.pyj * Delete .DS_Store * Update .gitignore * fix mixin * fix merge/mixin * fix mixin/merge add test * check if `require` exists (atsepkov#196) * fix `eq` (atsepkov#197) * Valq7711 fix imports all (atsepkov#195) see comment * fix typo
valq7711
added a commit
to valq7711/RapydScript
that referenced
this pull request
Sep 25, 2019
* fix parser's readfile default option value * fix ObjectLiteral.resolveType (Related to issue#140) bugs are fixed: ``` h = {a: None, b: 123} # - causes an error because of the trying expected.indexOf("Function"), but expected==null h = {a: None, b: None} # - is resolved to '{String:null}' - deadlock hash! '{String:?}' is more suitable, isn't it? h = {a: def(): ...; , b: def(x): ...;, c: 123} # - is resolved to '{String:Function}', because of the premature return without checking the remaining elements ``` * removing extra spaces * fix issue atsepkov#154 * fix pollution by `chr` * improve browser integration * improve browser integration * change `this` to `parent` My bad! `this` is undefined when "use strict;" * Update rapydscript.pyj * Add test of class extends mod.class There is es6 bug * Improved readability * add some complexity;) * fix import * small fixes (atsepkov#178) * add `getOwnPropertyDescriptor(s)` * fix js_error add filename * improve traceback on errors (atsepkov#179) * Update test.pyj (atsepkov#181) * fix In-browser-compilation (atsepkov#174) In-browser-compilation the embedded baselib string is used instead of parsing a file, so `toplevel.baselib['...']>0` if only it is used in user code * fix super (atsepkov#180) * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Create classes_es6.pyj * Update test.pyj * superCall -> superCall_expr * Update README.md (atsepkov#183) * Valq7711 patch fix yield (atsepkov#184) * fix yield now OK: - `a = yield` - `yield from [1,2,3]` - `yield 1, 3, 4` # turns into yield [1, 3, 4] as `return 1 ,3, 4` * add init_mod() add init_mod() to allow reinitialize all static object * Update rapydscript.pyj * Update rapydscript.pyj * improve in-browser usage * Update parser.pyj * Update parser.pyj * fix generator as class method (atsepkov#185) * fix generator as class method * Update output.pyj * keep parentheses around yield * keep parentheses around yield * parentheses around yield * parentheses around yield * added support for sets in iterable logic * implemented sets and fixed deep equality * tweaked rounding error for travis * dropping support for old versions of node * further travis node version bump * fixed math test by using epsilon comparisons * added date support to equality operator * Extend ImportError Improve traceback for import errors * Update parser.pyj * Update imports.pyj * Update imports.pyj * Delete .DS_Store * Update .gitignore * fix mixin * fix merge/mixin * fix mixin/merge add test * check if `require` exists (atsepkov#196) * fix `eq` (atsepkov#197) * Valq7711 fix imports all (atsepkov#195) see comment * fix typo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.