diff --git a/README.md b/README.md index ac2a1a7..39ecaa0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ -# JScript - -**NOTE: This had nothing to do with Microsoft's dialect of EcmaScript** +# J2S (Java-JavaScript or Java to JavaScript) **WARNING: Currently, this code is undocumented. Proceed with caution and a psychiatrist.** -JScript is an engine, capable of running EcmaScript 5, written entirely in Java. This engine has been developed with the goal of being easy to integrate with your preexisting codebase, **THE GOAL OF THIS ENGINE IS NOT PERFORMANCE**. My crude experiments show that this engine is 50x-100x slower than V8, which, although bad, is acceptable for most simple scripting purposes. Note that although the codebase has a Main class, this isn't meant to be a standalone program, but instead a library for running JavaScript code. +J2S is an engine, capable of running EcmaScript 5, written entirely in Java. This engine has been developed with the goal of being easy to integrate with your preexisting codebase, **THE GOAL OF THIS ENGINE IS NOT PERFORMANCE**. My crude experiments show that this engine is 50x-100x slower than V8, which, although bad, is acceptable for most simple scripting purposes. Note that although the codebase has a Main class, this isn't meant to be a standalone program, but instead a library for running JavaScript code. ## Example diff --git a/gradle.properties b/gradle.properties index f3df243..3751512 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ project_group = me.topchetoeu -project_name = jscript +project_name = j2s project_version = 0.10.0-beta -main_class = me.topchetoeu.jscript.repl.SimpleRepl +main_class = me.topchetoeu.j2s.repl.SimpleRepl diff --git a/src/main/java/me/topchetoeu/jscript/common/FunctionBody.java b/src/main/java/me/topchetoeu/j2s/common/FunctionBody.java similarity index 92% rename from src/main/java/me/topchetoeu/jscript/common/FunctionBody.java rename to src/main/java/me/topchetoeu/j2s/common/FunctionBody.java index b367ba3..90a7e2e 100644 --- a/src/main/java/me/topchetoeu/jscript/common/FunctionBody.java +++ b/src/main/java/me/topchetoeu/j2s/common/FunctionBody.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common; +package me.topchetoeu.j2s.common; public class FunctionBody { public final FunctionBody[] children; diff --git a/src/main/java/me/topchetoeu/jscript/common/Instruction.java b/src/main/java/me/topchetoeu/j2s/common/Instruction.java similarity index 95% rename from src/main/java/me/topchetoeu/jscript/common/Instruction.java rename to src/main/java/me/topchetoeu/j2s/common/Instruction.java index 00cdeae..372bea9 100644 --- a/src/main/java/me/topchetoeu/jscript/common/Instruction.java +++ b/src/main/java/me/topchetoeu/j2s/common/Instruction.java @@ -1,10 +1,10 @@ -package me.topchetoeu.jscript.common; +package me.topchetoeu.j2s.common; import java.util.HashMap; import java.util.function.IntFunction; import java.util.function.IntSupplier; -import me.topchetoeu.jscript.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.Location; public class Instruction { public static enum Type { diff --git a/src/main/java/me/topchetoeu/jscript/common/Metadata.java b/src/main/java/me/topchetoeu/j2s/common/Metadata.java similarity index 88% rename from src/main/java/me/topchetoeu/jscript/common/Metadata.java rename to src/main/java/me/topchetoeu/j2s/common/Metadata.java index fbd9f7c..35907de 100644 --- a/src/main/java/me/topchetoeu/jscript/common/Metadata.java +++ b/src/main/java/me/topchetoeu/j2s/common/Metadata.java @@ -1,6 +1,6 @@ -package me.topchetoeu.jscript.common; +package me.topchetoeu.j2s.common; -import me.topchetoeu.jscript.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSON; public class Metadata { private static final String VERSION; diff --git a/src/main/java/me/topchetoeu/jscript/common/Operation.java b/src/main/java/me/topchetoeu/j2s/common/Operation.java similarity index 95% rename from src/main/java/me/topchetoeu/jscript/common/Operation.java rename to src/main/java/me/topchetoeu/j2s/common/Operation.java index d616b3c..10285fa 100644 --- a/src/main/java/me/topchetoeu/jscript/common/Operation.java +++ b/src/main/java/me/topchetoeu/j2s/common/Operation.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common; +package me.topchetoeu.j2s.common; import java.util.HashMap; diff --git a/src/main/java/me/topchetoeu/jscript/common/Reading.java b/src/main/java/me/topchetoeu/j2s/common/Reading.java similarity index 98% rename from src/main/java/me/topchetoeu/jscript/common/Reading.java rename to src/main/java/me/topchetoeu/j2s/common/Reading.java index 91ed24d..c7eedf4 100644 --- a/src/main/java/me/topchetoeu/jscript/common/Reading.java +++ b/src/main/java/me/topchetoeu/j2s/common/Reading.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common; +package me.topchetoeu.j2s.common; import java.io.BufferedReader; import java.io.IOException; diff --git a/src/main/java/me/topchetoeu/jscript/common/SyntaxException.java b/src/main/java/me/topchetoeu/j2s/common/SyntaxException.java similarity index 74% rename from src/main/java/me/topchetoeu/jscript/common/SyntaxException.java rename to src/main/java/me/topchetoeu/j2s/common/SyntaxException.java index a510d77..4e21345 100644 --- a/src/main/java/me/topchetoeu/jscript/common/SyntaxException.java +++ b/src/main/java/me/topchetoeu/j2s/common/SyntaxException.java @@ -1,6 +1,6 @@ -package me.topchetoeu.jscript.common; +package me.topchetoeu.j2s.common; -import me.topchetoeu.jscript.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.Location; public class SyntaxException extends RuntimeException { public final Location loc; diff --git a/src/main/java/me/topchetoeu/jscript/common/environment/Environment.java b/src/main/java/me/topchetoeu/j2s/common/environment/Environment.java similarity index 97% rename from src/main/java/me/topchetoeu/jscript/common/environment/Environment.java rename to src/main/java/me/topchetoeu/j2s/common/environment/Environment.java index 33a77d4..9099640 100644 --- a/src/main/java/me/topchetoeu/jscript/common/environment/Environment.java +++ b/src/main/java/me/topchetoeu/j2s/common/environment/Environment.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.environment; +package me.topchetoeu.j2s.common.environment; import java.util.HashMap; import java.util.HashSet; diff --git a/src/main/java/me/topchetoeu/j2s/common/environment/Key.java b/src/main/java/me/topchetoeu/j2s/common/environment/Key.java new file mode 100644 index 0000000..a09adde --- /dev/null +++ b/src/main/java/me/topchetoeu/j2s/common/environment/Key.java @@ -0,0 +1,3 @@ +package me.topchetoeu.j2s.common.environment; + +public final class Key { } diff --git a/src/main/java/me/topchetoeu/jscript/common/json/JSON.java b/src/main/java/me/topchetoeu/j2s/common/json/JSON.java similarity index 91% rename from src/main/java/me/topchetoeu/jscript/common/json/JSON.java rename to src/main/java/me/topchetoeu/j2s/common/json/JSON.java index 83466bd..1cf678b 100644 --- a/src/main/java/me/topchetoeu/jscript/common/json/JSON.java +++ b/src/main/java/me/topchetoeu/j2s/common/json/JSON.java @@ -1,15 +1,16 @@ -package me.topchetoeu.jscript.common.json; +package me.topchetoeu.j2s.common.json; import java.math.BigDecimal; import java.util.HashMap; import java.util.stream.Collectors; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; +import me.topchetoeu.j2s.common.Metadata; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; public class JSON { public static ParseRes parseString(Source src, int i) { @@ -100,7 +101,7 @@ public class JSON { return ParseRes.res(JSONElement.list(values), n); } public static JSONElement parse(Filename filename, String raw) { - if (filename == null) filename = new Filename("jscript", "json"); + if (filename == null) filename = new Filename(Metadata.name(), "json"); var res = parseValue(new Source(null, filename, raw), 0); if (res.isFailed()) throw new SyntaxException(Location.of(filename, 0, 0), "Invalid JSON given"); diff --git a/src/main/java/me/topchetoeu/jscript/common/json/JSONElement.java b/src/main/java/me/topchetoeu/j2s/common/json/JSONElement.java similarity index 98% rename from src/main/java/me/topchetoeu/jscript/common/json/JSONElement.java rename to src/main/java/me/topchetoeu/j2s/common/json/JSONElement.java index b164158..ad18e67 100644 --- a/src/main/java/me/topchetoeu/jscript/common/json/JSONElement.java +++ b/src/main/java/me/topchetoeu/j2s/common/json/JSONElement.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.json; +package me.topchetoeu.j2s.common.json; public class JSONElement { public static enum Type { diff --git a/src/main/java/me/topchetoeu/jscript/common/json/JSONList.java b/src/main/java/me/topchetoeu/j2s/common/json/JSONList.java similarity index 95% rename from src/main/java/me/topchetoeu/jscript/common/json/JSONList.java rename to src/main/java/me/topchetoeu/j2s/common/json/JSONList.java index fb6c907..49a0c3b 100644 --- a/src/main/java/me/topchetoeu/jscript/common/json/JSONList.java +++ b/src/main/java/me/topchetoeu/j2s/common/json/JSONList.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.json; +package me.topchetoeu.j2s.common.json; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/me/topchetoeu/jscript/common/json/JSONMap.java b/src/main/java/me/topchetoeu/j2s/common/json/JSONMap.java similarity index 99% rename from src/main/java/me/topchetoeu/jscript/common/json/JSONMap.java rename to src/main/java/me/topchetoeu/j2s/common/json/JSONMap.java index 3659348..7a9e39e 100644 --- a/src/main/java/me/topchetoeu/jscript/common/json/JSONMap.java +++ b/src/main/java/me/topchetoeu/j2s/common/json/JSONMap.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.json; +package me.topchetoeu.j2s.common.json; import java.util.Collection; import java.util.HashMap; diff --git a/src/main/java/me/topchetoeu/jscript/common/mapping/FunctionMap.java b/src/main/java/me/topchetoeu/j2s/common/mapping/FunctionMap.java similarity index 96% rename from src/main/java/me/topchetoeu/jscript/common/mapping/FunctionMap.java rename to src/main/java/me/topchetoeu/j2s/common/mapping/FunctionMap.java index 3102bb6..aaca8fe 100644 --- a/src/main/java/me/topchetoeu/jscript/common/mapping/FunctionMap.java +++ b/src/main/java/me/topchetoeu/j2s/common/mapping/FunctionMap.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.mapping; +package me.topchetoeu.j2s.common.mapping; import java.util.ArrayList; import java.util.Arrays; @@ -13,9 +13,9 @@ import java.util.function.Function; import java.util.regex.Pattern; import java.util.stream.Collectors; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.common.parsing.Location; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.common.parsing.Location; public class FunctionMap { public static class FunctionMapBuilder { diff --git a/src/main/java/me/topchetoeu/jscript/common/parsing/Filename.java b/src/main/java/me/topchetoeu/j2s/common/parsing/Filename.java similarity index 96% rename from src/main/java/me/topchetoeu/jscript/common/parsing/Filename.java rename to src/main/java/me/topchetoeu/j2s/common/parsing/Filename.java index 39902e2..0bdc7e0 100644 --- a/src/main/java/me/topchetoeu/jscript/common/parsing/Filename.java +++ b/src/main/java/me/topchetoeu/j2s/common/parsing/Filename.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.parsing; +package me.topchetoeu.j2s.common.parsing; import java.io.File; diff --git a/src/main/java/me/topchetoeu/jscript/common/parsing/Location.java b/src/main/java/me/topchetoeu/j2s/common/parsing/Location.java similarity index 92% rename from src/main/java/me/topchetoeu/jscript/common/parsing/Location.java rename to src/main/java/me/topchetoeu/j2s/common/parsing/Location.java index e9bae27..cc2eadd 100644 --- a/src/main/java/me/topchetoeu/jscript/common/parsing/Location.java +++ b/src/main/java/me/topchetoeu/j2s/common/parsing/Location.java @@ -1,10 +1,12 @@ -package me.topchetoeu.jscript.common.parsing; +package me.topchetoeu.j2s.common.parsing; import java.util.ArrayList; import java.util.Objects; +import me.topchetoeu.j2s.common.Metadata; + public abstract class Location implements Comparable { - public static final Location INTERNAL = Location.of(new Filename("jscript", "native"), -1, -1); + public static final Location INTERNAL = Location.of(new Filename(Metadata.name(), "native"), -1, -1); public abstract int line(); public abstract int start(); diff --git a/src/main/java/me/topchetoeu/jscript/common/parsing/ParseRes.java b/src/main/java/me/topchetoeu/j2s/common/parsing/ParseRes.java similarity index 98% rename from src/main/java/me/topchetoeu/jscript/common/parsing/ParseRes.java rename to src/main/java/me/topchetoeu/j2s/common/parsing/ParseRes.java index 05ec4a1..9d632cf 100644 --- a/src/main/java/me/topchetoeu/jscript/common/parsing/ParseRes.java +++ b/src/main/java/me/topchetoeu/j2s/common/parsing/ParseRes.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.parsing; +package me.topchetoeu.j2s.common.parsing; public class ParseRes { public static enum State { diff --git a/src/main/java/me/topchetoeu/jscript/common/parsing/Parser.java b/src/main/java/me/topchetoeu/j2s/common/parsing/Parser.java similarity index 62% rename from src/main/java/me/topchetoeu/jscript/common/parsing/Parser.java rename to src/main/java/me/topchetoeu/j2s/common/parsing/Parser.java index 6d298c2..7be6041 100644 --- a/src/main/java/me/topchetoeu/jscript/common/parsing/Parser.java +++ b/src/main/java/me/topchetoeu/j2s/common/parsing/Parser.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.parsing; +package me.topchetoeu.j2s.common.parsing; public interface Parser { public ParseRes parse(Source src, int i); diff --git a/src/main/java/me/topchetoeu/jscript/common/parsing/Parsing.java b/src/main/java/me/topchetoeu/j2s/common/parsing/Parsing.java similarity index 98% rename from src/main/java/me/topchetoeu/jscript/common/parsing/Parsing.java rename to src/main/java/me/topchetoeu/j2s/common/parsing/Parsing.java index 18be783..6fae150 100644 --- a/src/main/java/me/topchetoeu/jscript/common/parsing/Parsing.java +++ b/src/main/java/me/topchetoeu/j2s/common/parsing/Parsing.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.common.parsing; +package me.topchetoeu.j2s.common.parsing; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.compilation.values.constants.NumberNode; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.compilation.values.constants.NumberNode; public class Parsing { public static boolean isDigit(Character c) { diff --git a/src/main/java/me/topchetoeu/jscript/common/parsing/Source.java b/src/main/java/me/topchetoeu/j2s/common/parsing/Source.java similarity index 94% rename from src/main/java/me/topchetoeu/jscript/common/parsing/Source.java rename to src/main/java/me/topchetoeu/j2s/common/parsing/Source.java index e744d4d..531778e 100644 --- a/src/main/java/me/topchetoeu/jscript/common/parsing/Source.java +++ b/src/main/java/me/topchetoeu/j2s/common/parsing/Source.java @@ -1,8 +1,8 @@ -package me.topchetoeu.jscript.common.parsing; +package me.topchetoeu.j2s.common.parsing; import java.util.function.Predicate; -import me.topchetoeu.jscript.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Environment; public class Source { public final Environment env; diff --git a/src/main/java/me/topchetoeu/jscript/common/parsing/SourceLocation.java b/src/main/java/me/topchetoeu/j2s/common/parsing/SourceLocation.java similarity index 96% rename from src/main/java/me/topchetoeu/jscript/common/parsing/SourceLocation.java rename to src/main/java/me/topchetoeu/j2s/common/parsing/SourceLocation.java index c362f78..be9b083 100644 --- a/src/main/java/me/topchetoeu/jscript/common/parsing/SourceLocation.java +++ b/src/main/java/me/topchetoeu/j2s/common/parsing/SourceLocation.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.common.parsing; +package me.topchetoeu.j2s.common.parsing; import java.util.Objects; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/CompileResult.java b/src/main/java/me/topchetoeu/j2s/compilation/CompileResult.java similarity index 83% rename from src/main/java/me/topchetoeu/jscript/compilation/CompileResult.java rename to src/main/java/me/topchetoeu/j2s/compilation/CompileResult.java index 2378f40..89a6874 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/CompileResult.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/CompileResult.java @@ -1,24 +1,25 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.List; import java.util.Map; import java.util.function.Function; + +import me.topchetoeu.j2s.common.FunctionBody; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.common.mapping.FunctionMap; +import me.topchetoeu.j2s.common.mapping.FunctionMap.FunctionMapBuilder; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.control.TryNode; +import me.topchetoeu.j2s.compilation.scope.FunctionScope; +import me.topchetoeu.j2s.compilation.scope.Variable; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; -import me.topchetoeu.jscript.common.FunctionBody; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.common.mapping.FunctionMap; -import me.topchetoeu.jscript.common.mapping.FunctionMap.FunctionMapBuilder; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.control.TryNode; -import me.topchetoeu.jscript.compilation.scope.FunctionScope; -import me.topchetoeu.jscript.compilation.scope.Variable; - public final class CompileResult { public static final Key DEBUG_LOG = new Key<>(); diff --git a/src/main/java/me/topchetoeu/jscript/compilation/CompoundNode.java b/src/main/java/me/topchetoeu/j2s/compilation/CompoundNode.java similarity index 85% rename from src/main/java/me/topchetoeu/jscript/compilation/CompoundNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/CompoundNode.java index c347bab..7daca70 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/CompoundNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/CompoundNode.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; public class CompoundNode extends Node { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/DeferredIntSupplier.java b/src/main/java/me/topchetoeu/j2s/compilation/DeferredIntSupplier.java similarity index 91% rename from src/main/java/me/topchetoeu/jscript/compilation/DeferredIntSupplier.java rename to src/main/java/me/topchetoeu/j2s/compilation/DeferredIntSupplier.java index dbb7eed..ddb08f1 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/DeferredIntSupplier.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/DeferredIntSupplier.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.function.IntSupplier; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/FunctionNode.java b/src/main/java/me/topchetoeu/j2s/compilation/FunctionNode.java similarity index 87% rename from src/main/java/me/topchetoeu/jscript/compilation/FunctionNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/FunctionNode.java index 8bfbcc0..f41e88d 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/FunctionNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/FunctionNode.java @@ -1,16 +1,16 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.List; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.scope.FunctionScope; -import me.topchetoeu.jscript.compilation.values.VariableNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.scope.FunctionScope; +import me.topchetoeu.j2s.compilation.values.VariableNode; public abstract class FunctionNode extends Node { public final CompoundNode body; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/FunctionStatementNode.java b/src/main/java/me/topchetoeu/j2s/compilation/FunctionStatementNode.java similarity index 74% rename from src/main/java/me/topchetoeu/jscript/compilation/FunctionStatementNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/FunctionStatementNode.java index b1f7230..0ade941 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/FunctionStatementNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/FunctionStatementNode.java @@ -1,12 +1,12 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.List; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.scope.Variable; -import me.topchetoeu.jscript.compilation.values.VariableNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.scope.Variable; +import me.topchetoeu.j2s.compilation.values.VariableNode; public class FunctionStatementNode extends FunctionNode { public final String name; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/FunctionValueNode.java b/src/main/java/me/topchetoeu/j2s/compilation/FunctionValueNode.java similarity index 72% rename from src/main/java/me/topchetoeu/jscript/compilation/FunctionValueNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/FunctionValueNode.java index dbc2787..27064d6 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/FunctionValueNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/FunctionValueNode.java @@ -1,11 +1,11 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.List; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.values.VariableNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.values.VariableNode; public class FunctionValueNode extends FunctionNode { public final String name; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/JavaScript.java b/src/main/java/me/topchetoeu/j2s/compilation/JavaScript.java similarity index 78% rename from src/main/java/me/topchetoeu/jscript/compilation/JavaScript.java rename to src/main/java/me/topchetoeu/j2s/compilation/JavaScript.java index 2f2930c..1563482 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/JavaScript.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/JavaScript.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.ArrayList; import java.util.Arrays; @@ -6,45 +6,45 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.control.BreakNode; -import me.topchetoeu.jscript.compilation.control.ContinueNode; -import me.topchetoeu.jscript.compilation.control.DebugNode; -import me.topchetoeu.jscript.compilation.control.DeleteNode; -import me.topchetoeu.jscript.compilation.control.DoWhileNode; -import me.topchetoeu.jscript.compilation.control.ForInNode; -import me.topchetoeu.jscript.compilation.control.ForNode; -import me.topchetoeu.jscript.compilation.control.IfNode; -import me.topchetoeu.jscript.compilation.control.ReturnNode; -import me.topchetoeu.jscript.compilation.control.SwitchNode; -import me.topchetoeu.jscript.compilation.control.ThrowNode; -import me.topchetoeu.jscript.compilation.control.TryNode; -import me.topchetoeu.jscript.compilation.control.WhileNode; -import me.topchetoeu.jscript.compilation.scope.FunctionScope; -import me.topchetoeu.jscript.compilation.values.ArgumentsNode; -import me.topchetoeu.jscript.compilation.values.ArrayNode; -import me.topchetoeu.jscript.compilation.values.GlobalThisNode; -import me.topchetoeu.jscript.compilation.values.ObjectNode; -import me.topchetoeu.jscript.compilation.values.RegexNode; -import me.topchetoeu.jscript.compilation.values.ThisNode; -import me.topchetoeu.jscript.compilation.values.VariableNode; -import me.topchetoeu.jscript.compilation.values.constants.BoolNode; -import me.topchetoeu.jscript.compilation.values.constants.NullNode; -import me.topchetoeu.jscript.compilation.values.constants.NumberNode; -import me.topchetoeu.jscript.compilation.values.constants.StringNode; -import me.topchetoeu.jscript.compilation.values.operations.CallNode; -import me.topchetoeu.jscript.compilation.values.operations.ChangeNode; -import me.topchetoeu.jscript.compilation.values.operations.DiscardNode; -import me.topchetoeu.jscript.compilation.values.operations.IndexNode; -import me.topchetoeu.jscript.compilation.values.operations.OperationNode; -import me.topchetoeu.jscript.compilation.values.operations.PostfixNode; -import me.topchetoeu.jscript.compilation.values.operations.TypeofNode; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.control.BreakNode; +import me.topchetoeu.j2s.compilation.control.ContinueNode; +import me.topchetoeu.j2s.compilation.control.DebugNode; +import me.topchetoeu.j2s.compilation.control.DeleteNode; +import me.topchetoeu.j2s.compilation.control.DoWhileNode; +import me.topchetoeu.j2s.compilation.control.ForInNode; +import me.topchetoeu.j2s.compilation.control.ForNode; +import me.topchetoeu.j2s.compilation.control.IfNode; +import me.topchetoeu.j2s.compilation.control.ReturnNode; +import me.topchetoeu.j2s.compilation.control.SwitchNode; +import me.topchetoeu.j2s.compilation.control.ThrowNode; +import me.topchetoeu.j2s.compilation.control.TryNode; +import me.topchetoeu.j2s.compilation.control.WhileNode; +import me.topchetoeu.j2s.compilation.scope.FunctionScope; +import me.topchetoeu.j2s.compilation.values.ArgumentsNode; +import me.topchetoeu.j2s.compilation.values.ArrayNode; +import me.topchetoeu.j2s.compilation.values.GlobalThisNode; +import me.topchetoeu.j2s.compilation.values.ObjectNode; +import me.topchetoeu.j2s.compilation.values.RegexNode; +import me.topchetoeu.j2s.compilation.values.ThisNode; +import me.topchetoeu.j2s.compilation.values.VariableNode; +import me.topchetoeu.j2s.compilation.values.constants.BoolNode; +import me.topchetoeu.j2s.compilation.values.constants.NullNode; +import me.topchetoeu.j2s.compilation.values.constants.NumberNode; +import me.topchetoeu.j2s.compilation.values.constants.StringNode; +import me.topchetoeu.j2s.compilation.values.operations.CallNode; +import me.topchetoeu.j2s.compilation.values.operations.ChangeNode; +import me.topchetoeu.j2s.compilation.values.operations.DiscardNode; +import me.topchetoeu.j2s.compilation.values.operations.IndexNode; +import me.topchetoeu.j2s.compilation.values.operations.OperationNode; +import me.topchetoeu.j2s.compilation.values.operations.PostfixNode; +import me.topchetoeu.j2s.compilation.values.operations.TypeofNode; public final class JavaScript { public static enum DeclarationType { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/LabelContext.java b/src/main/java/me/topchetoeu/j2s/compilation/LabelContext.java similarity index 91% rename from src/main/java/me/topchetoeu/jscript/compilation/LabelContext.java rename to src/main/java/me/topchetoeu/j2s/compilation/LabelContext.java index 64d5d76..e9aca45 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/LabelContext.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/LabelContext.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.function.IntSupplier; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.common.parsing.Location; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.common.parsing.Location; public class LabelContext { public static final Key BREAK_CTX = new Key<>(); diff --git a/src/main/java/me/topchetoeu/jscript/compilation/Node.java b/src/main/java/me/topchetoeu/j2s/compilation/Node.java similarity index 77% rename from src/main/java/me/topchetoeu/jscript/compilation/Node.java rename to src/main/java/me/topchetoeu/j2s/compilation/Node.java index 071c904..8fb5e8a 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/Node.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/Node.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; public abstract class Node { private Location loc; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/NodeChildren.java b/src/main/java/me/topchetoeu/j2s/compilation/NodeChildren.java similarity index 93% rename from src/main/java/me/topchetoeu/jscript/compilation/NodeChildren.java rename to src/main/java/me/topchetoeu/j2s/compilation/NodeChildren.java index b912517..75c54ec 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/NodeChildren.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/NodeChildren.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.ArrayList; import java.util.Iterator; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/Parameter.java b/src/main/java/me/topchetoeu/j2s/compilation/Parameter.java similarity index 70% rename from src/main/java/me/topchetoeu/jscript/compilation/Parameter.java rename to src/main/java/me/topchetoeu/j2s/compilation/Parameter.java index 09f8ed6..65cf3b2 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/Parameter.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/Parameter.java @@ -1,6 +1,6 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; -import me.topchetoeu.jscript.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.Location; public final class Parameter { public final Location loc; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/VariableDeclareNode.java b/src/main/java/me/topchetoeu/j2s/compilation/VariableDeclareNode.java similarity index 88% rename from src/main/java/me/topchetoeu/jscript/compilation/VariableDeclareNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/VariableDeclareNode.java index 6e8ac68..833a8f2 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/VariableDeclareNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/VariableDeclareNode.java @@ -1,16 +1,16 @@ -package me.topchetoeu.jscript.compilation; +package me.topchetoeu.j2s.compilation; import java.util.ArrayList; import java.util.List; import com.github.bsideup.jabel.Desugar; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.values.VariableNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.values.VariableNode; public class VariableDeclareNode extends Node { @Desugar diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/BreakNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/BreakNode.java similarity index 70% rename from src/main/java/me/topchetoeu/jscript/compilation/control/BreakNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/BreakNode.java index c2e00a9..377ca8b 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/BreakNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/BreakNode.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; public class BreakNode extends Node { public final String label; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/ContinueNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/ContinueNode.java similarity index 70% rename from src/main/java/me/topchetoeu/jscript/compilation/control/ContinueNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/ContinueNode.java index b40085c..f823c85 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/ContinueNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/ContinueNode.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; public class ContinueNode extends Node { public final String label; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/DebugNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/DebugNode.java similarity index 62% rename from src/main/java/me/topchetoeu/jscript/compilation/control/DebugNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/DebugNode.java index c5a97df..80e0aaa 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/DebugNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/DebugNode.java @@ -1,13 +1,13 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; public class DebugNode extends Node { @Override public void compileFunctions(CompileResult target) { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/DeleteNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/DeleteNode.java similarity index 66% rename from src/main/java/me/topchetoeu/jscript/compilation/control/DeleteNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/DeleteNode.java index d97eba4..9872219 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/DeleteNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/DeleteNode.java @@ -1,16 +1,16 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.values.VariableNode; -import me.topchetoeu.jscript.compilation.values.constants.BoolNode; -import me.topchetoeu.jscript.compilation.values.operations.IndexNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.values.VariableNode; +import me.topchetoeu.j2s.compilation.values.constants.BoolNode; +import me.topchetoeu.j2s.compilation.values.operations.IndexNode; public class DeleteNode extends Node { public final Node key; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/DoWhileNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/DoWhileNode.java similarity index 78% rename from src/main/java/me/topchetoeu/jscript/compilation/control/DoWhileNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/DoWhileNode.java index abf42ee..2ec5e78 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/DoWhileNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/DoWhileNode.java @@ -1,16 +1,16 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.DeferredIntSupplier; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.DeferredIntSupplier; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; public class DoWhileNode extends Node { public final Node condition, body; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/ForInNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/ForInNode.java similarity index 82% rename from src/main/java/me/topchetoeu/jscript/compilation/control/ForInNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/ForInNode.java index 1af9179..4238059 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/ForInNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/ForInNode.java @@ -1,17 +1,17 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.DeferredIntSupplier; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.values.VariableNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.DeferredIntSupplier; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.values.VariableNode; public class ForInNode extends Node { public final boolean isDecl; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/ForNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/ForNode.java similarity index 84% rename from src/main/java/me/topchetoeu/jscript/compilation/control/ForNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/ForNode.java index 8449c5f..71ce3b8 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/ForNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/ForNode.java @@ -1,17 +1,17 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.DeferredIntSupplier; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.VariableDeclareNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.DeferredIntSupplier; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.VariableDeclareNode; public class ForNode extends Node { public final Node declaration, assignment, condition, body; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/IfNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/IfNode.java similarity index 86% rename from src/main/java/me/topchetoeu/jscript/compilation/control/IfNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/IfNode.java index a588a52..1b3f805 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/IfNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/IfNode.java @@ -1,16 +1,16 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.DeferredIntSupplier; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.DeferredIntSupplier; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; public class IfNode extends Node { public final Node condition, body, elseBody; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/ReturnNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/ReturnNode.java similarity index 72% rename from src/main/java/me/topchetoeu/jscript/compilation/control/ReturnNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/ReturnNode.java index 2674552..c5ee1b0 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/ReturnNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/ReturnNode.java @@ -1,13 +1,13 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; public class ReturnNode extends Node { public final Node value; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/SwitchNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/SwitchNode.java similarity index 88% rename from src/main/java/me/topchetoeu/jscript/compilation/control/SwitchNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/SwitchNode.java index cb896f9..8465ee1 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/SwitchNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/SwitchNode.java @@ -1,20 +1,20 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; import java.util.ArrayList; import java.util.HashMap; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Operation; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.DeferredIntSupplier; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Operation; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.DeferredIntSupplier; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; public class SwitchNode extends Node { public static class SwitchCase { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/ThrowNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/ThrowNode.java similarity index 68% rename from src/main/java/me/topchetoeu/jscript/compilation/control/ThrowNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/ThrowNode.java index 3c6459f..87e06f3 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/ThrowNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/ThrowNode.java @@ -1,13 +1,13 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; public class ThrowNode extends Node { public final Node value; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/TryNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/TryNode.java similarity index 86% rename from src/main/java/me/topchetoeu/jscript/compilation/control/TryNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/TryNode.java index 52602d6..68ea2da 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/TryNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/TryNode.java @@ -1,17 +1,17 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.CompoundNode; -import me.topchetoeu.jscript.compilation.DeferredIntSupplier; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.CompoundNode; +import me.topchetoeu.j2s.compilation.DeferredIntSupplier; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; public class TryNode extends Node { public final CompoundNode tryBody; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/control/WhileNode.java b/src/main/java/me/topchetoeu/j2s/compilation/control/WhileNode.java similarity index 76% rename from src/main/java/me/topchetoeu/jscript/compilation/control/WhileNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/control/WhileNode.java index b687f2a..b6e9136 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/control/WhileNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/control/WhileNode.java @@ -1,16 +1,16 @@ -package me.topchetoeu.jscript.compilation.control; +package me.topchetoeu.j2s.compilation.control; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.DeferredIntSupplier; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.LabelContext; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.DeferredIntSupplier; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.LabelContext; +import me.topchetoeu.j2s.compilation.Node; public class WhileNode extends Node { public final Node condition, body; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/members/FieldMemberNode.java b/src/main/java/me/topchetoeu/j2s/compilation/members/FieldMemberNode.java similarity index 71% rename from src/main/java/me/topchetoeu/jscript/compilation/members/FieldMemberNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/members/FieldMemberNode.java index 4c3fe1e..d871a4d 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/members/FieldMemberNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/members/FieldMemberNode.java @@ -1,14 +1,14 @@ -package me.topchetoeu.jscript.compilation.members; +package me.topchetoeu.j2s.compilation.members; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.values.ObjectNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.values.ObjectNode; public class FieldMemberNode implements Member { public final Location loc; diff --git a/src/main/java/me/topchetoeu/j2s/compilation/members/Member.java b/src/main/java/me/topchetoeu/j2s/compilation/members/Member.java new file mode 100644 index 0000000..c15adbd --- /dev/null +++ b/src/main/java/me/topchetoeu/j2s/compilation/members/Member.java @@ -0,0 +1,11 @@ +package me.topchetoeu.j2s.compilation.members; + +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; + +public interface Member { + Location loc(); + + void compileFunctions(CompileResult target); + void compile(CompileResult target, boolean pollute); +} diff --git a/src/main/java/me/topchetoeu/jscript/compilation/members/PropertyMemberNode.java b/src/main/java/me/topchetoeu/j2s/compilation/members/PropertyMemberNode.java similarity index 75% rename from src/main/java/me/topchetoeu/jscript/compilation/members/PropertyMemberNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/members/PropertyMemberNode.java index 6be7ee0..dd32cb2 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/members/PropertyMemberNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/members/PropertyMemberNode.java @@ -1,21 +1,21 @@ -package me.topchetoeu.jscript.compilation.members; +package me.topchetoeu.j2s.compilation.members; import java.util.Arrays; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.CompoundNode; -import me.topchetoeu.jscript.compilation.FunctionNode; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.values.ObjectNode; -import me.topchetoeu.jscript.compilation.values.VariableNode; -import me.topchetoeu.jscript.compilation.values.constants.StringNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.CompoundNode; +import me.topchetoeu.j2s.compilation.FunctionNode; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.values.ObjectNode; +import me.topchetoeu.j2s.compilation.values.VariableNode; +import me.topchetoeu.j2s.compilation.values.constants.StringNode; public final class PropertyMemberNode extends FunctionNode implements Member { public final Node key; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/patterns/AssignTarget.java b/src/main/java/me/topchetoeu/j2s/compilation/patterns/AssignTarget.java similarity index 79% rename from src/main/java/me/topchetoeu/jscript/compilation/patterns/AssignTarget.java rename to src/main/java/me/topchetoeu/j2s/compilation/patterns/AssignTarget.java index 0d78a4d..676cad2 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/patterns/AssignTarget.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/patterns/AssignTarget.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.compilation.patterns; +package me.topchetoeu.j2s.compilation.patterns; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; /** * Represents all nodes that can be assign targets diff --git a/src/main/java/me/topchetoeu/jscript/compilation/patterns/AssignTargetLike.java b/src/main/java/me/topchetoeu/j2s/compilation/patterns/AssignTargetLike.java similarity index 70% rename from src/main/java/me/topchetoeu/jscript/compilation/patterns/AssignTargetLike.java rename to src/main/java/me/topchetoeu/j2s/compilation/patterns/AssignTargetLike.java index 4c329c2..7cc22e8 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/patterns/AssignTargetLike.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/patterns/AssignTargetLike.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.compilation.patterns; +package me.topchetoeu.j2s.compilation.patterns; /** * Represents all nodes that can be converted to assign targets diff --git a/src/main/java/me/topchetoeu/j2s/compilation/patterns/ChangeTarget.java b/src/main/java/me/topchetoeu/j2s/compilation/patterns/ChangeTarget.java new file mode 100644 index 0000000..c41b561 --- /dev/null +++ b/src/main/java/me/topchetoeu/j2s/compilation/patterns/ChangeTarget.java @@ -0,0 +1,7 @@ +package me.topchetoeu.j2s.compilation.patterns; + +import me.topchetoeu.j2s.compilation.CompileResult; + +public interface ChangeTarget extends AssignTarget { + void beforeChange(CompileResult target); +} diff --git a/src/main/java/me/topchetoeu/jscript/compilation/scope/FunctionScope.java b/src/main/java/me/topchetoeu/j2s/compilation/scope/FunctionScope.java similarity index 99% rename from src/main/java/me/topchetoeu/jscript/compilation/scope/FunctionScope.java rename to src/main/java/me/topchetoeu/j2s/compilation/scope/FunctionScope.java index 25122e2..bb5ebee 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/scope/FunctionScope.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/scope/FunctionScope.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.compilation.scope; +package me.topchetoeu.j2s.compilation.scope; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/scope/Variable.java b/src/main/java/me/topchetoeu/j2s/compilation/scope/Variable.java similarity index 94% rename from src/main/java/me/topchetoeu/jscript/compilation/scope/Variable.java rename to src/main/java/me/topchetoeu/j2s/compilation/scope/Variable.java index 8faf42f..6dabc40 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/scope/Variable.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/scope/Variable.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.compilation.scope; +package me.topchetoeu.j2s.compilation.scope; import java.util.function.Supplier; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/scope/VariableIndex.java b/src/main/java/me/topchetoeu/j2s/compilation/scope/VariableIndex.java similarity index 93% rename from src/main/java/me/topchetoeu/jscript/compilation/scope/VariableIndex.java rename to src/main/java/me/topchetoeu/j2s/compilation/scope/VariableIndex.java index ed54ce5..809037d 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/scope/VariableIndex.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/scope/VariableIndex.java @@ -1,6 +1,6 @@ -package me.topchetoeu.jscript.compilation.scope; +package me.topchetoeu.j2s.compilation.scope; -import me.topchetoeu.jscript.common.Instruction; +import me.topchetoeu.j2s.common.Instruction; public final class VariableIndex { public static enum IndexType { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/scope/VariableList.java b/src/main/java/me/topchetoeu/j2s/compilation/scope/VariableList.java similarity index 97% rename from src/main/java/me/topchetoeu/jscript/compilation/scope/VariableList.java rename to src/main/java/me/topchetoeu/j2s/compilation/scope/VariableList.java index a2fafbf..20febba 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/scope/VariableList.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/scope/VariableList.java @@ -1,11 +1,11 @@ -package me.topchetoeu.jscript.compilation.scope; +package me.topchetoeu.j2s.compilation.scope; import java.util.HashMap; import java.util.Iterator; import java.util.function.IntSupplier; import java.util.function.Supplier; -import me.topchetoeu.jscript.compilation.scope.VariableIndex.IndexType; +import me.topchetoeu.j2s.compilation.scope.VariableIndex.IndexType; public final class VariableList implements Iterable { private final class VariableNode implements Supplier { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/ArgumentsNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/ArgumentsNode.java similarity index 53% rename from src/main/java/me/topchetoeu/jscript/compilation/values/ArgumentsNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/ArgumentsNode.java index 3508d35..4cdeb1e 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/ArgumentsNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/ArgumentsNode.java @@ -1,9 +1,9 @@ -package me.topchetoeu.jscript.compilation.values; +package me.topchetoeu.j2s.compilation.values; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; public class ArgumentsNode extends Node { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/ArrayNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/ArrayNode.java similarity index 78% rename from src/main/java/me/topchetoeu/jscript/compilation/values/ArrayNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/ArrayNode.java index 35962d5..6525e4d 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/ArrayNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/ArrayNode.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.compilation.values; +package me.topchetoeu.j2s.compilation.values; import java.util.ArrayList; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; public class ArrayNode extends Node { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/GlobalThisNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/GlobalThisNode.java similarity index 53% rename from src/main/java/me/topchetoeu/jscript/compilation/values/GlobalThisNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/GlobalThisNode.java index fde1966..5b6cd5c 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/GlobalThisNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/GlobalThisNode.java @@ -1,9 +1,9 @@ -package me.topchetoeu.jscript.compilation.values; +package me.topchetoeu.j2s.compilation.values; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; public class GlobalThisNode extends Node { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/ObjectNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/ObjectNode.java similarity index 76% rename from src/main/java/me/topchetoeu/jscript/compilation/values/ObjectNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/ObjectNode.java index de71814..c234a4d 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/ObjectNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/ObjectNode.java @@ -1,21 +1,21 @@ -package me.topchetoeu.jscript.compilation.values; +package me.topchetoeu.j2s.compilation.values; import java.util.LinkedList; import java.util.List; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.members.FieldMemberNode; -import me.topchetoeu.jscript.compilation.members.Member; -import me.topchetoeu.jscript.compilation.members.PropertyMemberNode; -import me.topchetoeu.jscript.compilation.values.constants.NumberNode; -import me.topchetoeu.jscript.compilation.values.constants.StringNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.members.FieldMemberNode; +import me.topchetoeu.j2s.compilation.members.Member; +import me.topchetoeu.j2s.compilation.members.PropertyMemberNode; +import me.topchetoeu.j2s.compilation.values.constants.NumberNode; +import me.topchetoeu.j2s.compilation.values.constants.StringNode; public class ObjectNode extends Node { public final List members; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/RegexNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/RegexNode.java similarity index 80% rename from src/main/java/me/topchetoeu/jscript/compilation/values/RegexNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/RegexNode.java index 90545a7..04b353c 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/RegexNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/RegexNode.java @@ -1,12 +1,12 @@ -package me.topchetoeu.jscript.compilation.values; +package me.topchetoeu.j2s.compilation.values; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; public class RegexNode extends Node { public final String pattern, flags; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/ThisNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/ThisNode.java similarity index 52% rename from src/main/java/me/topchetoeu/jscript/compilation/values/ThisNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/ThisNode.java index af466b8..77d53c8 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/ThisNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/ThisNode.java @@ -1,9 +1,9 @@ -package me.topchetoeu.jscript.compilation.values; +package me.topchetoeu.j2s.compilation.values; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; public class ThisNode extends Node { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/VariableNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/VariableNode.java similarity index 79% rename from src/main/java/me/topchetoeu/jscript/compilation/values/VariableNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/VariableNode.java index 823baca..0e8fe10 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/VariableNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/VariableNode.java @@ -1,14 +1,14 @@ -package me.topchetoeu.jscript.compilation.values; +package me.topchetoeu.j2s.compilation.values; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.patterns.ChangeTarget; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.patterns.ChangeTarget; public class VariableNode extends Node implements ChangeTarget { public final String name; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/constants/BoolNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/constants/BoolNode.java similarity index 57% rename from src/main/java/me/topchetoeu/jscript/compilation/values/constants/BoolNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/constants/BoolNode.java index 262f8ec..19447eb 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/constants/BoolNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/constants/BoolNode.java @@ -1,9 +1,9 @@ -package me.topchetoeu.jscript.compilation.values.constants; +package me.topchetoeu.j2s.compilation.values.constants; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; public class BoolNode extends Node { public final boolean value; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/constants/NullNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/constants/NullNode.java similarity index 51% rename from src/main/java/me/topchetoeu/jscript/compilation/values/constants/NullNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/constants/NullNode.java index 90d8a60..b48ee3d 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/constants/NullNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/constants/NullNode.java @@ -1,9 +1,9 @@ -package me.topchetoeu.jscript.compilation.values.constants; +package me.topchetoeu.j2s.compilation.values.constants; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; public class NullNode extends Node { @Override public void compileFunctions(CompileResult target) { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/constants/NumberNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/constants/NumberNode.java similarity index 67% rename from src/main/java/me/topchetoeu/jscript/compilation/values/constants/NumberNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/constants/NumberNode.java index a0a4fa6..b45053c 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/constants/NumberNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/constants/NumberNode.java @@ -1,12 +1,12 @@ -package me.topchetoeu.jscript.compilation.values.constants; +package me.topchetoeu.j2s.compilation.values.constants; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; public class NumberNode extends Node { public final double value; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/constants/StringNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/constants/StringNode.java similarity index 60% rename from src/main/java/me/topchetoeu/jscript/compilation/values/constants/StringNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/constants/StringNode.java index 23187a0..05f3ffb 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/constants/StringNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/constants/StringNode.java @@ -1,12 +1,12 @@ -package me.topchetoeu.jscript.compilation.values.constants; +package me.topchetoeu.j2s.compilation.values.constants; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; public class StringNode extends Node { public final String value; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/AssignNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/AssignNode.java similarity index 76% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/AssignNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/AssignNode.java index 292ce2e..2f95dc9 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/AssignNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/AssignNode.java @@ -1,12 +1,12 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Operation; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.patterns.AssignTarget; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Operation; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.patterns.AssignTarget; public class AssignNode extends Node implements AssignTarget { public final AssignTarget assignable; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/CallNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/CallNode.java similarity index 85% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/CallNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/CallNode.java index 3b91b61..dfae0ed 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/CallNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/CallNode.java @@ -1,16 +1,16 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; import java.util.ArrayList; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; public class CallNode extends Node { public final Node func; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/ChangeNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/ChangeNode.java similarity index 74% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/ChangeNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/ChangeNode.java index caf60fd..0ac0eb3 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/ChangeNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/ChangeNode.java @@ -1,16 +1,16 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Operation; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.patterns.ChangeTarget; -import me.topchetoeu.jscript.compilation.values.constants.NumberNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Operation; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.patterns.ChangeTarget; +import me.topchetoeu.j2s.compilation.values.constants.NumberNode; public class ChangeNode extends Node { public final ChangeTarget changable; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/DiscardNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/DiscardNode.java similarity index 66% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/DiscardNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/DiscardNode.java index ac1ab0d..cd40fc5 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/DiscardNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/DiscardNode.java @@ -1,13 +1,13 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; public class DiscardNode extends Node { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/IndexNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/IndexNode.java similarity index 85% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/IndexNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/IndexNode.java index fe27f1a..7de4965 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/IndexNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/IndexNode.java @@ -1,17 +1,17 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.patterns.ChangeTarget; -import me.topchetoeu.jscript.compilation.values.constants.NumberNode; -import me.topchetoeu.jscript.compilation.values.constants.StringNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.patterns.ChangeTarget; +import me.topchetoeu.j2s.compilation.values.constants.NumberNode; +import me.topchetoeu.j2s.compilation.values.constants.StringNode; public class IndexNode extends Node implements ChangeTarget { public final Node object; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/LazyAndNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/LazyAndNode.java similarity index 71% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/LazyAndNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/LazyAndNode.java index 58a222b..529dcd3 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/LazyAndNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/LazyAndNode.java @@ -1,13 +1,13 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; public class LazyAndNode extends Node { public final Node first, second; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/LazyOrNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/LazyOrNode.java similarity index 71% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/LazyOrNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/LazyOrNode.java index 9bb0a27..807a7ed 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/LazyOrNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/LazyOrNode.java @@ -1,13 +1,13 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; public class LazyOrNode extends Node { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/OperationNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/OperationNode.java similarity index 93% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/OperationNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/OperationNode.java index 36052da..7887116 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/OperationNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/OperationNode.java @@ -1,21 +1,21 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Operation; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.patterns.AssignTargetLike; -import me.topchetoeu.jscript.compilation.patterns.ChangeTarget; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Operation; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.patterns.AssignTargetLike; +import me.topchetoeu.j2s.compilation.patterns.ChangeTarget; public class OperationNode extends Node { private static interface OperatorFactory { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/PostfixNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/PostfixNode.java similarity index 71% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/PostfixNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/PostfixNode.java index 99e86a5..1b7ae52 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/PostfixNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/PostfixNode.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Operation; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.patterns.ChangeTarget; -import me.topchetoeu.jscript.compilation.values.constants.NumberNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Operation; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.patterns.ChangeTarget; +import me.topchetoeu.j2s.compilation.values.constants.NumberNode; public class PostfixNode extends ChangeNode { @Override public void compileFunctions(CompileResult target) { diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/TypeofNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/TypeofNode.java similarity index 67% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/TypeofNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/TypeofNode.java index 8fea97b..d371240 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/TypeofNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/TypeofNode.java @@ -1,15 +1,14 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.common.parsing.ParseRes; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.compilation.Node; - -import me.topchetoeu.jscript.compilation.values.VariableNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.common.parsing.ParseRes; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.values.VariableNode; public class TypeofNode extends Node { public final Node value; diff --git a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/VariableAssignNode.java b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/VariableAssignNode.java similarity index 68% rename from src/main/java/me/topchetoeu/jscript/compilation/values/operations/VariableAssignNode.java rename to src/main/java/me/topchetoeu/j2s/compilation/values/operations/VariableAssignNode.java index ff923d2..5c758fe 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/values/operations/VariableAssignNode.java +++ b/src/main/java/me/topchetoeu/j2s/compilation/values/operations/VariableAssignNode.java @@ -1,12 +1,12 @@ -package me.topchetoeu.jscript.compilation.values.operations; +package me.topchetoeu.j2s.compilation.values.operations; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Operation; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.FunctionNode; -import me.topchetoeu.jscript.compilation.Node; -import me.topchetoeu.jscript.compilation.values.VariableNode; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Operation; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.FunctionNode; +import me.topchetoeu.j2s.compilation.Node; +import me.topchetoeu.j2s.compilation.values.VariableNode; public class VariableAssignNode extends Node { public final String name; diff --git a/src/main/java/me/topchetoeu/jscript/repl/SimpleRepl.java b/src/main/java/me/topchetoeu/j2s/repl/SimpleRepl.java similarity index 92% rename from src/main/java/me/topchetoeu/jscript/repl/SimpleRepl.java rename to src/main/java/me/topchetoeu/j2s/repl/SimpleRepl.java index 00ec699..5c51078 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/SimpleRepl.java +++ b/src/main/java/me/topchetoeu/j2s/repl/SimpleRepl.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.repl; +package me.topchetoeu.j2s.repl; import java.io.File; import java.io.FileInputStream; @@ -16,40 +16,40 @@ import java.util.concurrent.ExecutionException; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import me.topchetoeu.jscript.common.Metadata; -import me.topchetoeu.jscript.common.Reading; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.repl.debug.DebugServer; -import me.topchetoeu.jscript.repl.debug.Debugger; -import me.topchetoeu.jscript.repl.debug.SimpleDebugger; -import me.topchetoeu.jscript.runtime.ArgumentsValue; -import me.topchetoeu.jscript.runtime.Engine; -import me.topchetoeu.jscript.runtime.EventLoop; -import me.topchetoeu.jscript.runtime.Frame; -import me.topchetoeu.jscript.runtime.JSONConverter; -import me.topchetoeu.jscript.runtime.debug.DebugContext; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.functions.NativeFunction; -import me.topchetoeu.jscript.runtime.values.objects.ArrayLikeValue; -import me.topchetoeu.jscript.runtime.values.objects.ArrayValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.objects.buffers.Int32ArrayValue; -import me.topchetoeu.jscript.runtime.values.objects.buffers.Int8ArrayValue; -import me.topchetoeu.jscript.runtime.values.objects.buffers.TypedArrayValue; -import me.topchetoeu.jscript.runtime.values.objects.buffers.Uint8ArrayValue; -import me.topchetoeu.jscript.runtime.values.primitives.BoolValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.SymbolValue; -import me.topchetoeu.jscript.runtime.values.primitives.UserValue; -import me.topchetoeu.jscript.runtime.values.primitives.VoidValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; -import me.topchetoeu.jscript.runtime.Compiler; +import me.topchetoeu.j2s.common.Metadata; +import me.topchetoeu.j2s.common.Reading; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.repl.debug.DebugServer; +import me.topchetoeu.j2s.repl.debug.Debugger; +import me.topchetoeu.j2s.repl.debug.SimpleDebugger; +import me.topchetoeu.j2s.runtime.ArgumentsValue; +import me.topchetoeu.j2s.runtime.Compiler; +import me.topchetoeu.j2s.runtime.Engine; +import me.topchetoeu.j2s.runtime.EventLoop; +import me.topchetoeu.j2s.runtime.Frame; +import me.topchetoeu.j2s.runtime.JSONConverter; +import me.topchetoeu.j2s.runtime.debug.DebugContext; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.functions.NativeFunction; +import me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue; +import me.topchetoeu.j2s.runtime.values.objects.ArrayValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.objects.buffers.Int32ArrayValue; +import me.topchetoeu.j2s.runtime.values.objects.buffers.Int8ArrayValue; +import me.topchetoeu.j2s.runtime.values.objects.buffers.TypedArrayValue; +import me.topchetoeu.j2s.runtime.values.objects.buffers.Uint8ArrayValue; +import me.topchetoeu.j2s.runtime.values.primitives.BoolValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.SymbolValue; +import me.topchetoeu.j2s.runtime.values.primitives.UserValue; +import me.topchetoeu.j2s.runtime.values.primitives.VoidValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public class SimpleRepl { static Thread engineTask, debugTask; @@ -118,7 +118,7 @@ public class SimpleRepl { try { var res = engine.pushMsg( false, environment, - new Filename("jscript", "repl/" + i + ".js"), raw, + new Filename(Metadata.name(), "repl/" + i + ".js"), raw, Value.UNDEFINED ).get(); System.err.println(res.toReadable(environment)); @@ -751,7 +751,7 @@ public class SimpleRepl { return Value.UNDEFINED; })); res.defineOwnField(env, "compile", new NativeFunction(args -> { - return Compiler.compileFunc(env, new Filename("jscript", "func" + i[0]++ + ".js"), args.get(0).toString(env)); + return Compiler.compileFunc(env, new Filename(Metadata.name(), "func" + i[0]++ + ".js"), args.get(0).toString(env)); })); res.defineOwnField(env, "now", new NativeFunction(args -> { return NumberValue.of(System.currentTimeMillis()); @@ -775,7 +775,7 @@ public class SimpleRepl { EventLoop.get(stubEnv).pushMsg( false, stubEnv, - Filename.parse("jscript://init.js"), Reading.resourceToString("lib/index.js"), + new Filename(Metadata.name(), "init.js"), Reading.resourceToString("lib/index.js"), Value.UNDEFINED ).get(); @@ -851,7 +851,7 @@ public class SimpleRepl { var ts = Reading.resourceToString("lib/ts.js"); if (ts != null) EventLoop.get(tsEnvironment).pushMsg( false, tsEnvironment, - Filename.parse("jscript://ts.js"), ts, + new Filename(Metadata.name(), "ts.js"), ts, Value.UNDEFINED, setter ).get(); diff --git a/src/main/java/me/topchetoeu/jscript/repl/V8Error.java b/src/main/java/me/topchetoeu/j2s/repl/V8Error.java similarity index 69% rename from src/main/java/me/topchetoeu/jscript/repl/V8Error.java rename to src/main/java/me/topchetoeu/j2s/repl/V8Error.java index 646bb3b..9251ddc 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/V8Error.java +++ b/src/main/java/me/topchetoeu/j2s/repl/V8Error.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.repl; +package me.topchetoeu.j2s.repl; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONMap; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONMap; public class V8Error { public final String message; diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/DebugServer.java b/src/main/java/me/topchetoeu/j2s/repl/debug/DebugServer.java similarity index 94% rename from src/main/java/me/topchetoeu/jscript/repl/debug/DebugServer.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/DebugServer.java index 1563b9a..63a691a 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/DebugServer.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/DebugServer.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; import java.io.IOException; import java.io.UncheckedIOException; @@ -9,13 +9,13 @@ import java.security.MessageDigest; import java.util.Base64; import java.util.HashMap; -import me.topchetoeu.jscript.common.Metadata; -import me.topchetoeu.jscript.common.Reading; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONList; -import me.topchetoeu.jscript.common.json.JSONMap; -import me.topchetoeu.jscript.repl.debug.WebSocketMessage.Type; +import me.topchetoeu.j2s.common.Metadata; +import me.topchetoeu.j2s.common.Reading; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONList; +import me.topchetoeu.j2s.common.json.JSONMap; +import me.topchetoeu.j2s.repl.debug.WebSocketMessage.Type; public class DebugServer { public static String browserDisplayName = Metadata.name() + "/" + Metadata.version(); @@ -185,7 +185,7 @@ public class DebugServer { for (var el : targets.entrySet()) { res.add(new JSONMap() - .set("description", "JScript debugger") + .set("description", "J2S debugger") .set("favicon", "/favicon.ico") .set("id", el.getKey()) .set("type", "node") diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/Debugger.java b/src/main/java/me/topchetoeu/j2s/repl/debug/Debugger.java similarity index 92% rename from src/main/java/me/topchetoeu/jscript/repl/debug/Debugger.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/Debugger.java index 3092565..329cf42 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/Debugger.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/Debugger.java @@ -1,8 +1,8 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; import java.io.IOException; -import me.topchetoeu.jscript.runtime.debug.DebugHandler; +import me.topchetoeu.j2s.runtime.debug.DebugHandler; public interface Debugger extends DebugHandler { void close(); diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/DebuggerProvider.java b/src/main/java/me/topchetoeu/j2s/repl/debug/DebuggerProvider.java similarity index 70% rename from src/main/java/me/topchetoeu/jscript/repl/debug/DebuggerProvider.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/DebuggerProvider.java index 1ec4769..de2fa26 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/DebuggerProvider.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/DebuggerProvider.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; public interface DebuggerProvider { Debugger getDebugger(WebSocket socket, HttpRequest req); diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/HttpRequest.java b/src/main/java/me/topchetoeu/j2s/repl/debug/HttpRequest.java similarity index 97% rename from src/main/java/me/topchetoeu/jscript/repl/debug/HttpRequest.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/HttpRequest.java index 62aaba6..708911a 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/HttpRequest.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/HttpRequest.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; import java.io.BufferedReader; import java.io.IOException; @@ -10,7 +10,7 @@ import java.util.HashMap; import java.util.IllegalFormatException; import java.util.Map; -import me.topchetoeu.jscript.common.Reading; +import me.topchetoeu.j2s.common.Reading; public class HttpRequest { public final String method; diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/ScopeObject.java b/src/main/java/me/topchetoeu/j2s/repl/debug/ScopeObject.java similarity index 89% rename from src/main/java/me/topchetoeu/jscript/repl/debug/ScopeObject.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/ScopeObject.java index fcc5922..c7ffb37 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/ScopeObject.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/ScopeObject.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; import java.util.HashMap; import java.util.HashSet; @@ -7,18 +7,18 @@ import java.util.Optional; import java.util.Set; import java.util.function.IntUnaryOperator; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.Frame; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.KeyCache; -import me.topchetoeu.jscript.runtime.values.Member; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.Member.FieldMember; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.SymbolValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.Frame; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.KeyCache; +import me.topchetoeu.j2s.runtime.values.Member; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.Member.FieldMember; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.SymbolValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public class ScopeObject extends Value { public static final class ScopeMember extends FieldMember { diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/SimpleDebugger.java b/src/main/java/me/topchetoeu/j2s/repl/debug/SimpleDebugger.java similarity index 95% rename from src/main/java/me/topchetoeu/jscript/repl/debug/SimpleDebugger.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/SimpleDebugger.java index 30bc71b..c1d80b2 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/SimpleDebugger.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/SimpleDebugger.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; import java.io.IOException; import java.util.ArrayList; @@ -11,35 +11,36 @@ import java.util.concurrent.ExecutionException; import java.util.regex.Pattern; import java.util.stream.Collectors; -import me.topchetoeu.jscript.common.FunctionBody; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Instruction.BreakpointType; -import me.topchetoeu.jscript.common.Instruction.Type; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONElement; -import me.topchetoeu.jscript.common.json.JSONList; -import me.topchetoeu.jscript.common.json.JSONMap; -import me.topchetoeu.jscript.common.mapping.FunctionMap; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.runtime.Compiler; -import me.topchetoeu.jscript.runtime.Engine; -import me.topchetoeu.jscript.runtime.EventLoop; -import me.topchetoeu.jscript.runtime.Frame; -import me.topchetoeu.jscript.runtime.JSONConverter; -import me.topchetoeu.jscript.runtime.debug.DebugContext; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.Member.FieldMember; -import me.topchetoeu.jscript.runtime.values.Member.PropertyMember; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.objects.ArrayValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.BoolValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.SymbolValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.FunctionBody; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Metadata; +import me.topchetoeu.j2s.common.Instruction.BreakpointType; +import me.topchetoeu.j2s.common.Instruction.Type; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONElement; +import me.topchetoeu.j2s.common.json.JSONList; +import me.topchetoeu.j2s.common.json.JSONMap; +import me.topchetoeu.j2s.common.mapping.FunctionMap; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.runtime.Compiler; +import me.topchetoeu.j2s.runtime.Engine; +import me.topchetoeu.j2s.runtime.EventLoop; +import me.topchetoeu.j2s.runtime.Frame; +import me.topchetoeu.j2s.runtime.JSONConverter; +import me.topchetoeu.j2s.runtime.debug.DebugContext; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.Member.FieldMember; +import me.topchetoeu.j2s.runtime.values.Member.PropertyMember; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.objects.ArrayValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.BoolValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.SymbolValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; // very simple indeed public class SimpleDebugger implements Debugger { @@ -637,7 +638,7 @@ public class SimpleDebugger implements Debugger { env.add(EventLoop.KEY, engine); env.add(Value.GLOBAL, codeFrame.variables); - var awaiter = engine.pushMsg(false, env, new Filename("jscript", "eval"), code, codeFrame.frame.self, codeFrame.frame.args); + var awaiter = engine.pushMsg(false, env, new Filename(Metadata.name(), "eval"), code, codeFrame.frame.self, codeFrame.frame.args); try { engine.run(true); diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/StackObject.java b/src/main/java/me/topchetoeu/j2s/repl/debug/StackObject.java similarity index 72% rename from src/main/java/me/topchetoeu/jscript/repl/debug/StackObject.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/StackObject.java index 7976647..0dd88fa 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/StackObject.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/StackObject.java @@ -1,9 +1,9 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.Frame; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.objects.ArrayLikeValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.Frame; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue; public class StackObject extends ArrayLikeValue { public final Frame frame; diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/V8Error.java b/src/main/java/me/topchetoeu/j2s/repl/debug/V8Error.java similarity index 68% rename from src/main/java/me/topchetoeu/jscript/repl/debug/V8Error.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/V8Error.java index b77354c..83e7d78 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/V8Error.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/V8Error.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONMap; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONMap; public class V8Error { public final String message; diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/V8Event.java b/src/main/java/me/topchetoeu/j2s/repl/debug/V8Event.java similarity index 73% rename from src/main/java/me/topchetoeu/jscript/repl/debug/V8Event.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/V8Event.java index 64805ad..c4e3b1e 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/V8Event.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/V8Event.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONMap; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONMap; public class V8Event { public final String name; diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/V8Message.java b/src/main/java/me/topchetoeu/j2s/repl/debug/V8Message.java similarity index 86% rename from src/main/java/me/topchetoeu/jscript/repl/debug/V8Message.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/V8Message.java index 45a6d7b..f607472 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/V8Message.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/V8Message.java @@ -1,10 +1,10 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; import java.util.Map; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONElement; -import me.topchetoeu.jscript.common.json.JSONMap; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONElement; +import me.topchetoeu.j2s.common.json.JSONMap; public class V8Message { public final String name; diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/V8Result.java b/src/main/java/me/topchetoeu/j2s/repl/debug/V8Result.java similarity index 72% rename from src/main/java/me/topchetoeu/jscript/repl/debug/V8Result.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/V8Result.java index 99e7558..880e201 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/V8Result.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/V8Result.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONMap; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONMap; public class V8Result { public final int id; diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/WebSocket.java b/src/main/java/me/topchetoeu/j2s/repl/debug/WebSocket.java similarity index 98% rename from src/main/java/me/topchetoeu/jscript/repl/debug/WebSocket.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/WebSocket.java index 94d269d..74c59f7 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/WebSocket.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/WebSocket.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -6,7 +6,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; -import me.topchetoeu.jscript.repl.debug.WebSocketMessage.Type; +import me.topchetoeu.j2s.repl.debug.WebSocketMessage.Type; public class WebSocket implements AutoCloseable { public long maxLength = 1 << 20; diff --git a/src/main/java/me/topchetoeu/jscript/repl/debug/WebSocketMessage.java b/src/main/java/me/topchetoeu/j2s/repl/debug/WebSocketMessage.java similarity index 94% rename from src/main/java/me/topchetoeu/jscript/repl/debug/WebSocketMessage.java rename to src/main/java/me/topchetoeu/j2s/repl/debug/WebSocketMessage.java index cc655c7..c3c5a83 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/debug/WebSocketMessage.java +++ b/src/main/java/me/topchetoeu/j2s/repl/debug/WebSocketMessage.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.repl.debug; +package me.topchetoeu.j2s.repl.debug; public class WebSocketMessage { public static enum Type { diff --git a/src/main/java/me/topchetoeu/jscript/repl/mapping/NativeMapper.java b/src/main/java/me/topchetoeu/j2s/repl/mapping/NativeMapper.java similarity index 71% rename from src/main/java/me/topchetoeu/jscript/repl/mapping/NativeMapper.java rename to src/main/java/me/topchetoeu/j2s/repl/mapping/NativeMapper.java index e6cb82b..2d0486c 100644 --- a/src/main/java/me/topchetoeu/jscript/repl/mapping/NativeMapper.java +++ b/src/main/java/me/topchetoeu/j2s/repl/mapping/NativeMapper.java @@ -1,17 +1,17 @@ -package me.topchetoeu.jscript.repl.mapping; +package me.topchetoeu.j2s.repl.mapping; import java.util.function.Function; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.objects.ArrayLikeValue; -import me.topchetoeu.jscript.runtime.values.objects.ArrayValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue; +import me.topchetoeu.j2s.runtime.values.objects.ArrayValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public class NativeMapper extends FunctionValue { public final Function mapper; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/ArgumentsValue.java b/src/main/java/me/topchetoeu/j2s/runtime/ArgumentsValue.java similarity index 53% rename from src/main/java/me/topchetoeu/jscript/runtime/ArgumentsValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/ArgumentsValue.java index d475b00..6e3050b 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/ArgumentsValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/ArgumentsValue.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.runtime; +package me.topchetoeu.j2s.runtime; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.objects.ArrayValue; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.objects.ArrayValue; public class ArgumentsValue extends ArrayValue { public final Frame frame; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/Compiler.java b/src/main/java/me/topchetoeu/j2s/runtime/Compiler.java similarity index 67% rename from src/main/java/me/topchetoeu/jscript/runtime/Compiler.java rename to src/main/java/me/topchetoeu/j2s/runtime/Compiler.java index 16a649e..a0bed47 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/Compiler.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/Compiler.java @@ -1,23 +1,23 @@ -package me.topchetoeu.jscript.runtime; +package me.topchetoeu.j2s.runtime; import java.util.function.Function; -import me.topchetoeu.jscript.common.FunctionBody; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; -import me.topchetoeu.jscript.compilation.JavaScript; -import me.topchetoeu.jscript.repl.mapping.NativeMapper; -import me.topchetoeu.jscript.runtime.debug.DebugContext; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.CodeFunction; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.functions.NativeFunction; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.common.FunctionBody; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.compilation.CompileResult; +import me.topchetoeu.j2s.compilation.JavaScript; +import me.topchetoeu.j2s.repl.mapping.NativeMapper; +import me.topchetoeu.j2s.runtime.debug.DebugContext; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.CodeFunction; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.functions.NativeFunction; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; public interface Compiler { public static final Compiler DEFAULT = (env, filename, raw, mapper) -> { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/Engine.java b/src/main/java/me/topchetoeu/j2s/runtime/Engine.java similarity index 98% rename from src/main/java/me/topchetoeu/jscript/runtime/Engine.java rename to src/main/java/me/topchetoeu/j2s/runtime/Engine.java index 199bdcd..5917633 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/Engine.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/Engine.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime; +package me.topchetoeu.j2s.runtime; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/EventLoop.java b/src/main/java/me/topchetoeu/j2s/runtime/EventLoop.java similarity index 73% rename from src/main/java/me/topchetoeu/jscript/runtime/EventLoop.java rename to src/main/java/me/topchetoeu/j2s/runtime/EventLoop.java index b5abc9a..d5a8305 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/EventLoop.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/EventLoop.java @@ -1,14 +1,14 @@ -package me.topchetoeu.jscript.runtime; +package me.topchetoeu.j2s.runtime; import java.util.concurrent.Future; import java.util.function.Supplier; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; public interface EventLoop { public static final Key KEY = new Key<>(); diff --git a/src/main/java/me/topchetoeu/jscript/runtime/Frame.java b/src/main/java/me/topchetoeu/j2s/runtime/Frame.java similarity index 94% rename from src/main/java/me/topchetoeu/jscript/runtime/Frame.java rename to src/main/java/me/topchetoeu/j2s/runtime/Frame.java index b051b24..bee4949 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/Frame.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/Frame.java @@ -1,19 +1,19 @@ -package me.topchetoeu.jscript.runtime; +package me.topchetoeu.j2s.runtime; import java.util.Arrays; import java.util.Stack; import java.util.concurrent.CancellationException; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.runtime.debug.DebugContext; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.CodeFunction; -import me.topchetoeu.jscript.runtime.values.objects.ArrayLikeValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.IntValue; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.runtime.debug.DebugContext; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.CodeFunction; +import me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.IntValue; public final class Frame { public static final Key> KEY = new Key<>(); diff --git a/src/main/java/me/topchetoeu/jscript/runtime/InstructionRunner.java b/src/main/java/me/topchetoeu/j2s/runtime/InstructionRunner.java similarity index 95% rename from src/main/java/me/topchetoeu/jscript/runtime/InstructionRunner.java rename to src/main/java/me/topchetoeu/j2s/runtime/InstructionRunner.java index ef38992..651fad4 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/InstructionRunner.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/InstructionRunner.java @@ -1,21 +1,21 @@ -package me.topchetoeu.jscript.runtime; +package me.topchetoeu.j2s.runtime; import java.util.ArrayList; import java.util.Collections; import java.util.Optional; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.Operation; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.CodeFunction; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.objects.ArrayValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.BoolValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.Operation; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.CodeFunction; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.objects.ArrayValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.BoolValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public class InstructionRunner { private static Value execReturn(Environment env, Instruction instr, Frame frame) { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/JSONConverter.java b/src/main/java/me/topchetoeu/j2s/runtime/JSONConverter.java similarity index 73% rename from src/main/java/me/topchetoeu/jscript/runtime/JSONConverter.java rename to src/main/java/me/topchetoeu/j2s/runtime/JSONConverter.java index d1f4ade..729078d 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/JSONConverter.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/JSONConverter.java @@ -1,20 +1,20 @@ -package me.topchetoeu.jscript.runtime; +package me.topchetoeu.j2s.runtime; import java.util.HashSet; import java.util.stream.Collectors; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.json.JSONElement; -import me.topchetoeu.jscript.common.json.JSONList; -import me.topchetoeu.jscript.common.json.JSONMap; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.objects.ArrayValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.BoolValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.VoidValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.json.JSONElement; +import me.topchetoeu.j2s.common.json.JSONList; +import me.topchetoeu.j2s.common.json.JSONMap; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.objects.ArrayValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.BoolValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.VoidValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public class JSONConverter { public static Value toJs(JSONElement val) { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/debug/DebugContext.java b/src/main/java/me/topchetoeu/j2s/runtime/debug/DebugContext.java similarity index 82% rename from src/main/java/me/topchetoeu/jscript/runtime/debug/DebugContext.java rename to src/main/java/me/topchetoeu/j2s/runtime/debug/DebugContext.java index 860f8bb..3bbfe79 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/debug/DebugContext.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/debug/DebugContext.java @@ -1,19 +1,19 @@ -package me.topchetoeu.jscript.runtime.debug; +package me.topchetoeu.j2s.runtime.debug; import java.util.HashMap; import java.util.WeakHashMap; -import me.topchetoeu.jscript.common.FunctionBody; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.common.mapping.FunctionMap; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.runtime.Frame; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.CodeFunction; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.common.FunctionBody; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.common.mapping.FunctionMap; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.runtime.Frame; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.CodeFunction; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; public class DebugContext { public static final Key KEY = new Key<>(); diff --git a/src/main/java/me/topchetoeu/jscript/runtime/debug/DebugHandler.java b/src/main/java/me/topchetoeu/j2s/runtime/debug/DebugHandler.java similarity index 80% rename from src/main/java/me/topchetoeu/jscript/runtime/debug/DebugHandler.java rename to src/main/java/me/topchetoeu/j2s/runtime/debug/DebugHandler.java index 26d26b1..5a559a5 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/debug/DebugHandler.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/debug/DebugHandler.java @@ -1,13 +1,13 @@ -package me.topchetoeu.jscript.runtime.debug; +package me.topchetoeu.j2s.runtime.debug; -import me.topchetoeu.jscript.common.FunctionBody; -import me.topchetoeu.jscript.common.Instruction; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.mapping.FunctionMap; -import me.topchetoeu.jscript.common.parsing.Filename; -import me.topchetoeu.jscript.runtime.Frame; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; +import me.topchetoeu.j2s.common.FunctionBody; +import me.topchetoeu.j2s.common.Instruction; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.mapping.FunctionMap; +import me.topchetoeu.j2s.common.parsing.Filename; +import me.topchetoeu.j2s.runtime.Frame; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; public interface DebugHandler { /** diff --git a/src/main/java/me/topchetoeu/jscript/runtime/exceptions/EngineException.java b/src/main/java/me/topchetoeu/j2s/runtime/exceptions/EngineException.java similarity index 87% rename from src/main/java/me/topchetoeu/jscript/runtime/exceptions/EngineException.java rename to src/main/java/me/topchetoeu/j2s/runtime/exceptions/EngineException.java index 0800c0a..3322266 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/exceptions/EngineException.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/exceptions/EngineException.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.runtime.exceptions; +package me.topchetoeu.j2s.runtime.exceptions; import java.util.ArrayList; import java.util.List; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue.PrototypeProvider; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.VoidValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.parsing.Location; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue.PrototypeProvider; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.VoidValue; public class EngineException extends RuntimeException { public static class StackElement { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/KeyCache.java b/src/main/java/me/topchetoeu/j2s/runtime/values/KeyCache.java similarity index 84% rename from src/main/java/me/topchetoeu/jscript/runtime/values/KeyCache.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/KeyCache.java index c564511..77edb60 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/KeyCache.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/KeyCache.java @@ -1,9 +1,9 @@ -package me.topchetoeu.jscript.runtime.values; +package me.topchetoeu.j2s.runtime.values; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.SymbolValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.SymbolValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public final class KeyCache { public final Value value; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/Member.java b/src/main/java/me/topchetoeu/j2s/runtime/values/Member.java similarity index 95% rename from src/main/java/me/topchetoeu/jscript/runtime/values/Member.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/Member.java index edcfc31..b58e78a 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/Member.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/Member.java @@ -1,11 +1,11 @@ -package me.topchetoeu.jscript.runtime.values; +package me.topchetoeu.j2s.runtime.values; import java.util.Optional; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.BoolValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.BoolValue; public interface Member { public static final class PropertyMember implements Member { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/Value.java b/src/main/java/me/topchetoeu/j2s/runtime/values/Value.java similarity index 96% rename from src/main/java/me/topchetoeu/jscript/runtime/values/Value.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/Value.java index 880527c..bc85332 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/Value.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/Value.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values; +package me.topchetoeu.j2s.runtime.values; import java.io.ByteArrayOutputStream; import java.io.PrintStream; @@ -14,20 +14,20 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import me.topchetoeu.jscript.common.SyntaxException; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.runtime.EventLoop; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Member.PropertyMember; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.functions.NativeFunction; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.BoolValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.SymbolValue; -import me.topchetoeu.jscript.runtime.values.primitives.VoidValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.SyntaxException; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.runtime.EventLoop; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Member.PropertyMember; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.functions.NativeFunction; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.BoolValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.SymbolValue; +import me.topchetoeu.j2s.runtime.values.primitives.VoidValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public abstract class Value { public static enum State { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/functions/Arguments.java b/src/main/java/me/topchetoeu/j2s/runtime/values/functions/Arguments.java similarity index 80% rename from src/main/java/me/topchetoeu/jscript/runtime/values/functions/Arguments.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/functions/Arguments.java index bad95ca..18f59a4 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/functions/Arguments.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/functions/Arguments.java @@ -1,10 +1,10 @@ -package me.topchetoeu.jscript.runtime.values.functions; +package me.topchetoeu.j2s.runtime.values.functions; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.UserValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.UserValue; public class Arguments { public final Value self; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/functions/CodeFunction.java b/src/main/java/me/topchetoeu/j2s/runtime/values/functions/CodeFunction.java similarity index 78% rename from src/main/java/me/topchetoeu/jscript/runtime/values/functions/CodeFunction.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/functions/CodeFunction.java index e43511d..935e182 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/functions/CodeFunction.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/functions/CodeFunction.java @@ -1,10 +1,10 @@ -package me.topchetoeu.jscript.runtime.values.functions; +package me.topchetoeu.j2s.runtime.values.functions; -import me.topchetoeu.jscript.common.FunctionBody; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.Frame; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.common.FunctionBody; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.Frame; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; public final class CodeFunction extends FunctionValue { public final FunctionBody body; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/functions/FunctionValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/functions/FunctionValue.java similarity index 83% rename from src/main/java/me/topchetoeu/jscript/runtime/values/functions/FunctionValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/functions/FunctionValue.java index 92701da..33c7be7 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/functions/FunctionValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/functions/FunctionValue.java @@ -1,20 +1,20 @@ -package me.topchetoeu.jscript.runtime.values.functions; +package me.topchetoeu.j2s.runtime.values.functions; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.List; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.debug.DebugContext; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.KeyCache; -import me.topchetoeu.jscript.runtime.values.Member; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.Member.FieldMember; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.debug.DebugContext; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.KeyCache; +import me.topchetoeu.j2s.runtime.values.Member; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.Member.FieldMember; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public abstract class FunctionValue extends ObjectValue { public String name = ""; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/functions/NativeFunction.java b/src/main/java/me/topchetoeu/j2s/runtime/values/functions/NativeFunction.java similarity index 80% rename from src/main/java/me/topchetoeu/jscript/runtime/values/functions/NativeFunction.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/functions/NativeFunction.java index bbdc58f..d083405 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/functions/NativeFunction.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/functions/NativeFunction.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.runtime.values.functions; +package me.topchetoeu.j2s.runtime.values.functions; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.Value; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.Value; public final class NativeFunction extends FunctionValue { public static interface NativeFunctionRunner { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ArrayLikeValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/ArrayLikeValue.java similarity index 92% rename from src/main/java/me/topchetoeu/jscript/runtime/values/objects/ArrayLikeValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/objects/ArrayLikeValue.java index d219647..caea5b0 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ArrayLikeValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/ArrayLikeValue.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values.objects; +package me.topchetoeu.j2s.runtime.values.objects; import java.util.Arrays; import java.util.HashSet; @@ -7,13 +7,13 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.KeyCache; -import me.topchetoeu.jscript.runtime.values.Member; -import me.topchetoeu.jscript.runtime.values.Member.FieldMember; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; -import me.topchetoeu.jscript.runtime.values.Value; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.KeyCache; +import me.topchetoeu.j2s.runtime.values.Member; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.Member.FieldMember; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public abstract class ArrayLikeValue extends ObjectValue { private static class IndexField extends FieldMember { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ArrayValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/ArrayValue.java similarity index 93% rename from src/main/java/me/topchetoeu/jscript/runtime/values/objects/ArrayValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/objects/ArrayValue.java index 765cd8a..f8af406 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ArrayValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/ArrayValue.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values.objects; +package me.topchetoeu.j2s.runtime.values.objects; import java.util.Arrays; import java.util.Collection; @@ -6,9 +6,9 @@ import java.util.Comparator; import java.util.Iterator; import java.util.stream.Stream; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.primitives.VoidValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.primitives.VoidValue; public class ArrayValue extends ArrayLikeValue implements Iterable { private Value[] values; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ObjectValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/ObjectValue.java similarity index 92% rename from src/main/java/me/topchetoeu/jscript/runtime/values/objects/ObjectValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/objects/ObjectValue.java index a52497d..d9ef238 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ObjectValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/ObjectValue.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values.objects; +package me.topchetoeu.j2s.runtime.values.objects; import java.util.Arrays; import java.util.HashMap; @@ -10,18 +10,18 @@ import java.util.List; import java.util.Optional; import java.util.Set; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.environment.Key; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.KeyCache; -import me.topchetoeu.jscript.runtime.values.Member; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.Member.FieldMember; -import me.topchetoeu.jscript.runtime.values.Member.PropertyMember; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; -import me.topchetoeu.jscript.runtime.values.primitives.SymbolValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.environment.Key; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.KeyCache; +import me.topchetoeu.j2s.runtime.values.Member; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.Member.FieldMember; +import me.topchetoeu.j2s.runtime.values.Member.PropertyMember; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.runtime.values.primitives.SymbolValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public class ObjectValue extends Value { public static interface PrototypeProvider { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Int32ArrayValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Int32ArrayValue.java similarity index 91% rename from src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Int32ArrayValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Int32ArrayValue.java index 01b7dbd..f09aa47 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Int32ArrayValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Int32ArrayValue.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values.objects.buffers; +package me.topchetoeu.j2s.runtime.values.objects.buffers; public final class Int32ArrayValue extends TypedArrayValue { @Override protected int onGet(int i) { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Int8ArrayValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Int8ArrayValue.java similarity index 85% rename from src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Int8ArrayValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Int8ArrayValue.java index 7d66576..cb46163 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Int8ArrayValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Int8ArrayValue.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values.objects.buffers; +package me.topchetoeu.j2s.runtime.values.objects.buffers; public final class Int8ArrayValue extends TypedArrayValue { @Override protected int onGet(int i) { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/TypedArrayValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/TypedArrayValue.java similarity index 74% rename from src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/TypedArrayValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/TypedArrayValue.java index dd1e273..a26ce9e 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/TypedArrayValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/TypedArrayValue.java @@ -1,13 +1,13 @@ -package me.topchetoeu.jscript.runtime.values.objects.buffers; +package me.topchetoeu.j2s.runtime.values.objects.buffers; import java.util.WeakHashMap; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.objects.ArrayLikeValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.UserValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.UserValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public abstract class TypedArrayValue extends ArrayLikeValue { public static final WeakHashMap> userValues = new WeakHashMap<>(); diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Uint8ArrayValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Uint8ArrayValue.java similarity index 87% rename from src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Uint8ArrayValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Uint8ArrayValue.java index 63c2e2e..2d51cf5 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/buffers/Uint8ArrayValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/objects/buffers/Uint8ArrayValue.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values.objects.buffers; +package me.topchetoeu.j2s.runtime.values.objects.buffers; public final class Uint8ArrayValue extends TypedArrayValue { @Override protected int onGet(int i) { diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/BoolValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/BoolValue.java similarity index 79% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/BoolValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/BoolValue.java index e70eaff..a0c0ad2 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/BoolValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/BoolValue.java @@ -1,8 +1,8 @@ -package me.topchetoeu.jscript.runtime.values.primitives; +package me.topchetoeu.j2s.runtime.values.primitives; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public final class BoolValue extends PrimitiveValue { public static final BoolValue TRUE = new BoolValue(true); diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/PrimitiveValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/PrimitiveValue.java similarity index 76% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/PrimitiveValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/PrimitiveValue.java index f9b9a4f..af17408 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/PrimitiveValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/PrimitiveValue.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.runtime.values.primitives; +package me.topchetoeu.j2s.runtime.values.primitives; import java.util.HashSet; import java.util.Optional; import java.util.Set; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.KeyCache; -import me.topchetoeu.jscript.runtime.values.Member; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.KeyCache; +import me.topchetoeu.j2s.runtime.values.Member; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; public abstract class PrimitiveValue extends Value { @Override public boolean defineOwnField( diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/StringValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/StringValue.java similarity index 79% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/StringValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/StringValue.java index 8fcfa02..64be39a 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/StringValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/StringValue.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values.primitives; +package me.topchetoeu.j2s.runtime.values.primitives; import java.util.Arrays; import java.util.HashSet; @@ -7,16 +7,16 @@ import java.util.List; import java.util.Set; import java.util.WeakHashMap; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONElement; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.runtime.values.KeyCache; -import me.topchetoeu.jscript.runtime.values.Member; -import me.topchetoeu.jscript.runtime.values.Member.FieldMember; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONElement; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.runtime.values.KeyCache; +import me.topchetoeu.j2s.runtime.values.Member; +import me.topchetoeu.j2s.runtime.values.Member.FieldMember; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public final class StringValue extends PrimitiveValue { private static final WeakHashMap cache = new WeakHashMap<>(); diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/SymbolValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/SymbolValue.java similarity index 79% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/SymbolValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/SymbolValue.java index 528ab28..c84ece9 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/SymbolValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/SymbolValue.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.runtime.values.primitives; +package me.topchetoeu.j2s.runtime.values.primitives; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public final class SymbolValue extends PrimitiveValue { private static final HashMap registry = new HashMap<>(); diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/UserValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/UserValue.java similarity index 85% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/UserValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/UserValue.java index a055e63..925702e 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/UserValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/UserValue.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript.runtime.values.primitives; +package me.topchetoeu.j2s.runtime.values.primitives; import java.util.Arrays; import java.util.HashSet; @@ -7,13 +7,13 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.KeyCache; -import me.topchetoeu.jscript.runtime.values.Member; -import me.topchetoeu.jscript.runtime.values.Value; -import me.topchetoeu.jscript.runtime.values.functions.FunctionValue; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.KeyCache; +import me.topchetoeu.j2s.runtime.values.Member; +import me.topchetoeu.j2s.runtime.values.Value; +import me.topchetoeu.j2s.runtime.values.functions.FunctionValue; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public final class UserValue extends Value { public final T value; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/VoidValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/VoidValue.java similarity index 73% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/VoidValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/VoidValue.java index 67938a1..d2be58e 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/VoidValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/VoidValue.java @@ -1,15 +1,15 @@ -package me.topchetoeu.jscript.runtime.values.primitives; +package me.topchetoeu.j2s.runtime.values.primitives; import java.util.Arrays; import java.util.HashSet; import java.util.List; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.exceptions.EngineException; -import me.topchetoeu.jscript.runtime.values.KeyCache; -import me.topchetoeu.jscript.runtime.values.Member; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.numbers.NumberValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.exceptions.EngineException; +import me.topchetoeu.j2s.runtime.values.KeyCache; +import me.topchetoeu.j2s.runtime.values.Member; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.numbers.NumberValue; public final class VoidValue extends PrimitiveValue { public final String name; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/DoubleValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/DoubleValue.java similarity index 84% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/DoubleValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/DoubleValue.java index e1ad51a..bc90fea 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/DoubleValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/DoubleValue.java @@ -1,7 +1,7 @@ -package me.topchetoeu.jscript.runtime.values.primitives.numbers; +package me.topchetoeu.j2s.runtime.values.primitives.numbers; -import me.topchetoeu.jscript.common.json.JSON; -import me.topchetoeu.jscript.common.json.JSONElement; +import me.topchetoeu.j2s.common.json.JSON; +import me.topchetoeu.j2s.common.json.JSONElement; public final class DoubleValue extends NumberValue { public final double value; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/IntValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/IntValue.java similarity index 84% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/IntValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/IntValue.java index a4e4d79..43eae12 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/IntValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/IntValue.java @@ -1,11 +1,11 @@ -package me.topchetoeu.jscript.runtime.values.primitives.numbers; +package me.topchetoeu.j2s.runtime.values.primitives.numbers; import java.util.Arrays; import java.util.HashSet; import java.util.List; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; public final class IntValue extends NumberValue { public final long value; diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/NumberValue.java b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/NumberValue.java similarity index 80% rename from src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/NumberValue.java rename to src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/NumberValue.java index c09a02a..d5cb285 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/primitives/numbers/NumberValue.java +++ b/src/main/java/me/topchetoeu/j2s/runtime/values/primitives/numbers/NumberValue.java @@ -1,11 +1,11 @@ -package me.topchetoeu.jscript.runtime.values.primitives.numbers; +package me.topchetoeu.j2s.runtime.values.primitives.numbers; -import me.topchetoeu.jscript.common.environment.Environment; -import me.topchetoeu.jscript.common.parsing.Parsing; -import me.topchetoeu.jscript.common.parsing.Source; -import me.topchetoeu.jscript.runtime.values.objects.ObjectValue; -import me.topchetoeu.jscript.runtime.values.primitives.PrimitiveValue; -import me.topchetoeu.jscript.runtime.values.primitives.StringValue; +import me.topchetoeu.j2s.common.environment.Environment; +import me.topchetoeu.j2s.common.parsing.Parsing; +import me.topchetoeu.j2s.common.parsing.Source; +import me.topchetoeu.j2s.runtime.values.objects.ObjectValue; +import me.topchetoeu.j2s.runtime.values.primitives.PrimitiveValue; +import me.topchetoeu.j2s.runtime.values.primitives.StringValue; public abstract class NumberValue extends PrimitiveValue { public static final NumberValue NAN = new DoubleValue(Double.NaN); diff --git a/src/main/java/me/topchetoeu/jscript/common/environment/Key.java b/src/main/java/me/topchetoeu/jscript/common/environment/Key.java deleted file mode 100644 index 1ffb92a..0000000 --- a/src/main/java/me/topchetoeu/jscript/common/environment/Key.java +++ /dev/null @@ -1,3 +0,0 @@ -package me.topchetoeu.jscript.common.environment; - -public final class Key { } diff --git a/src/main/java/me/topchetoeu/jscript/compilation/members/Member.java b/src/main/java/me/topchetoeu/jscript/compilation/members/Member.java deleted file mode 100644 index 36ce7df..0000000 --- a/src/main/java/me/topchetoeu/jscript/compilation/members/Member.java +++ /dev/null @@ -1,11 +0,0 @@ -package me.topchetoeu.jscript.compilation.members; - -import me.topchetoeu.jscript.common.parsing.Location; -import me.topchetoeu.jscript.compilation.CompileResult; - -public interface Member { - Location loc(); - - void compileFunctions(CompileResult target); - void compile(CompileResult target, boolean pollute); -} diff --git a/src/main/java/me/topchetoeu/jscript/compilation/patterns/ChangeTarget.java b/src/main/java/me/topchetoeu/jscript/compilation/patterns/ChangeTarget.java deleted file mode 100644 index 941e270..0000000 --- a/src/main/java/me/topchetoeu/jscript/compilation/patterns/ChangeTarget.java +++ /dev/null @@ -1,7 +0,0 @@ -package me.topchetoeu.jscript.compilation.patterns; - -import me.topchetoeu.jscript.compilation.CompileResult; - -public interface ChangeTarget extends AssignTarget { - void beforeChange(CompileResult target); -} diff --git a/src/main/resources/debugger/index.html b/src/main/resources/debugger/index.html index 8a57f1f..26a13b5 100644 --- a/src/main/resources/debugger/index.html +++ b/src/main/resources/debugger/index.html @@ -3,20 +3,20 @@ - JScript Debugger + J2S Debugger

- This is the debugger of JScript. It implement the V8 Debugging protocol, - so you can use the devtools in chrome.
+ This is the debugger of J2S. It implement the V8 Debugging protocol, + so you can use the devtools in chrome.
The debugger is still in early development, so please report any issues to - the github repo. + the git repo.

Here are the available entrypoints:

    -
  • /json/version - version and other stuff about the JScript engine
  • +
  • /json/version - version and other stuff about the J2S engine
  • /json/list - a list of all entrypoints
  • /json/protocol - documentation of the implemented V8 protocol
  • /(any target) - websocket entrypoints for debugging
  • diff --git a/src/main/test/java/me/topchetoeu/jscript/TestHelloWorld.java b/src/main/test/java/me/topchetoeu/j2s/TestHelloWorld.java similarity index 89% rename from src/main/test/java/me/topchetoeu/jscript/TestHelloWorld.java rename to src/main/test/java/me/topchetoeu/j2s/TestHelloWorld.java index 60866ce..638e19d 100644 --- a/src/main/test/java/me/topchetoeu/jscript/TestHelloWorld.java +++ b/src/main/test/java/me/topchetoeu/j2s/TestHelloWorld.java @@ -1,4 +1,4 @@ -package me.topchetoeu.jscript; +package me.topchetoeu.j2s; import org.junit.jupiter.api.Test;