This commit is contained in:
Pavel Talanov
2011-11-03 20:45:10 +04:00
parent 98c461a435
commit 0e82ff14a8
53 changed files with 842 additions and 1187 deletions
+9
View File
@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="junit">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/junit-4.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
-11
View File
@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib" />
<root url="file://$PROJECT_DIR$/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
</library>
</component>
Generated
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
+416 -294
View File
@@ -5,7 +5,43 @@
<option name="SCOPE_TYPE" value="4" />
</component>
<component name="ChangeListManager">
<list default="true" id="f02ef53d-47a4-4f5e-a1aa-3df68aae9b20" name="Default" comment="" />
<list default="true" id="f02ef53d-47a4-4f5e-a1aa-3df68aae9b20" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/junit-4.10.jar" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/libraries/junit.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/org/jetbrains/k2js/test/TranslatorTests.java" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test_files/test_cases/assign.jet" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test_files/test_cases/localProperty.jet" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test_files/test_cases/test.kt" />
<change type="DELETED" beforePath="C:\Dev\Projects\jet-contrib\k2js\.idea\libraries\lib.xml" afterPath="" />
<change type="DELETED" beforePath="C:\Dev\Projects\jet-contrib\k2js\out\production\k2js\org\jetbrains\k2js\translate\jet\Library.jet" afterPath="" />
<change type="DELETED" beforePath="C:\Dev\Projects\jet-contrib\k2js\out\test\k2js\com\google\dart\compiler\backend\js\Test.class" afterPath="" />
<change type="DELETED" beforePath="C:\Dev\Projects\jet-contrib\k2js\test\com\google\dart\compiler\backend\js\Test.java" afterPath="" />
<change type="DELETED" beforePath="C:\Dev\Projects\jet-contrib\k2js\test_files\test.kt" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/vcs.xml" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/k2js.iml" afterPath="$PROJECT_DIR$/k2js.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/JsNamer.java" afterPath="$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/JsNamer.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.java" afterPath="$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/google/dart/compiler/common/Name.java" afterPath="$PROJECT_DIR$/src/com/google/dart/compiler/common/Name.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/google/dart/compiler/util/AstUtil.java" afterPath="$PROJECT_DIR$/src/com/google/dart/compiler/util/AstUtil.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/google/dart/compiler/util/Lists.java" afterPath="$PROJECT_DIR$/src/com/google/dart/compiler/util/Lists.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/google/dart/compiler/util/Maps.java" afterPath="$PROJECT_DIR$/src/com/google/dart/compiler/util/Maps.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/K2JSTranslator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/K2JSTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/generate/CodeGenerator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/generate/CodeGenerator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/AbstractTranslator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/AbstractTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassTranslator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ContextType.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ContextType.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/DeclarationTranslator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/DeclarationTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionTranslator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/FunctionTranslator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/FunctionTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/K2JsVisitor.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/K2JsVisitor.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/Namer.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/Namer.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/NamespaceTranslator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/NamespaceTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/OperationTranslator.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/OperationTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/TranslationContext.java" afterPath="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/TranslationContext.java" />
</list>
<ignored path="k2js.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
@@ -29,7 +65,7 @@
</component>
<component name="DebuggerManager">
<line_breakpoints>
<breakpoint url="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/DeclarationTranslator.java" line="27" class="org.jetbrains.k2js.translate.DeclarationTranslator" package="org.jetbrains.k2js.translate">
<breakpoint url="file://$PROJECT_DIR$/test/org/jetbrains/k2js/test/TranslatorTests.java" line="37" class="org.jetbrains.k2js.test.TranslatorTests" package="org.jetbrains.k2js.test">
<option name="ENABLED" value="true" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
@@ -82,22 +118,13 @@
<favorites_list name="k2js" />
</component>
<component name="FileEditorManager">
<splitter split-orientation="horizontal" split-proportion="0.61738">
<splitter split-orientation="horizontal" split-proportion="0.29155123">
<split-first>
<leaf>
<file leaf-file-name="BindingContext.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java">
<file leaf-file-name="TranslatorTests.java" pinned="false" current="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/test/org/jetbrains/k2js/test/TranslatorTests.java">
<provider selected="true" editor-type-id="text-editor">
<state line="49" column="30" selection-start="3469" selection-end="3469" vertical-scroll-proportion="-5.923077">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ClassTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="29" column="10" selection-start="1105" selection-end="1105" vertical-scroll-proportion="0.0">
<state line="57" column="16" selection-start="1910" selection-end="1910" vertical-scroll-proportion="0.97495526">
<folding>
<element signature="imports" expanded="true" />
</folding>
@@ -105,77 +132,82 @@
</provider>
</entry>
</file>
<file leaf-file-name="MutableClassDescriptor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor.java">
<file leaf-file-name="JsVisitor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/ast/JsVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="272" column="0" selection-start="10394" selection-end="10394" vertical-scroll-proportion="0.0">
<state line="429" column="0" selection-start="8829" selection-end="8829" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JetClass.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java">
<file leaf-file-name="JsToStringGenerationVisitor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="14" column="13" selection-start="328" selection-end="328" vertical-scroll-proportion="0.0">
<state line="236" column="0" selection-start="8269" selection-end="8269" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ClassDescriptor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/ClassDescriptor.java">
<file leaf-file-name="IElementType.class" pinned="false" current="false" current-in-tab="false">
<entry file="jar://C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 110.283/lib/openapi.jar!/com/intellij/psi/tree/IElementType.class">
<provider selected="true" editor-type-id="text-editor">
<state line="25" column="8" selection-start="784" selection-end="784" vertical-scroll-proportion="0.0">
<state line="5" column="13" selection-start="159" selection-end="159" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JetType.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/types/JetType.java">
<file leaf-file-name="ParentRunner.class" pinned="false" current="false" current-in-tab="false">
<entry file="jar://C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 110.240/lib/junit-4.10.jar!/org/junit/runners/ParentRunner.class">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="17" selection-start="271" selection-end="271" vertical-scroll-proportion="0.0">
<state line="49" column="16" selection-start="2839" selection-end="2839" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="DeclarationDescriptor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.java">
<file leaf-file-name="JUnitCore.class" pinned="false" current="false" current-in-tab="false">
<entry file="jar://C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 110.240/lib/junit-4.10.jar!/org/junit/runner/JUnitCore.class">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="17" selection-start="294" selection-end="294" vertical-scroll-proportion="0.0">
<state line="30" column="35" selection-start="1439" selection-end="1439" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ClassBodyVisitor.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java">
<file leaf-file-name="BlockJUnit4ClassRunner.class" pinned="false" current="false" current-in-tab="false">
<entry file="jar://C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 110.240/lib/junit-4.10.jar!/org/junit/runners/BlockJUnit4ClassRunner.class">
<provider selected="true" editor-type-id="text-editor">
<state line="60" column="78" selection-start="2341" selection-end="2341" vertical-scroll-proportion="0.8633441">
<folding>
<element signature="imports" expanded="true" />
</folding>
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Namer.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/Namer.java">
<file leaf-file-name="ReflectiveCallable.class" pinned="false" current="false" current-in-tab="false">
<entry file="jar://C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 110.240/lib/junit-4.10.jar!/org/junit/internal/runners/model/ReflectiveCallable.class">
<provider selected="true" editor-type-id="text-editor">
<state line="24" column="54" selection-start="641" selection-end="641" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
<state line="11" column="40" selection-start="397" selection-end="397" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="DeclarationTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/DeclarationTranslator.java">
<file leaf-file-name="RunScript3.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$USER_HOME$/Downloads/rhino1_7R3/rhino1_7R3/examples/RunScript3.java">
<provider selected="true" editor-type-id="text-editor">
<state line="16" column="13" selection-start="404" selection-end="404" vertical-scroll-proportion="0.0">
<state line="69" column="17" selection-start="2347" selection-end="2630" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="CodeGenerator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/generate/CodeGenerator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="38" column="0" selection-start="1114" selection-end="1114" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -185,14 +217,74 @@
</split-first>
<split-second>
<leaf>
<file leaf-file-name="ExpressionTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionTranslator.java">
<file leaf-file-name="localProperty.jet" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test_files/test_cases/localProperty.jet">
<provider selected="true" editor-type-id="text-editor">
<state line="14" column="11" selection-start="460" selection-end="460" vertical-scroll-proportion="0.0">
<folding>
<element signature="method#ExpressionTranslator#0;class#ExpressionTranslator#0" expanded="false" />
<element signature="method#translate#0;class#ExpressionTranslator#0" expanded="false" />
</folding>
<state line="15" column="3" selection-start="139" selection-end="139" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="TranslationContext.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/TranslationContext.java">
<provider selected="true" editor-type-id="text-editor">
<state line="117" column="5" selection-start="3876" selection-end="3876" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="FunctionTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/FunctionTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="40" column="56" selection-start="1624" selection-end="1624" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="NamespaceTranslator.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/NamespaceTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="23" column="136" selection-start="641" selection-end="641" vertical-scroll-proportion="0.32668713">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ClassTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="19" column="68" selection-start="625" selection-end="625" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Namer.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/Namer.java">
<provider selected="true" editor-type-id="text-editor">
<state line="76" column="59" selection-start="2627" selection-end="2627" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JsParameter.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/ast/JsParameter.java">
<provider selected="true" editor-type-id="text-editor">
<state line="13" column="9" selection-start="409" selection-end="409" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ClassBodyVisitor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="101" column="102" selection-start="4402" selection-end="4402" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
@@ -200,83 +292,16 @@
<file leaf-file-name="ExpressionVisitor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="15" column="57" selection-start="493" selection-end="493" vertical-scroll-proportion="-10.2">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="K2JSTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/K2JSTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="28" selection-start="1886" selection-end="1886" vertical-scroll-proportion="0.0">
<state line="44" column="72" selection-start="1694" selection-end="1694" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="OperationTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/OperationTranslator.java">
<file leaf-file-name="AbstractTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/AbstractTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="14" column="19" selection-start="414" selection-end="414" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="NamespaceTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/NamespaceTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="38" column="0" selection-start="1333" selection-end="1333" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="test.kt" pinned="false" current="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/test_files/test.kt">
<provider selected="true" editor-type-id="text-editor">
<state line="13" column="6" selection-start="151" selection-end="151" vertical-scroll-proportion="0.35934958">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="K2JsVisitor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/K2JsVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="18" column="52" selection-start="550" selection-end="550" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ContextType.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ContextType.java">
<provider selected="true" editor-type-id="text-editor">
<state line="22" column="63" selection-start="800" selection-end="800" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="AstUtil.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/google/dart/compiler/util/AstUtil.java">
<provider selected="true" editor-type-id="text-editor">
<state line="30" column="28" selection-start="1015" selection-end="1015" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JsVars.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/ast/JsVars.java">
<provider selected="true" editor-type-id="text-editor">
<state line="15" column="13" selection-start="463" selection-end="463" vertical-scroll-proportion="0.0">
<state line="44" column="5" selection-start="1118" selection-end="1118" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -294,27 +319,26 @@
<component name="Git.Settings">
<option name="CHECKOUT_INCLUDE_TAGS" value="false" />
<option name="UPDATE_CHANGES_POLICY" value="STASH" />
<option name="LINE_SEPARATORS_CONVERSION" value="ASK" />
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/FunctionTranslator.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/K2JsVisitor.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/DeclarationVisitor.java" />
<option value="$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionTranslator.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/AbstractTranslator.java" />
<option value="$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/ast/JsInvocation.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/DeclarationTranslator.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/K2JSTranslator.java" />
<option value="$PROJECT_DIR$/test_files/test_cases/assign.js" />
<option value="$PROJECT_DIR$/test_files/test_cases/assign.jet" />
<option value="$PROJECT_DIR$/test_files/test_cases/test.js" />
<option value="$PROJECT_DIR$/test_files/test_cases/bottles.jet" />
<option value="$PROJECT_DIR$/test/org/jetbrains/k2js/test/TranslatorTests.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/OperationTranslator.java" />
<option value="$PROJECT_DIR$/test_files/test_cases/localProperty.jet" />
<option value="$PROJECT_DIR$/src/com/google/dart/compiler/util/AstUtil.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/TranslationContext.java" />
<option value="$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/AbstractTranslator.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/FunctionTranslator.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/Namer.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassTranslator.java" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java" />
<option value="$PROJECT_DIR$/test_files/test.kt" />
<option value="$PROJECT_DIR$/src/org/jetbrains/k2js/translate/NamespaceTranslator.java" />
</list>
</option>
</component>
@@ -331,7 +355,7 @@
<option name="width" value="1936" />
<option name="height" value="1176" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
@@ -357,6 +381,8 @@
<sortByType />
</navigator>
<panes>
<pane id="Favorites" />
<pane id="Scope" />
<pane id="PackagesPane">
<subPane>
<PATH>
@@ -371,8 +397,6 @@
</PATH>
</subPane>
</pane>
<pane id="Favorites" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
@@ -404,6 +428,28 @@
<option name="myItemId" value="test_files" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="test_cases" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="test" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="test" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -459,6 +505,20 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
@@ -469,6 +529,20 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="frontend" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
@@ -487,49 +561,13 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="frontend" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="jet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lang" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="frontend" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.last.edited" value="SDKs" />
<property name="project.structure.proportion" value="0.15" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="recentsLimit" value="5" />
@@ -549,28 +587,34 @@
<recent name="org.jetbrains.k2js.backend" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Dev\Projects\jet-contrib\k2js\test_files\test_cases" />
<recent name="C:\Dev\Projects\jet-contrib\k2js\test_files" />
<recent name="C:\Dev\Projects\jet-contrib\k2js\lib" />
<recent name="C:\Dev\Projects\jet-contrib\k2js\tests" />
<recent name="C:\Dev\Projects\k2js\src\org\jetbrains\k2js\translate" />
<recent name="C:\Dev\Projects\k2js\src" />
<recent name="C:\Dev\Projects\k2js" />
<recent name="C:\Dev\Projects\k2js\src\org\jetbrains\k2js\backend" />
<recent name="C:\Dev\Projects\k2js\test_files" />
</key>
</component>
<component name="RunManager" selected="Application.K2JSTranslator">
<configuration default="false" name="Test" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="com.google.dart.compiler.backend.js.Test" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<component name="RunManager" selected="JUnit.org.jetbrains.k2js.test in k2js">
<configuration default="false" name="K2JSTranslator" type="JUnit" factoryName="JUnit" temporary="true">
<module name="k2js" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="org.jetbrains.k2js" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.k2js.K2JSTranslator" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="k2js" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="49419" />
<option name="DEBUG_PORT" value="50557" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
@@ -579,20 +623,26 @@
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="K2JSTranslator" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="org.jetbrains.k2js.K2JSTranslator" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<configuration default="false" name="TranslatorTests.Test" type="JUnit" factoryName="JUnit" temporary="true">
<module name="k2js" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.k2js.test" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.k2js.test.TranslatorTests" />
<option name="METHOD_NAME" value="Test" />
<option name="TEST_OBJECT" value="method" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="k2js" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="49421" />
<option name="DEBUG_PORT" value="50174" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
@@ -601,6 +651,78 @@
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="All in k2js" type="JUnit" factoryName="JUnit" temporary="true">
<module name="k2js" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="50505" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="TranslatorTests" type="JUnit" factoryName="JUnit" temporary="true">
<module name="k2js" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="org.jetbrains.k2js.test" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.k2js.test.TranslatorTests" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="org.jetbrains.k2js.test in k2js" type="JUnit" factoryName="JUnit" temporary="true">
<module name="k2js" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.k2js.test" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
@@ -675,9 +797,12 @@
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<list size="2">
<item index="0" class="java.lang.String" itemvalue="Application.Test" />
<item index="1" class="java.lang.String" itemvalue="Application.K2JSTranslator" />
<list size="5">
<item index="0" class="java.lang.String" itemvalue="JUnit.K2JSTranslator" />
<item index="1" class="java.lang.String" itemvalue="JUnit.TranslatorTests.Test" />
<item index="2" class="java.lang.String" itemvalue="JUnit.All in k2js" />
<item index="3" class="java.lang.String" itemvalue="JUnit.TranslatorTests" />
<item index="4" class="java.lang.String" itemvalue="JUnit.org.jetbrains.k2js.test in k2js" />
</list>
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
@@ -713,30 +838,30 @@
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1176" extended-state="6" />
<editor active="true" />
<editor active="false" />
<layout>
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32907662" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3280943" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39587426" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32907662" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3275862" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24973261" sideWeight="0.7183908" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39559388" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32907662" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32854405" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Metrics" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3284169" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3997862" sideWeight="0.6705998" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.17540108" sideWeight="0.6719057" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22780749" sideWeight="0.6714559" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3280943" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="JsTestDriver Server" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.28831416" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="JsTestDriver Server" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32907662" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
@@ -767,7 +892,7 @@
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="LAST_COMMIT_MESSAGE" />
<option name="LAST_COMMIT_MESSAGE" value="Added tests and rewrote scoping logic" />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
@@ -780,6 +905,7 @@
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
<MESSAGE value="Added tests and rewrote scoping logic" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
@@ -789,124 +915,120 @@
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassBody.java">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/TranslationContext.java">
<provider selected="true" editor-type-id="text-editor">
<state line="42" column="35" selection-start="1162" selection-end="1162" vertical-scroll-proportion="0.0">
<state line="117" column="5" selection-start="3876" selection-end="3876" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.java">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="26" column="26" selection-start="670" selection-end="670" vertical-scroll-proportion="0.0">
<state line="44" column="72" selection-start="1694" selection-end="1694" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.java">
<entry file="file://$PROJECT_DIR$/test_files/test_cases/test.js">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="13" selection-start="232" selection-end="232" vertical-scroll-proportion="0.0">
<state line="11" column="0" selection-start="131" selection-end="131" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDeclaration.java">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/AbstractTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="22" selection-start="282" selection-end="282" vertical-scroll-proportion="0.0">
<state line="44" column="5" selection-start="1118" selection-end="1118" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/DeclarationTranslator.java">
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/FunctionTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="16" column="13" selection-start="404" selection-end="404" vertical-scroll-proportion="0.0">
<state line="40" column="56" selection-start="1624" selection-end="1624" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="17" selection-start="294" selection-end="294" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/ClassDescriptor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="25" column="8" selection-start="784" selection-end="784" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/types/JetType.java">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="17" selection-start="271" selection-end="271" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java">
<provider selected="true" editor-type-id="text-editor">
<state line="49" column="30" selection-start="3469" selection-end="3469" vertical-scroll-proportion="-5.923077">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/Namer.java">
<provider selected="true" editor-type-id="text-editor">
<state line="24" column="54" selection-start="641" selection-end="641" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/K2JSTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="28" selection-start="1886" selection-end="1886" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java">
<provider selected="true" editor-type-id="text-editor">
<state line="14" column="13" selection-start="328" selection-end="328" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="272" column="0" selection-start="10394" selection-end="10394" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="29" column="10" selection-start="1105" selection-end="1105" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test_files/test.kt">
<provider selected="true" editor-type-id="text-editor">
<state line="13" column="6" selection-start="151" selection-end="151" vertical-scroll-proportion="0.35934958">
<state line="48" column="56" selection-start="1885" selection-end="1885" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="60" column="78" selection-start="2341" selection-end="2341" vertical-scroll-proportion="0.8633441">
<state line="101" column="102" selection-start="4402" selection-end="4402" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/ast/JsParameter.java">
<provider selected="true" editor-type-id="text-editor">
<state line="13" column="9" selection-start="409" selection-end="409" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/Namer.java">
<provider selected="true" editor-type-id="text-editor">
<state line="76" column="59" selection-start="2627" selection-end="2627" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ExpressionTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="9" column="6" selection-start="225" selection-end="225" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/ast/JsVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="429" column="0" selection-start="8829" selection-end="8829" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test_files/test_cases/assign.jet">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="18" selection-start="114" selection-end="114" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="236" column="0" selection-start="8269" selection-end="8269" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/org/jetbrains/k2js/test/TranslatorTests.java">
<provider selected="true" editor-type-id="text-editor">
<state line="57" column="16" selection-start="1910" selection-end="1910" vertical-scroll-proportion="0.97495526">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/ClassTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="19" column="68" selection-start="625" selection-end="625" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/jetbrains/k2js/translate/NamespaceTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="23" column="136" selection-start="641" selection-end="641" vertical-scroll-proportion="0.32668713">
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
@@ -985,7 +1107,7 @@
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<last-edited>lib</last-edited>
<last-edited>junit</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
+2 -1
View File
@@ -8,9 +8,10 @@
</content>
<orderEntry type="jdk" jdkName="IDEA IC-110.240" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="lib" level="project" />
<orderEntry type="module" module-name="frontend" />
<orderEntry type="module" module-name="frontend.java" />
<orderEntry type="library" name="rhino" level="project" />
<orderEntry type="library" name="junit" level="project" />
</component>
</module>
Binary file not shown.
@@ -1,670 +0,0 @@
namespace jet
namespace typeinfo {
class TypeInfo<T> {
fun isSubtypeOf(other : TypeInfo<*>) : Boolean
fun isInstance(obj : Any?) : Boolean
}
fun typeinfo<T>() : TypeInfo<T>
fun typeinfo<T>(expression : T) : TypeInfo<out T>
}
namespace io {
fun print(message : Any?)
fun print(message : Int)
fun print(message : Long)
fun print(message : Byte)
fun print(message : Short)
fun print(message : Char)
fun print(message : Boolean)
fun print(message : Float)
fun print(message : Double)
fun println(message : Any?)
fun println(message : Int)
fun println(message : Long)
fun println(message : Byte)
fun println(message : Short)
fun println(message : Char)
fun println(message : Boolean)
fun println(message : Float)
fun println(message : Double)
fun readLine() : String?
}
// Can't write a body due to a bootstrapping problem (see JET-74)
fun Any?.equals(other : Any?) : Boolean// = this === other
// Returns "null" for null
fun Any?.toString() : String// = this === other
fun String?.plus(other: Any?) : String
trait Iterator<out T> {
fun next() : T
val hasNext : Boolean
}
trait Iterable<out T> {
fun iterator() : Iterator<T>
}
class Array<T>(val size : Int, init : fun(Int) : T = null ) {
fun get(index : Int) : T
fun set(index : Int, value : T) : Unit
fun iterator() : Iterator<T>
val indices : IntRange
}
class ByteArray(val size : Int) {
fun get(index : Int) : Byte
fun set(index : Int, value : Byte) : Unit
fun iterator() : Iterator<Byte>
val indices : IntRange
}
class ShortArray(val size : Int) {
fun get(index : Int) : Short
fun set(index : Int, value : Short) : Unit
fun iterator() : Iterator<Short>
val indices : IntRange
}
class IntArray(val size : Int) {
fun get(index : Int) : Int
fun set(index : Int, value : Int) : Unit
fun iterator() : Iterator<Int>
val indices : IntRange
}
class LongArray(val size : Int) {
fun get(index : Int) : Long
fun set(index : Int, value : Long) : Unit
fun iterator() : Iterator<Long>
val indices : IntRange
}
class FloatArray(val size : Int) {
fun get(index : Int) : Float
fun set(index : Int, value : Float) : Unit
fun iterator() : Iterator<Float>
val indices : IntRange
}
class DoubleArray(val size : Int) {
fun get(index : Int) : Double
fun set(index : Int, value : Double) : Unit
fun iterator() : Iterator<Double>
val indices : IntRange
}
class CharArray(val size : Int) {
fun get(index : Int) : Char
fun set(index : Int, value : Char) : Unit
fun iterator() : Iterator<Char>
val indices : IntRange
}
class BooleanArray(val size : Int) {
fun get(index : Int) : Boolean
fun set(index : Int, value : Boolean) : Unit
fun iterator() : Iterator<Boolean>
val indices : IntRange
}
trait Comparable<in T> {
fun compareTo(other : T) : Int
}
trait Hashable {
fun hashCode() : Int
fun equals(other : Any?) : Boolean
}
class Boolean : Comparable<Boolean> {
fun not() : Boolean
fun xor(other : Boolean) : Boolean
fun equals(other : Any?) : Boolean
}
class String() : Comparable<String> {
fun get(index : Int) : Char
val length : Int
fun plus(other : Any?) : String
fun equals(other : Any?) : Boolean
fun equalsIgnoreCase(other: String?) : Boolean
fun substring(start: Int): String
fun substring(start: Int, end: Int): String
fun startsWith(prefix: String, toffset: Int): Boolean
fun startsWith(prefix: String): Boolean
fun endsWith(suffix: String): Boolean
fun trim(): String
}
trait Range<in T : Comparable<T>> {
fun contains(item : T) : Boolean
}
class IntRange(val start : Int, size : Int, reversed : Boolean = false) : Range<Int>, Iterable<Int> {
fun iterator () : Iterator<Int>
fun contains (elem: Int) : Boolean
val size : Int
val end : Int
val reversed : Boolean
}
class LongRange(val start : Long, size : Long, reversed : Boolean = false) : Range<Long>, Iterable<Long> {
fun iterator () : Iterator<Long>
fun contains (elem: Long) : Boolean
val size : Long
val end : Long
val reversed : Boolean
}
abstract class Number : Hashable {
abstract val dbl : Double
abstract val flt : Float
abstract val lng : Long
abstract val int : Int
abstract val chr : Char
abstract val sht : Short
abstract val byt : Byte
// fun equals(other : Double) : Boolean
// fun equals(other : Float) : Boolean
// fun equals(other : Long) : Boolean
// fun equals(other : Byte) : Boolean
// fun equals(other : Int) : Boolean
// fun equals(other : Short) : Boolean
// fun equals(other : Char) : Boolean
}
class Double : Number, Comparable<Double> {
override fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
fun compareTo(other : Short) : Int
fun compareTo(other : Byte) : Int
fun compareTo(other : Char) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Double
fun plus(other : Long) : Double
fun plus(other : Int) : Double
fun plus(other : Short) : Double
fun plus(other : Byte) : Double
fun plus(other : Char) : Double
fun minus(other : Double) : Double
fun minus(other : Float) : Double
fun minus(other : Long) : Double
fun minus(other : Int) : Double
fun minus(other : Short) : Double
fun minus(other : Byte) : Double
fun minus(other : Char) : Double
fun times(other : Double) : Double
fun times(other : Float) : Double
fun times(other : Long) : Double
fun times(other : Int) : Double
fun times(other : Short) : Double
fun times(other : Byte) : Double
fun times(other : Char) : Double
fun div(other : Double) : Double
fun div(other : Float) : Double
fun div(other : Long) : Double
fun div(other : Int) : Double
fun div(other : Short) : Double
fun div(other : Byte) : Double
fun div(other : Char) : Double
fun mod(other : Double) : Double
fun mod(other : Float) : Double
fun mod(other : Long) : Double
fun mod(other : Int) : Double
fun mod(other : Short) : Double
fun mod(other : Byte) : Double
fun rangeTo(other : Double) : Range<Double>
fun rangeTo(other : Float) : Range<Double>
fun rangeTo(other : Long) : Range<Double>
fun rangeTo(other : Int) : Range<Double>
fun rangeTo(other : Short) : Range<Double>
fun rangeTo(other : Byte) : Range<Double>
fun rangeTo(other : Char) : Range<Double>
fun inc() : Double
fun dec() : Double
fun plus() : Double
fun minus() : Double
}
class Float : Number, Comparable<Float> {
fun compareTo(other : Double) : Int
override fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
fun compareTo(other : Short) : Int
fun compareTo(other : Byte) : Int
fun compareTo(other : Char) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Float
fun plus(other : Int) : Float
fun plus(other : Short) : Float
fun plus(other : Byte) : Float
fun plus(other : Char) : Float
fun minus(other : Double) : Double
fun minus(other : Float) : Float
fun minus(other : Long) : Float
fun minus(other : Int) : Float
fun minus(other : Short) : Float
fun minus(other : Byte) : Float
fun minus(other : Char) : Float
fun times(other : Double) : Double
fun times(other : Float) : Float
fun times(other : Long) : Float
fun times(other : Int) : Float
fun times(other : Short) : Float
fun times(other : Byte) : Float
fun times(other : Char) : Float
fun div(other : Double) : Double
fun div(other : Float) : Float
fun div(other : Long) : Float
fun div(other : Int) : Float
fun div(other : Short) : Float
fun div(other : Byte) : Float
fun div(other : Char) : Float
fun mod(other : Double) : Double
fun mod(other : Float) : Float
fun mod(other : Long) : Float
fun mod(other : Int) : Float
fun mod(other : Short) : Float
fun mod(other : Byte) : Float
fun mod(other : Char) : Float
fun rangeTo(other : Double) : Range<Double>
fun rangeTo(other : Float) : Range<Float>
fun rangeTo(other : Long) : Range<Double>
fun rangeTo(other : Int) : Range<Double>
fun rangeTo(other : Short) : Range<Float>
fun rangeTo(other : Byte) : Range<Float>
fun rangeTo(other : Char) : Range<Float>
fun inc() : Float
fun dec() : Float
fun plus() : Float
fun minus() : Float
}
class Long : Number, Comparable<Long> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
override fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
fun compareTo(other : Short) : Int
fun compareTo(other : Byte) : Int
fun compareTo(other : Char) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
fun plus(other : Int) : Long
fun plus(other : Short) : Long
fun plus(other : Byte) : Long
fun plus(other : Char) : Long
fun minus(other : Double) : Double
fun minus(other : Float) : Float
fun minus(other : Long) : Long
fun minus(other : Int) : Long
fun minus(other : Short) : Long
fun minus(other : Byte) : Long
fun minus(other : Char) : Long
fun times(other : Double) : Double
fun times(other : Float) : Float
fun times(other : Long) : Long
fun times(other : Int) : Long
fun times(other : Short) : Long
fun times(other : Byte) : Long
fun times(other : Char) : Long
fun div(other : Double) : Double
fun div(other : Float) : Float
fun div(other : Long) : Long
fun div(other : Int) : Long
fun div(other : Short) : Long
fun div(other : Byte) : Long
fun div(other : Char) : Long
fun mod(other : Double) : Double
fun mod(other : Float) : Float
fun mod(other : Long) : Long
fun mod(other : Int) : Long
fun mod(other : Short) : Long
fun mod(other : Byte) : Long
fun mod(other : Char) : Long
fun rangeTo(other : Double) : Range<Double>
fun rangeTo(other : Float) : Range<Double>
fun rangeTo(other : Long) : LongRange
fun rangeTo(other : Int) : LongRange
fun rangeTo(other : Short) : LongRange
fun rangeTo(other : Byte) : LongRange
fun rangeTo(other : Char) : LongRange
fun inc() : Long
fun dec() : Long
fun plus() : Long
fun minus() : Long
fun shl(bits : Int) : Long
fun shr(bits : Int) : Long
fun ushr(bits : Int) : Long
fun and(other : Long) : Long
fun or(other : Long) : Long
fun xor(other : Long) : Long
fun inv() : Long
}
class Int : Number, Comparable<Int> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
override fun compareTo(other : Int) : Int
fun compareTo(other : Short) : Int
fun compareTo(other : Byte) : Int
fun compareTo(other : Char) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
fun plus(other : Int) : Int
fun plus(other : Short) : Int
fun plus(other : Byte) : Int
fun plus(other : Char) : Int
fun minus(other : Double) : Double
fun minus(other : Float) : Float
fun minus(other : Long) : Long
fun minus(other : Int) : Int
fun minus(other : Short) : Int
fun minus(other : Byte) : Int
fun minus(other : Char) : Int
fun times(other : Double) : Double
fun times(other : Float) : Float
fun times(other : Long) : Long
fun times(other : Int) : Int
fun times(other : Short) : Int
fun times(other : Byte) : Int
fun times(other : Char) : Int
fun div(other : Double) : Double
fun div(other : Float) : Float
fun div(other : Long) : Long
fun div(other : Int) : Int
fun div(other : Short) : Int
fun div(other : Byte) : Int
fun div(other : Char) : Int
fun mod(other : Double) : Double
fun mod(other : Float) : Float
fun mod(other : Long) : Long
fun mod(other : Int) : Int
fun mod(other : Short) : Int
fun mod(other : Byte) : Int
fun mod(other : Char) : Int
fun rangeTo(other : Double) : Range<Double>
fun rangeTo(other : Float) : Range<Double>
fun rangeTo(other : Long) : LongRange
fun rangeTo(other : Int) : IntRange
fun rangeTo(other : Short) : IntRange
fun rangeTo(other : Byte) : IntRange
fun rangeTo(other : Char) : IntRange
fun inc() : Int
fun dec() : Int
fun plus() : Int
fun minus() : Int
fun shl(bits : Int) : Int
fun shr(bits : Int) : Int
fun ushr(bits : Int) : Int
fun and(other : Int) : Int
fun or(other : Int) : Int
fun xor(other : Int) : Int
fun inv() : Int
}
class Char : Number, Comparable<Char> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
fun compareTo(other : Short) : Int
override fun compareTo(other : Char) : Int
fun compareTo(other : Byte) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
fun plus(other : Int) : Int
fun plus(other : Short) : Int
fun plus(other : Byte) : Int
fun plus(other : Char) : Int
fun minus(other : Double) : Double
fun minus(other : Float) : Float
fun minus(other : Long) : Long
fun minus(other : Int) : Int
fun minus(other : Short) : Int
fun minus(other : Byte) : Int
fun minus(other : Char) : Int
fun times(other : Double) : Double
fun times(other : Float) : Float
fun times(other : Long) : Long
fun times(other : Int) : Int
fun times(other : Short) : Int
fun times(other : Byte) : Int
fun times(other : Char) : Int
fun div(other : Double) : Double
fun div(other : Float) : Float
fun div(other : Long) : Long
fun div(other : Int) : Int
fun div(other : Short) : Int
fun div(other : Byte) : Int
fun div(other : Char) : Int
fun mod(other : Double) : Double
fun mod(other : Float) : Float
fun mod(other : Long) : Long
fun mod(other : Int) : Int
fun mod(other : Short) : Int
fun mod(other : Byte) : Int
fun mod(other : Char) : Int
fun rangeTo(other : Double) : Range<Double>
fun rangeTo(other : Float) : Range<Float>
fun rangeTo(other : Long) : LongRange
fun rangeTo(other : Int) : IntRange
fun rangeTo(other : Short) : IntRange
fun rangeTo(other : Byte) : IntRange
fun rangeTo(other : Char) : IntRange
fun inc() : Char
fun dec() : Char
fun plus() : Int
fun minus() : Int
}
class Short : Number, Comparable<Short> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
override fun compareTo(other : Short) : Int
fun compareTo(other : Byte) : Int
fun compareTo(other : Char) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
fun plus(other : Int) : Int
fun plus(other : Short) : Int
fun plus(other : Byte) : Int
fun plus(other : Char) : Int
fun minus(other : Double) : Double
fun minus(other : Float) : Float
fun minus(other : Long) : Long
fun minus(other : Int) : Int
fun minus(other : Short) : Int
fun minus(other : Byte) : Int
fun minus(other : Char) : Int
fun times(other : Double) : Double
fun times(other : Float) : Float
fun times(other : Long) : Long
fun times(other : Int) : Int
fun times(other : Short) : Int
fun times(other : Byte) : Int
fun times(other : Char) : Int
fun div(other : Double) : Double
fun div(other : Float) : Float
fun div(other : Long) : Long
fun div(other : Int) : Int
fun div(other : Short) : Int
fun div(other : Byte) : Int
fun div(other : Char) : Int
fun mod(other : Double) : Double
fun mod(other : Float) : Float
fun mod(other : Long) : Long
fun mod(other : Int) : Int
fun mod(other : Short) : Int
fun mod(other : Byte) : Int
fun mod(other : Char) : Int
fun rangeTo(other : Double) : Range<Double>
fun rangeTo(other : Float) : Range<Float>
fun rangeTo(other : Long) : LongRange
fun rangeTo(other : Int) : IntRange
fun rangeTo(other : Short) : IntRange
fun rangeTo(other : Byte) : IntRange
fun rangeTo(other : Char) : IntRange
fun inc() : Short
fun dec() : Short
fun plus() : Int
fun minus() : Int
}
class Byte : Number, Comparable<Byte> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
fun compareTo(other : Short) : Int
fun compareTo(other : Char) : Int
override fun compareTo(other : Byte) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
fun plus(other : Int) : Int
fun plus(other : Short) : Int
fun plus(other : Byte) : Int
fun plus(other : Char) : Int
fun minus(other : Double) : Double
fun minus(other : Float) : Float
fun minus(other : Long) : Long
fun minus(other : Int) : Int
fun minus(other : Short) : Int
fun minus(other : Byte) : Int
fun minus(other : Char) : Int
fun times(other : Double) : Double
fun times(other : Float) : Float
fun times(other : Long) : Long
fun times(other : Int) : Int
fun times(other : Short) : Int
fun times(other : Byte) : Int
fun times(other : Char) : Int
fun div(other : Double) : Double
fun div(other : Float) : Float
fun div(other : Long) : Long
fun div(other : Int) : Int
fun div(other : Short) : Int
fun div(other : Byte) : Int
fun div(other : Char) : Int
fun mod(other : Double) : Double
fun mod(other : Float) : Float
fun mod(other : Long) : Long
fun mod(other : Int) : Int
fun mod(other : Short) : Int
fun mod(other : Byte) : Int
fun mod(other : Char) : Int
fun rangeTo(other : Double) : Range<Double>
fun rangeTo(other : Float) : Range<Float>
fun rangeTo(other : Long) : LongRange
fun rangeTo(other : Int) : IntRange
fun rangeTo(other : Short) : IntRange
fun rangeTo(other : Byte) : IntRange
fun rangeTo(other : Char) : IntRange
fun inc() : Byte
fun dec() : Byte
fun plus() : Int
fun minus() : Int
}
@@ -16,7 +16,7 @@ import com.google.dart.compiler.backend.js.ast.JsProgram;
*/
public interface JsNamer {
/**
* Names the shortNames of all JsNames of the program so that they are valid
* GlobalNames the shortNames of all JsNames of the program so that they are valid
* JS-identifiers and that there are no clashes and no shadowing.
*/
public void exec(JsProgram program);
@@ -8,7 +8,7 @@ import com.google.dart.compiler.backend.js.ast.JsBlock;
import com.google.dart.compiler.backend.js.ast.JsContext;
import com.google.dart.compiler.backend.js.ast.JsProgram;
import com.google.dart.compiler.backend.js.ast.JsProgramFragment;
import com.google.dart.compiler.util.*;
import com.google.dart.compiler.util.TextOutput;
/**
* Generates JavaScript source from an AST.
@@ -4,19 +4,15 @@
package com.google.dart.compiler.common;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.Serializable;
import java.io.Writer;
import java.io.*;
import java.nio.charset.Charset;
/**
* Instead of Strings, we use Names to abstract the underlying representation.
* Instead of Strings, we use GlobalNames to abstract the underlying representation.
*
* <ul>
* <li>Names are globally unique and use identity for equality.</li>
* <li>Names are interned, so all references to the same name use the same
* <li>GlobalNames are globally unique and use identity for equality.</li>
* <li>GlobalNames are interned, so all references to the same name use the same
* bytes.</li>
* </ul>
* TODO(scottb): use byte[] instead of char[] when the parser is rewritten
+15 -2
View File
@@ -8,9 +8,7 @@ import com.google.dart.compiler.InternalCompilerException;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.backend.js.ast.JsVars.JsVar;
import com.google.dart.compiler.common.SourceInfo;
import com.sun.org.apache.xpath.internal.functions.Function;
import java.util.ArrayList;
import java.util.List;
/**
@@ -28,6 +26,16 @@ public class AstUtil {
return invoke;
}
public static JsInvocation newInvocation(
JsExpression target, List<JsExpression> params) {
JsInvocation invoke = new JsInvocation();
invoke.setQualifier(target);
for (JsExpression expr : params) {
invoke.getArguments().add(expr);
}
return invoke;
}
public static JsNameRef newQualifiedNameRef(String name) {
JsNameRef node = null;
int endPos = -1;
@@ -245,4 +253,9 @@ public class AstUtil {
public static JsExpression in(SourceInfo src, JsExpression propName, JsExpression obj) {
return new JsBinaryOperation(JsBinaryOperator.INOP, propName, obj).setSourceRef(src);
}
public static JsPropertyInitializer newNamedMethod(JsName name, JsFunction function) {
JsNameRef methodName = name.makeRef();
return new JsPropertyInitializer(methodName, function);
}
}
+1 -6
View File
@@ -4,12 +4,7 @@
package com.google.dart.compiler.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.*;
/**
* Utility methods for operating on memory-efficient lists. All lists of size 0
+1 -1
View File
@@ -6,8 +6,8 @@ package com.google.dart.compiler.util;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Utility methods for operating on memory-efficient maps. All maps of size 0 or
+18 -3
View File
@@ -23,10 +23,11 @@ import org.jetbrains.jet.lang.psi.JetNamespace;
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.java.JavaDefaultImports;
import org.jetbrains.k2js.translate.GenerationState;
import org.jetbrains.k2js.generate.CodeGenerator;
import org.jetbrains.k2js.translate.GenerationState;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
@@ -45,8 +46,12 @@ public class K2JSTranslator {
public static void main(String[] args) {
System.setProperty("java.awt.headless", "true");
Arguments arguments = new Arguments();
arguments.src = "C:\\Dev\\Projects\\jet-contrib\\k2js\\test_files\\test.kt";
arguments.src = "test_files\\test_cases\\test.kt";
arguments.outputDir = null;
translate(arguments);
}
public static void translate(Arguments arguments) {
Disposable root = new Disposable() {
@Override
public void dispose() {
@@ -93,7 +98,17 @@ public class K2JSTranslator {
// Translate generated psi
CodeGenerator generator = new CodeGenerator();
JsProgram program = generationState.compileCorrectNamespaces(bindingContext, namespaces);
generator.generate(program);
if (arguments.outputDir == null) {
generator.generateToConsole(program);
} else {
File outputFile = new File(arguments.outputDir);
try {
generator.generateToFile(program, outputFile);
}
catch (IOException e) {
System.out.println("Failed to write to specified file");
}
}
}
}
@@ -5,6 +5,10 @@ import com.google.dart.compiler.backend.js.ast.JsProgram;
import com.google.dart.compiler.util.DefaultTextOutput;
import com.google.dart.compiler.util.TextOutput;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
/**
* @author Pavel.Talanov
*/
@@ -16,10 +20,21 @@ public final class CodeGenerator {
}
public void generate(JsProgram program) {
public void generateToConsole(JsProgram program) {
generateCode(program);
System.out.println(output.toString());
}
private void generateCode(JsProgram program) {
JsSourceGenerationVisitor sourceGenerator =
new JsSourceGenerationVisitor(output);
program.traverse(sourceGenerator, null);
System.out.println(output.toString());
}
public void generateToFile(JsProgram program, File file) throws IOException {
generateCode(program);
FileWriter writer = new FileWriter(file);
writer.write(output.toString());
writer.close();
}
}
@@ -41,11 +41,6 @@ public abstract class AbstractTranslator {
@NotNull
protected JsScope scope() {
return context.scope();
}
@NotNull
protected JsBlock block() {
return context.block();
return context.enclosingScope();
}
}
@@ -1,13 +1,15 @@
package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.JsBlock;
import com.google.dart.compiler.backend.js.ast.JsFunction;
import com.google.dart.compiler.backend.js.ast.JsPropertyInitializer;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.util.AstUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.psi.JetClass;
import org.jetbrains.jet.lang.psi.JetDeclaration;
import org.jetbrains.jet.lang.psi.JetProperty;
import org.jetbrains.jet.lang.psi.JetPropertyAccessor;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
@@ -31,30 +33,69 @@ public class ClassBodyVisitor extends K2JsVisitor<List<JsPropertyInitializer>> {
List<JsPropertyInitializer> methods = new ArrayList<JsPropertyInitializer>();
if (expression.getSetter() != null) {
methods.addAll(expression.getSetter().accept(this, context));
} else {
if (expression.isVar()) {
methods.add(generateDefaultSetter(expression, context));
}
}
if (expression.getGetter() != null) {
methods.addAll(expression.getGetter().accept(this, context));
} else {
methods.add(generateDefaultGetter(expression, context));
}
return methods;
}
@NotNull
private JsPropertyInitializer generateDefaultGetter(JetProperty expression, TranslationContext context) {
return AstUtil.newNamedMethod
(Namer.getNameForGetter(expression.getName()), generateDefaultGetterFunction(expression, context));
}
@NotNull
private JsFunction generateDefaultGetterFunction(JetProperty expression, TranslationContext context) {
JsNameRef backingFieldRef = Namer.getBackingFieldNameForProperty(expression.getName()).makeRef();
JsReturn returnExpression = new JsReturn(backingFieldRef);
return AstUtil.newFunction
(context.enclosingScope(), null, Collections.EMPTY_LIST, AstUtil.convertToBlock(returnExpression));
}
@NotNull
private JsPropertyInitializer generateDefaultSetter(JetProperty expression, TranslationContext context) {
return AstUtil.newNamedMethod(
Namer.getNameForAccessor(expression.getName(), null), generateDefaultSetterFunction(expression, context));
}
@NotNull
private JsFunction generateDefaultSetterFunction(JetProperty expression, TranslationContext context) {
JsFunction result = new JsFunction(context.enclosingScope());
JsParameter defaultParameter = new JsParameter(context.enclosingScope().declareFreshName(Namer.DEFAULT_SETTER_PARAM_NAME));
JsBinaryOperation assignExpression = new JsBinaryOperation(JsBinaryOperator.ASG);
assignExpression.setArg1(Namer.getBackingFieldNameForProperty(expression).makeRef());
assignExpression.setArg2(defaultParameter.getName().makeRef());
return result;
}
@Override
@NotNull
public List<JsPropertyInitializer> visitPropertyAccessor
(JetPropertyAccessor expression, TranslationContext context) {
List<JsPropertyInitializer> methods = new ArrayList<JsPropertyInitializer>();
JsPropertyInitializer namedMethod = new JsPropertyInitializer();
// TODO
namedMethod.setLabelExpr(Namer.getNameForAccessor("nameForAccessor", expression).makeRef());
JsFunction methodBody = new JsFunction(context.scope());
ExpressionTranslator expressionTranslator =
new ExpressionTranslator(context.newScope(methodBody.getScope()));
JsBlock methodBlock = AstUtil.convertToBlock(expressionTranslator.translate(expression.getBodyExpression()));
methodBody.setBody(methodBlock);
namedMethod.setValueExpr(methodBody);
JsPropertyInitializer namedMethod = generateMethodForAccessor(expression, context);
methods.add(namedMethod);
return methods;
}
private JsPropertyInitializer generateMethodForAccessor(JetPropertyAccessor expression, TranslationContext context) {
JsFunction methodBody = new JsFunction(context.enclosingScope());
ExpressionTranslator expressionTranslator =
new ExpressionTranslator(context.newFunction(methodBody));
JsBlock methodBodyBlock = AstUtil.convertToBlock(expressionTranslator.translate(expression.getBodyExpression()));
methodBody.setBody(methodBodyBlock);
//TODO figure out naming pattern
return AstUtil.newNamedMethod(Namer.getNameForAccessor("nameForAccessor", expression), methodBody);
}
}
@@ -24,13 +24,13 @@ public class ClassTranslator extends AbstractTranslator {
public JsStatement translateClass(JetClass classDeclaration) {
JsInvocation jsClassDeclaration = new JsInvocation();
jsClassDeclaration.setQualifier(translationContext().classCreationMethodReference());
jsClassDeclaration.setQualifier(Namer.creationMethodReference());
JsObjectLiteral jsClassDescription = translateClassDeclarations(classDeclaration);
jsClassDeclaration.getArguments().add(jsClassDescription);
//getSuperClassName(classDeclaration);
String className = classDeclaration.getName();
JsStatement result = AstUtil.convertToStatement(AstUtil.newAssignment(
translationContext().getQualifiedReference(getJSName(className)), jsClassDeclaration));
translationContext().getNamespaceQualifiedReference(getJSName(className)), jsClassDeclaration));
return result;
}
@@ -1,7 +1,5 @@
package org.jetbrains.k2js.translate;
import com.sun.org.apache.bcel.internal.generic.NEW;
/**
* @author Talanov Pavel
*/
@@ -1,16 +1,14 @@
package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.backend.js.ast.JsExpression;
import com.google.dart.compiler.backend.js.ast.JsName;
import com.google.dart.compiler.backend.js.ast.JsNameRef;
import com.google.dart.compiler.backend.js.ast.JsStatement;
import com.google.dart.compiler.util.AstUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Talanov Pavel
*/
@@ -79,7 +77,7 @@ public class DeclarationTranslator extends AbstractTranslator {
@NotNull
public JsStatement translateProperty(JetProperty declaration) {
String propertyName = declaration.getName();
JsNameRef jsPropertyNameReference = translationContext().getQualifiedReference(getJSName(propertyName));
JsNameRef jsPropertyNameReference = translationContext().getNamespaceQualifiedReference(getJSName(propertyName));
JsExpression jsInitExpression = translateInitializer(declaration);
JsExpression result;
if (jsInitExpression != null) {
@@ -1,15 +1,8 @@
package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.util.AstUtil;
import groovyjarjarantlr.collections.AST;
import com.google.dart.compiler.backend.js.ast.JsNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
import org.jetbrains.jet.lexer.JetToken;
import java.util.List;
import org.jetbrains.jet.lang.psi.JetExpression;
/**
* @author Talanov Pavel
@@ -8,6 +8,7 @@ import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
import org.jetbrains.jet.lexer.JetToken;
import java.util.ArrayList;
import java.util.List;
/**
@@ -26,6 +27,9 @@ public class ExpressionVisitor extends K2JsVisitor<JsNode> {
if (value instanceof Integer) {
result = context.program().getNumberLiteral((Integer) value);
}
if (value instanceof Boolean) {
return context.program().getBooleanLiteral((Boolean) value);
}
assert result != null;
return result;
}
@@ -35,12 +39,10 @@ public class ExpressionVisitor extends K2JsVisitor<JsNode> {
public JsNode visitBlockExpression(JetBlockExpression jetBlock, TranslationContext context) {
List<JetElement> jetElements = jetBlock.getStatements();
JsBlock jsBlock = new JsBlock();
ExpressionTranslator expressionTranslator =
new ExpressionTranslator(context.newBlock(jsBlock));
for (JetElement jetElement : jetElements) {
//TODO hack alert
JetExpression jetExpression = (JetExpression) jetElement;
JsNode jsNode = jetExpression.accept(this, context.newBlock(jsBlock));
JsNode jsNode = jetExpression.accept(this, context.newBlock());
jsBlock.addStatement(AstUtil.convertToStatement(jsNode));
}
assert jsBlock != null;
@@ -51,9 +53,12 @@ public class ExpressionVisitor extends K2JsVisitor<JsNode> {
@NotNull
public JsNode visitReturnExpression(JetReturnExpression jetReturnExpression, TranslationContext context) {
//TODO hack alert
JsExpression jsExpression = (JsExpression) (jetReturnExpression.getReturnedExpression().accept(this, context));
JsReturn jsReturnExpression = new JsReturn(jsExpression);
return jsReturnExpression;
if (jetReturnExpression.getReturnedExpression() != null) {
JsExpression jsExpression = (JsExpression) (jetReturnExpression.getReturnedExpression().accept(this, context));
JsReturn jsReturnExpression = new JsReturn(jsExpression);
return jsReturnExpression;
}
return new JsReturn();
}
@Override
@@ -78,7 +83,11 @@ public class ExpressionVisitor extends K2JsVisitor<JsNode> {
@NotNull
public JsNode visitSimpleNameExpression(JetSimpleNameExpression expression, TranslationContext context) {
String referencedName = expression.getReferencedName();
return new JsNameRef(context.getJSName(referencedName));
if (context.enclosingScope().findExistingName(referencedName) == null) {
JsName name = context.enclosingScope().declareName(referencedName);
return name.makeRef();
}
return context.getNamespaceQualifiedReference(context.getJSName(referencedName));
}
@Override
@@ -88,4 +97,27 @@ public class ExpressionVisitor extends K2JsVisitor<JsNode> {
return translator.translateProperty(expression);
}
@Override
@NotNull
public JsNode visitCallExpression(JetCallExpression expression, TranslationContext context) {
JsExpression callee = getCallee(expression, context);
List<JsExpression> arguments = generateArgumentList(expression.getFunctionLiteralArguments(), context);
return AstUtil.newInvocation(callee, arguments);
}
@NotNull
private JsExpression getCallee(JetCallExpression expression, TranslationContext context) {
JsNode jsCallee = expression.getCalleeExpression().accept(this, context);
return AstUtil.convertToExpression(jsCallee);
}
@NotNull
private List<JsExpression> generateArgumentList(List<JetExpression> jetArguments, TranslationContext context) {
List<JsExpression> jsArguments = new ArrayList<JsExpression>();
for (JetExpression jetExpression : jetArguments) {
jsArguments.add(AstUtil.convertToExpression(jetExpression.accept(this, context)));
}
return jsArguments;
}
}
@@ -1,9 +1,6 @@
package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.JsFunction;
import com.google.dart.compiler.backend.js.ast.JsNode;
import com.google.dart.compiler.backend.js.ast.JsParameter;
import com.google.dart.compiler.backend.js.ast.JsScope;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.util.AstUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetExpression;
@@ -23,11 +20,16 @@ public class FunctionTranslator extends AbstractTranslator {
}
@NotNull
public JsFunction translateFunction(JetNamedFunction jetFunction) {
String name = jetFunction.getName();
public JsStatement translateFunction(JetNamedFunction jetFunction) {
JsNameRef functionName = translationContext().getNamespaceQualifiedReference(getJSName(jetFunction.getName()));
JsFunction function = generateFunctionObject(jetFunction);
return AstUtil.convertToStatement(AstUtil.newAssignment(functionName, function));
}
private JsFunction generateFunctionObject(JetNamedFunction jetFunction) {
JetExpression jetBodyExpression = jetFunction.getBodyExpression();
JsFunction result = new JsFunction(scope(), getJSName(name));
JsNode jsBody = (new ExpressionTranslator(functionBodyContext(result.getScope())))
JsFunction result = new JsFunction(scope());
JsNode jsBody = (new ExpressionTranslator(functionBodyContext(result)))
.translate(jetBodyExpression);
List<JsParameter> jsParameters = translateParameters(jetFunction.getValueParameters());
result.setParameters(jsParameters);
@@ -35,8 +37,8 @@ public class FunctionTranslator extends AbstractTranslator {
return result;
}
private TranslationContext functionBodyContext(JsScope functionScope) {
return translationContext().newType(ContextType.FUNCTION_BODY).newScope(functionScope);
private TranslationContext functionBodyContext(JsFunction function) {
return translationContext().newFunction(function);
}
@NotNull
@@ -1,6 +1,5 @@
package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.JsNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetElement;
import org.jetbrains.jet.lang.psi.JetVisitor;
+44 -5
View File
@@ -1,10 +1,11 @@
package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.JsName;
import com.google.dart.compiler.backend.js.ast.JsNameRef;
import com.google.dart.compiler.util.AstUtil;
import org.jetbrains.jet.lang.psi.JetProperty;
import org.jetbrains.jet.lang.psi.JetPropertyAccessor;
import java.util.Set;
/**
* @author Talanov Pavel
*/
@@ -23,6 +24,8 @@ public final class Namer {
private static final String CLASS_CREATE_METHOD_NAME = "create";
private static final String SETTER_PREFIX = "_set_";
private static final String GETTER_PREFIX = "_get_";
private static final String BACKING_FIELD_PREFIX = "_$_";
public static final String DEFAULT_SETTER_PARAM_NAME = "val";
public static JsName getClassObjectName() {
//TODO dummy representation
@@ -30,14 +33,50 @@ public final class Namer {
}
public static JsName getNameForAccessor(String propertyName, JetPropertyAccessor accessor) {
String name = propertyName;
if (accessor.isGetter()) {
name += GETTER_PREFIX;
return getNameForGetter(propertyName);
}
if (accessor.isSetter()) {
name += SETTER_PREFIX;
return getNameForSetter(propertyName);
}
throw new AssertionError("accessor should be a getter or a setter!");
}
public static JsName getBackingFieldNameForProperty(String propertyName) {
String name = BACKING_FIELD_PREFIX + propertyName;
return new JsName(null, name, name, name);
}
public static JsName getBackingFieldNameForProperty(JetProperty property) {
return getNameWithPrefix(property.getName(), BACKING_FIELD_PREFIX);
}
public static JsName getNameForGetter(String propertyName) {
return getNameWithPrefix(propertyName, GETTER_PREFIX);
}
public static JsName getNameForSetter(String propertyName) {
return getNameWithPrefix(propertyName, SETTER_PREFIX);
}
private static JsName getNameWithPrefix(String name, String prefix) {
String resultingName = prefix + name;
return new JsName(null, resultingName, resultingName, resultingName);
}
public static JsName getNameForNamespace(String name) {
return new JsName(null, name, name, name);
}
public static JsNameRef classObjectReference() {
//TODO dummy
return AstUtil.newQualifiedNameRef("Class");
}
public static JsNameRef creationMethodReference() {
return AstUtil.newQualifiedNameRef("Class.create");
}
}
@@ -2,10 +2,10 @@ package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.util.AstUtil;
import org.jaxen.expr.Expr;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetDeclaration;
import org.jetbrains.jet.lang.psi.JetNamespace;
import java.beans.Expression;
import java.util.ArrayList;
import java.util.List;
@@ -27,27 +27,37 @@ public class NamespaceTranslator extends AbstractTranslator {
}
public JsBlock translate(JetNamespace namespace) {
// TODO write namespace change logic
// TODO support multiple namespaces
JsBlock block = program().getFragmentBlock(0);
JsFunction dummyFunc = newNamespace(namespace.getName());
JsBlock namespaceBlock = new JsBlock();
dummyFunc.setBody(namespaceBlock);
TranslationContext newContext = translationContext()
.newBlock(namespaceBlock).newScope(dummyFunc.getScope()).newNamespace(new JsNameRef(getJSName(namespace.getName())));
DeclarationTranslator declarationTranslator = new DeclarationTranslator(newContext);
for (JetDeclaration declaration : namespace.getDeclarations()) {
namespaceBlock.addStatement(declarationTranslator.translateDeclaration(declaration));
}
JsName namespaceName = Namer.getNameForNamespace(namespace.getName());
block.addStatement(namespaceInitStatement(namespaceName));
JsFunction dummyFunction = new JsFunction(scope());
TranslationContext newContext = translationContext().newNamespace(namespaceName, dummyFunction);
JsBlock namespaceDeclarations = translateDeclaration(namespace, newContext);
block.addStatement(AstUtil.convertToStatement(newNamespace(namespaceName, namespaceDeclarations, dummyFunction)));
return block;
}
public JsFunction newNamespace(String namespaceId) {
JsFunction result = new JsFunction(scope());
@NotNull
private JsBlock translateDeclaration(JetNamespace namespace, TranslationContext newContext) {
DeclarationTranslator declarationTranslator = new DeclarationTranslator(newContext);
JsBlock namespaceDeclarations = new JsBlock();
for (JetDeclaration declaration : namespace.getDeclarations()) {
namespaceDeclarations.addStatement(declarationTranslator.translateDeclaration(declaration));
}
return namespaceDeclarations;
}
private JsStatement namespaceInitStatement(JsName namespaceName) {
return AstUtil.convertToStatement(AstUtil.newAssignment(namespaceName.makeRef(), new JsObjectLiteral()));
}
public JsInvocation newNamespace(JsName name, JsBlock namespaceDeclarations, JsFunction dummyFunction) {
List<JsParameter> params = new ArrayList<JsParameter>();
params.add(new JsParameter(getJSName(namespaceId)));
result.setParameters(params);
JsExpression invocationParam = new JsNameRef(namespaceId);
block().addStatement(AstUtil.convertToStatement(AstUtil.newInvocation((result), invocationParam)));
return result;
params.add(new JsParameter(name));
dummyFunction.setParameters(params);
JsExpression invocationParam = name.makeRef();
dummyFunction.setBody(namespaceDeclarations);
return AstUtil.newInvocation(dummyFunction, invocationParam);
}
}
@@ -1,6 +1,5 @@
package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.JsBinaryOperation;
import com.google.dart.compiler.backend.js.ast.JsBinaryOperator;
import com.google.dart.compiler.backend.js.ast.JsOperator;
import org.jetbrains.jet.lexer.JetToken;
@@ -21,6 +20,12 @@ public final class OperationTranslator {
map.put(JetTokens.MINUS, JsBinaryOperator.SUB);
map.put(JetTokens.MUL, JsBinaryOperator.MUL);
map.put(JetTokens.DIV, JsBinaryOperator.DIV);
map.put(JetTokens.EQ, JsBinaryOperator.ASG);
map.put(JetTokens.GT, JsBinaryOperator.GT);
map.put(JetTokens.GTEQ, JsBinaryOperator.GTE);
map.put(JetTokens.LT, JsBinaryOperator.LT);
map.put(JetTokens.LTEQ, JsBinaryOperator.LTE);
map.put(JetTokens.EQEQ, JsBinaryOperator.EQ);
}
public static JsBinaryOperator getBinaryOperator(JetToken token) {
@@ -29,7 +34,7 @@ public final class OperationTranslator {
if (result instanceof JsBinaryOperator) {
return (JsBinaryOperator)result;
}
throw new AssertionError("Invalid map");
throw new AssertionError("Invalid map: shoild containd token: " + token.toString());
}
@@ -2,95 +2,104 @@ package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.util.AstUtil;
import com.sun.xml.internal.ws.wsdl.writer.document.Binding;
import org.apache.velocity.runtime.directive.Scope;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.resolve.BindingContext;
import java.awt.peer.ScrollbarPeer;
/**
* @author Talanov Pavel
*/
public class TranslationContext {
private final JsBlock currentBlock;
private final JsNameRef currentNamespace;
private final JsProgram program;
private final BindingContext context;
private final JsScope enclosingScope;
private final BindingContext bindingContext;
private final ContextType type;
private final JsNameRef classObjectReference;
private final JsNameRef classCreationMethodReference;
private final Scopes scopes;
private final JsName currentNamespace;
private TranslationContext(JsNameRef namespace, JsBlock block, JsProgram program,
BindingContext bindingContext, JsScope enclosingScope, ContextType type) {
assert block != null;
private static class Scopes {
public Scopes(JsScope enclosing, JsScope function, JsScope namespace) {
this.enclosingScope = enclosing;
this.functionScope = function;
this.namespaceScope = function;
}
public Scopes(Scopes other) {
this(other.enclosingScope, other.functionScope, other.namespaceScope);
}
public final JsScope enclosingScope;
public final JsScope functionScope;
public final JsScope namespaceScope;
}
private TranslationContext(JsName currentNamespace, JsProgram program,
BindingContext bindingContext, Scopes scopes, ContextType type) {
assert program != null;
assert bindingContext != null;
assert enclosingScope != null;
assert scopes != null;
assert currentNamespace != null;
assert type != null;
this.currentBlock = block;
this.currentNamespace = namespace;
this.program = program;
this.context = bindingContext;
this.enclosingScope = enclosingScope;
this.bindingContext = bindingContext;
this.type = type;
this.classObjectReference = new JsNameRef(getJSName("Class"));
this.classCreationMethodReference = AstUtil.newQualifiedNameRef("Class.create");
this.currentNamespace = currentNamespace;
this.scopes = scopes;
}
@NotNull
public static TranslationContext rootContext(JsProgram program, BindingContext bindingContext) {
return new TranslationContext(null, program.getFragmentBlock(0),
program, bindingContext, program.getRootScope(), ContextType.NAMESPACE_BODY);
JsScope rootScope = program.getRootScope();
Scopes scopes = new Scopes(rootScope, rootScope, rootScope);
return new TranslationContext(null,
program, bindingContext, scopes, ContextType.NAMESPACE_BODY);
}
//TODO implement correct factories
@NotNull
public TranslationContext newNamespace(JsNameRef newNamespace) {
return new TranslationContext(newNamespace, currentBlock, program,
context, enclosingScope, type);
public TranslationContext newNamespace(JsName namespaceName, JsFunction namespaceDummyFunction) {
JsScope newScope = namespaceDummyFunction.getScope();
Scopes newScopes = new Scopes(newScope, newScope, newScope);
return new TranslationContext(namespaceName, program,
bindingContext, newScopes, ContextType.NAMESPACE_BODY);
}
@NotNull
public TranslationContext newBlock(JsBlock newBlock) {
return new TranslationContext(currentNamespace, newBlock, program,
context, enclosingScope, type);
public TranslationContext newBlock() {
Scopes newScopes = new Scopes(new JsScope
(scopes.enclosingScope, "dummy enclosingScope for a block"), scopes.functionScope, scopes.namespaceScope);
return new TranslationContext(currentNamespace, program,
bindingContext, newScopes, type);
}
@NotNull
public TranslationContext newScope(JsScope newScope) {
return new TranslationContext(currentNamespace, currentBlock, program,
context, newScope, type);
public TranslationContext newFunction(JsFunction function) {
JsScope functionScope = function.getScope();
Scopes newScopes = new Scopes(functionScope, functionScope, scopes.namespaceScope);
return new TranslationContext(currentNamespace, program,
bindingContext, newScopes, ContextType.FUNCTION_BODY);
}
@NotNull
public TranslationContext newType(ContextType newType) {
return new TranslationContext(currentNamespace, currentBlock, program,
context, enclosingScope, newType);
}
@NotNull
public JsNameRef getQualifiedReference(JsName name) {
public JsNameRef getNamespaceQualifiedReference(JsName name) {
if (currentNamespace != null) {
return AstUtil.newNameRef(currentNamespace, name);
return AstUtil.newNameRef(currentNamespace.makeRef(), name);
}
return new JsNameRef(name);
}
@NotNull
public JsName getJSName(String jetName) {
//TODO dummy implemetation
return new JsName(program().getScope(), jetName, jetName, jetName);
}
@NotNull
public BindingContext bindingContext() {
return context;
}
@NotNull
public JsNameRef classObjectReference() {
return classObjectReference;
return bindingContext;
}
@NotNull
@@ -99,24 +108,12 @@ public class TranslationContext {
}
@NotNull
JsScope scope() {
return enclosingScope;
}
@NotNull
JsBlock block() {
return currentBlock;
JsScope enclosingScope() {
return scopes.enclosingScope;
}
@NotNull
ContextType type() {
return type;
}
@NotNull
JsNameRef classCreationMethodReference() {
return classCreationMethodReference;
}
}
@@ -1,23 +0,0 @@
package com.google.dart.compiler.backend.js;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.util.DefaultTextOutput;
import com.google.dart.compiler.util.TextOutput;
public class Test {
public static void main(String[] args) {
JsProgram program = new JsProgram("test");
JsNumberLiteral number = program.getNumberLiteral(2443.3);
//JsGlobalBlock globalBlock = new JsGlobalBlock(number);
TextOutput output = new DefaultTextOutput(false);
JsNameRef varStatement = new JsNameRef("variable");
JsBinaryOperation plus = new JsBinaryOperation(JsBinaryOperator.ADD, number, number);
JsBinaryOperation assign = new JsBinaryOperation(JsBinaryOperator.ASG, varStatement, plus);
JsSourceGenerationVisitor sourceGenerator =
new JsSourceGenerationVisitor(output);
sourceGenerator.visit(assign, null);
System.out.println(output.toString());
}
}
@@ -0,0 +1,72 @@
package org.jetbrains.k2js.test;
import org.jetbrains.k2js.K2JSTranslator;
import org.junit.Test;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.NativeObject;
import org.mozilla.javascript.Scriptable;
import java.io.FileReader;
import static org.junit.Assert.*;
/**
* @author Talanov Pavel
*/
public class TranslatorTests {
private final static String TEST_DIR = "test_files/test_cases/";
private void performTest(String inputFile) throws Exception {
K2JSTranslator.Arguments args = new K2JSTranslator.Arguments();
args.src = TEST_DIR + inputFile;
args.outputDir = getOutputFilename(TEST_DIR + inputFile);
K2JSTranslator.translate(args);
runWithRhino(args.outputDir);
}
private String getOutputFilename(String inputFile) {
return inputFile.substring(0, inputFile.lastIndexOf('.')) + ".js";
}
private void runWithRhino(String inputFile) throws Exception {
Context cx = Context.enter();
FileReader reader = new FileReader(inputFile);
try {
Scriptable scope = cx.initStandardObjects();
cx.evaluateReader(scope, reader, "test case", 1, null);
Object foo = scope.get("foo", scope);
assertTrue(foo instanceof NativeObject);
NativeObject namespaceObject = (NativeObject)foo;
Object box = namespaceObject.get("box", namespaceObject);
assertTrue(box instanceof Function);
Object functionArgs[] = {};
Function function = (Function) box;
Object result = function.call(cx, scope, scope, functionArgs);
String report = "foo.box() = " + Context.toString(result);
System.out.println(report);
} finally {
Context.exit();
reader.close();
}
}
@Test
public void test() throws Exception {
performTest("test.kt");
}
@Test
public void testAssign() throws Exception {
performTest("assign.jet");
}
@Test
public void namespaceProperties() throws Exception {
performTest("localProperty.jet");
}
}
-22
View File
@@ -1,22 +0,0 @@
namespace foo
var a : Int = 2
val b : Int = 235456
var c : Int = 1324
var myFavouriteName : Int = 1245
open class B() {
}
class A() : B() {
var a : Int
get() : Int {
return 4
}
set() {
}
}
+11
View File
@@ -0,0 +1,11 @@
namespace foo
fun f(): Int {
var x: Int = 1
x = x + 1
return x
}
fun box() : Boolean {
return (true)
}
+15
View File
@@ -0,0 +1,15 @@
namespace foo
val y = 3
fun f(a:Int) : Int {
val x = 42
val y = 50
return y
}
fun box() : Boolean
{
return (f(3) == 50)
}
+8
View File
@@ -0,0 +1,8 @@
namespace foo
fun box() : Boolean {
val a = 2;
val b = 3;
var c = 4;
return (a < c)
}