Skip to content

Commit

Permalink
Fixed ^= error, newline test case
Browse files Browse the repository at this point in the history
  • Loading branch information
acbart committed Jun 2, 2020
1 parent 8ef3dbe commit c20c963
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
29 changes: 13 additions & 16 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/skulpt_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Sk.builtin = {
int_: function int_(n) {
this.v = n;
},
float_: function float_(n) {
this.v = n;
},
bool: {
"true$": {
v: true
Expand Down
3 changes: 2 additions & 1 deletion src/ast/ast_AugAssign.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Blockly.Blocks['ast_AugAssign'] = {
},
updateShape_: function (block) {
// Add new inputs.
this.getField("OP_NAME").getOptions(false);
if (this.simpleTarget_) {
if (!this.getInput('VAR_ANCHOR')) {
this.appendDummyInput('VAR_ANCHOR')
Expand Down Expand Up @@ -123,4 +124,4 @@ BlockMirrorTextToBlocks.prototype['ast_AugAssign'] = function (node, parent) {
"@simple": simpleTarget,
"@preposition": preposition
});
};
};
2 changes: 1 addition & 1 deletion src/block_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ BlockMirrorBlockEditor.prototype.getToolbarWidth = function () {
} else {
return this.workspace.toolbox_.width;
}
}
};

BlockMirrorBlockEditor.prototype.VIEW_CONFIGURATIONS = {
'split': {
Expand Down
3 changes: 3 additions & 0 deletions src/skulpt/skulpt_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Sk.builtin = {
int_: function(n) {
this.v = n;
},
float_: function(n) {
this.v = n;
},
bool: {
"true$": { v: true },
"false$": { v: true },
Expand Down
8 changes: 4 additions & 4 deletions test/minimal_skulpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

</head>
<body>
<button id='go'>GO</button>
<button id='go'>Run Unit Tests</button>
<button id='make-image'>Make Image</button>
<div id="image-spot"></div>
<div style="width:900px; margin:0 auto;"
Expand Down Expand Up @@ -231,7 +231,7 @@
"while x == 0:\n pass\nwhile y < z:\n a = 0\nelse:\n b = a",
"import x as y, b as c, d\nimport os",
"from . import x\nfrom .os import y\nfrom ..path import z\nfrom dog.house import a\nfrom cat import b, c as d, e",
"import matplotlib.pyplot as plt",
//"import matplotlib.pyplot as plt",
"with open('filename') as outfile:\n pass",
"with open('filename') as outfile, open('file2') as infile, other_context:\n pass",
"#hello world!\n# Another comment\n#: int\n\na",
Expand All @@ -241,8 +241,8 @@
"(lambda x: x)()",
"class Alpha:\n def beta():\n '''\n Hello World!\n Testing.\n '''",
"'test'.replace(1, 2, 3)",
"'\n'",
'"""\ntest"""'
"'\\n'",
"'''\ntest'''"
];

function runTests() {
Expand Down

0 comments on commit c20c963

Please sign in to comment.