gobstones-code-runner 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/htmls/gobstones-code-runner.html +18 -8
- data/lib/gobstones/code-runner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e573e21d04542a3a3c641184dbde11da4cc41c68fa0bca64a4314936522c72b5
|
4
|
+
data.tar.gz: 0c76ec7c9017defb7b66268c5f483818576b9f0a8de829dd26adff4339558801
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd5c4dd52aed44d217c2a4187e34d8dfc822fd3e465078f5577f489f235a4e37a5e4a013567787a3fab62ced7ec93f2f41140da66db80dcd6a4d46d194b788e4
|
7
|
+
data.tar.gz: 35fca0ed6734d05c9d081932fe5c68a02722782f771622c279a4170e1f4e640624cad3b53d234eb81882e277cc4d465aa48ff378d3e344a793d5418e78686950
|
@@ -4214,25 +4214,34 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
4214
4214
|
try {
|
4215
4215
|
var result = this.parser.interpret(ast.program, initialState);
|
4216
4216
|
return {
|
4217
|
-
states: this._getStates(result, ast
|
4217
|
+
states: this._getStates(result, ast),
|
4218
4218
|
returnValue: result.returnValue,
|
4219
4219
|
actualReturnValue: result.actualReturnValue
|
4220
4220
|
};
|
4221
4221
|
} catch (e) {
|
4222
4222
|
e.location = this.parser.getErrorLineAndMode(e, code);
|
4223
4223
|
return {
|
4224
|
-
states: this._getStates(e, ast
|
4224
|
+
states: this._getStates(e, ast, { error: e })
|
4225
4225
|
};
|
4226
4226
|
}
|
4227
4227
|
}
|
4228
4228
|
|
4229
|
-
|
4230
|
-
|
4231
|
-
this.parser.getActionsFromAst(
|
4229
|
+
_getActionsOf(ast) {
|
4230
|
+
return this.__flatten(Object.values(
|
4231
|
+
this.parser.getActionsFromAst(ast)
|
4232
4232
|
)).map(it => it.name);
|
4233
|
+
}
|
4233
4234
|
|
4234
|
-
|
4235
|
+
_getStates(result, ast, lastState = []) {
|
4236
|
+
const studentAtomic = this._getActionsOf(ast.main).filter((it) =>
|
4237
|
+
ast.main.getAttributes(it).atomic != null
|
4238
|
+
);
|
4239
|
+
const teacherAtomic = this._getActionsOf(ast.teacher).filter((it) =>
|
4240
|
+
ast.main.getAttributes(it).nonatomic == null
|
4241
|
+
);
|
4242
|
+
const atomicActions = studentAtomic.concat(teacherAtomic);
|
4235
4243
|
|
4244
|
+
const snapshots = result.snapshots;
|
4236
4245
|
return snapshots
|
4237
4246
|
.filter((snapshot, i) => {
|
4238
4247
|
const toName = (it) => it.split("-")[0];
|
@@ -4241,10 +4250,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
4241
4250
|
const lastName = snapshot.contextNames[snapshot.contextNames.length - 1];
|
4242
4251
|
|
4243
4252
|
let topIgnoredName = prevNames.find((it) =>
|
4244
|
-
|
4253
|
+
atomicActions.includes(toName(it))
|
4245
4254
|
) || lastName;
|
4246
4255
|
|
4247
|
-
const hasToIgnoreIt =
|
4256
|
+
const hasToIgnoreIt = atomicActions.includes(toName(topIgnoredName));
|
4248
4257
|
|
4249
4258
|
const isTheLastOcurrence = snapshots.slice(i + 1).every(futureSnapshot =>
|
4250
4259
|
!futureSnapshot.contextNames.includes(topIgnoredName)
|
@@ -20134,6 +20143,7 @@ function writeJboardToFile(filename, jboard) {
|
|
20134
20143
|
|
20135
20144
|
this.runner.run({
|
20136
20145
|
ast: {
|
20146
|
+
main: ast,
|
20137
20147
|
program: ast.program,
|
20138
20148
|
teacher: teacherAst
|
20139
20149
|
},
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gobstones-code-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Alfonso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|