Compare commits
1 Commits
1548938537
...
f3d419085c
Author | SHA1 | Date | |
---|---|---|---|
f3d419085c |
@ -3,5 +3,5 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`kotlin-dsl`
|
`kotlin-dsl`
|
||||||
}
|
}
|
||||||
|
@ -53,8 +53,8 @@ public abstract class FunctionNode extends Node {
|
|||||||
target.add(scope.define(param.name).index().toSet(false)).setLocation(param.loc());
|
target.add(scope.define(param.name).index().toSet(false)).setLocation(param.loc());
|
||||||
}
|
}
|
||||||
if (hasSelf) {
|
if (hasSelf) {
|
||||||
target.add(Instruction.loadCalled());
|
target.add(Instruction.loadCalled());
|
||||||
target.add(scope.define(selfName).index().toSet(false));
|
target.add(scope.define(selfName).index().toSet(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
body.compile(target, lastReturn, BreakpointType.NONE);
|
body.compile(target, lastReturn, BreakpointType.NONE);
|
||||||
|
@ -286,40 +286,40 @@ public final class JavaScript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ParseRes<List<VariableNode>> parseParameters(Source src, int i) {
|
public static ParseRes<List<VariableNode>> parseParameters(Source src, int i) {
|
||||||
var n = Parsing.skipEmpty(src, i);
|
var n = Parsing.skipEmpty(src, i);
|
||||||
|
|
||||||
var openParen = Parsing.parseOperator(src, i + n, "(");
|
var openParen = Parsing.parseOperator(src, i + n, "(");
|
||||||
if (!openParen.isSuccess()) return openParen.chainError(src.loc(i + n), "Expected a parameter list");
|
if (!openParen.isSuccess()) return openParen.chainError(src.loc(i + n), "Expected a parameter list");
|
||||||
n += openParen.n;
|
n += openParen.n;
|
||||||
|
|
||||||
var params = new ArrayList<VariableNode>();
|
var params = new ArrayList<VariableNode>();
|
||||||
|
|
||||||
var closeParen = Parsing.parseOperator(src, i + n, ")");
|
var closeParen = Parsing.parseOperator(src, i + n, ")");
|
||||||
n += closeParen.n;
|
n += closeParen.n;
|
||||||
|
|
||||||
if (!closeParen.isSuccess()) {
|
if (!closeParen.isSuccess()) {
|
||||||
while (true) {
|
while (true) {
|
||||||
n += Parsing.skipEmpty(src, i + n);
|
n += Parsing.skipEmpty(src, i + n);
|
||||||
|
|
||||||
var param = VariableNode.parse(src, i + n);
|
var param = VariableNode.parse(src, i + n);
|
||||||
if (!param.isSuccess()) return ParseRes.error(src.loc(i + n), "Expected a parameter or a closing brace");
|
if (!param.isSuccess()) return ParseRes.error(src.loc(i + n), "Expected a parameter or a closing brace");
|
||||||
n += param.n;
|
n += param.n;
|
||||||
n += Parsing.skipEmpty(src, i + n);
|
n += Parsing.skipEmpty(src, i + n);
|
||||||
|
|
||||||
params.add(param.result);
|
params.add(param.result);
|
||||||
|
|
||||||
if (src.is(i + n, ",")) {
|
if (src.is(i + n, ",")) {
|
||||||
n++;
|
n++;
|
||||||
n += Parsing.skipEmpty(src, i + n);
|
n += Parsing.skipEmpty(src, i + n);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src.is(i + n, ")")) {
|
if (src.is(i + n, ")")) {
|
||||||
n++;
|
n++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ParseRes.res(params, n);
|
return ParseRes.res(params, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>J2S Debugger</title>
|
<title>J2S Debugger</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
This is the debugger of J2S. It implement the <a href="https://chromedevtools.github.io/devtools-protocol/1-2/">V8 Debugging protocol</a>,
|
This is the debugger of J2S. It implement the <a href="https://chromedevtools.github.io/devtools-protocol/1-2/">V8 Debugging protocol</a>,
|
||||||
so you can use the devtools in chrome.<br>
|
so you can use the devtools in chrome.<br>
|
||||||
The debugger is still in early development, so please report any issues to
|
The debugger is still in early development, so please report any issues to
|
||||||
<a href="https://git.topcheto.eu/topchetoeu/j2s/issues">the git repo</a>.
|
<a href="https://git.topcheto.eu/topchetoeu/j2s/issues">the git repo</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Here are the available entrypoints:
|
Here are the available entrypoints:
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="json/version">/json/version</a> - version and other stuff about the J2S engine</li>
|
<li><a href="json/version">/json/version</a> - version and other stuff about the J2S engine</li>
|
||||||
<li><a href="json/list">/json/list</a> - a list of all entrypoints</li>
|
<li><a href="json/list">/json/list</a> - a list of all entrypoints</li>
|
||||||
<li><a href="json/protocol">/json/protocol</a> - documentation of the implemented V8 protocol</li>
|
<li><a href="json/protocol">/json/protocol</a> - documentation of the implemented V8 protocol</li>
|
||||||
<li>/(any target) - websocket entrypoints for debugging</li>
|
<li>/(any target) - websocket entrypoints for debugging</li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Running ${NAME} v${VERSION} by ${AUTHOR}
|
Running ${NAME} v${VERSION} by ${AUTHOR}
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user