Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1319)

Issue 6033051: Module import (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by arv
Modified:
12 years, 1 month ago
CC:
traceur-compiler-reviews_googlegroups.com
Base URL:
https://code.google.com/p/traceur-compiler@master
Visibility:
Public.

Description

Module import Works with local modules and standard modules. import iterator from '@iter'; module m { export var x = 42; } import {x: renamed} from m; import * is done by associating the module expression with the tree during the ImportStarVisitor phase. Once we get to the tranformation phase we get the module symbol and we know what it exports. import * from '@name'; BUG=http://code.google.com/p/traceur-compiler/issues/detail?id=26 TEST=feature/Modules/* Committed: https://code.google.com/p/traceur-compiler/source/detail?r=f4f8788

Patch Set 1 #

Patch Set 2 : cleanup #

Total comments: 21

Patch Set 3 : Extracted ErrorReporter.format, extracted expected errors and applied feedback from Alex and John #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+423 lines, -161 lines) Patch
M example/collection.html View 1 chunk +1 line, -2 lines 0 comments Download
M src/codegeneration/ModuleTransformer.js View 1 2 10 chunks +132 lines, -65 lines 2 comments Download
M src/codegeneration/ProgramTransformer.js View 1 chunk +2 lines, -1 line 0 comments Download
M src/codegeneration/module/ExportVisitor.js View 2 chunks +1 line, -3 lines 0 comments Download
A src/codegeneration/module/ImportStarVisitor.js View 1 chunk +55 lines, -0 lines 0 comments Download
M src/codegeneration/module/ModuleVisitor.js View 1 2 7 chunks +23 lines, -16 lines 0 comments Download
M src/codegeneration/module/ValidationVisitor.js View 4 chunks +19 lines, -11 lines 0 comments Download
M src/outputgeneration/ParseTreeWriter.js View 1 chunk +7 lines, -0 lines 0 comments Download
M src/runtime/modules.js View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M src/semantics/ModuleAnalyzer.js View 2 chunks +3 lines, -2 lines 0 comments Download
M src/semantics/symbols/Project.js View 1 2 4 chunks +39 lines, -1 line 0 comments Download
M src/semantics/symbols/Symbol.js View 1 chunk +0 lines, -7 lines 0 comments Download
M src/syntax/ParseTreeVisitor.js View 1 chunk +7 lines, -0 lines 0 comments Download
M src/syntax/Parser.js View 2 chunks +5 lines, -2 lines 0 comments Download
M src/traceur.js View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/util/url.js View 1 chunk +3 lines, -0 lines 0 comments Download
M test/feature/Collection/ArrayLike.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/feature/Collection/Call.js View 1 chunk +3 lines, -2 lines 0 comments Download
M test/feature/Collection/Simple.js View 1 chunk +2 lines, -2 lines 0 comments Download
A test/feature/Modules/Error_MissingExport.js View 1 chunk +28 lines, -0 lines 0 comments Download
A test/feature/Modules/ImportFromLocalModule.js View 1 chunk +18 lines, -0 lines 0 comments Download
A test/feature/Modules/ImportFromLocalModuleStar.js View 1 chunk +7 lines, -0 lines 0 comments Download
A test/feature/Modules/ImportFromStandardLibrary.js View 1 chunk +15 lines, -0 lines 0 comments Download
A test/feature/Modules/ImportFromStandardLibraryStar.js View 1 chunk +4 lines, -0 lines 0 comments Download
M test/feature/PrivateNames/Inherited.js View 1 chunk +1 line, -1 line 0 comments Download
M test/feature/PrivateNames/Name.js View 1 chunk +9 lines, -9 lines 0 comments Download
M test/feature/PrivateNames/Object.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/feature/Yield/Tree.js View 1 chunk +1 line, -1 line 0 comments Download
M test/feature/feature_test.html View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M test/unit/codegeneration/module_transformer_test.html View 1 2 8 chunks +23 lines, -32 lines 0 comments Download

Messages

Total messages: 8
arv
Hi Chris, I'm not sure if you still are interested in this. I thought I ...
12 years, 1 month ago (2012-04-15 22:54:12 UTC) #1
cburrows
On 2012/04/15 22:54:12, arv-chromium wrote: > Hi Chris, > > I'm not sure if you ...
12 years, 1 month ago (2012-04-16 06:04:56 UTC) #2
slightlylate
https://codereview.appspot.com/6033051/diff/1035/src/codegeneration/ModuleTransformer.js File src/codegeneration/ModuleTransformer.js (right): https://codereview.appspot.com/6033051/diff/1035/src/codegeneration/ModuleTransformer.js#newcode150 src/codegeneration/ModuleTransformer.js:150: this.project = project; is this meant to be this.project_? ...
12 years, 1 month ago (2012-04-16 12:48:29 UTC) #3
johnjbarton
Cool, now I am anxious to try this out. https://codereview.appspot.com/6033051/diff/1035/demo/repl.html File demo/repl.html (right): https://codereview.appspot.com/6033051/diff/1035/demo/repl.html#newcode152 demo/repl.html:152: ...
12 years, 1 month ago (2012-04-16 16:48:41 UTC) #4
arv
https://codereview.appspot.com/6033051/diff/1035/demo/repl.html File demo/repl.html (right): https://codereview.appspot.com/6033051/diff/1035/demo/repl.html#newcode152 demo/repl.html:152: ErrorReporter.format(location, format, args) + '\n'; On 2012/04/16 16:48:42, johnjbarton ...
12 years, 1 month ago (2012-04-16 16:53:23 UTC) #5
arv
https://codereview.appspot.com/6033051/diff/1035/demo/repl.html File demo/repl.html (right): https://codereview.appspot.com/6033051/diff/1035/demo/repl.html#newcode152 demo/repl.html:152: ErrorReporter.format(location, format, args) + '\n'; On 2012/04/16 16:53:23, arv-chromium ...
12 years, 1 month ago (2012-04-17 04:18:22 UTC) #6
slightlylate
LGTM https://codereview.appspot.com/6033051/diff/9001/src/codegeneration/ModuleTransformer.js File src/codegeneration/ModuleTransformer.js (right): https://codereview.appspot.com/6033051/diff/9001/src/codegeneration/ModuleTransformer.js#newcode70 src/codegeneration/ModuleTransformer.js:70: function toBindingIdentifier(tree) { Seems strange to me that ...
12 years, 1 month ago (2012-04-17 11:45:27 UTC) #7
arv
12 years, 1 month ago (2012-04-17 16:33:49 UTC) #8
https://codereview.appspot.com/6033051/diff/9001/src/codegeneration/ModuleTra...
File src/codegeneration/ModuleTransformer.js (right):

https://codereview.appspot.com/6033051/diff/9001/src/codegeneration/ModuleTra...
src/codegeneration/ModuleTransformer.js:70: function toBindingIdentifier(tree) {
On 2012/04/17 11:45:27, slightlylate wrote:
> Seems strange to me that this isn't a method of the tree object?

Agreed. ParseTree objects don't have methods. I think another option would be to
move it to ParseTreeFactory at least.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b