blockly-fluid 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +17 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -156,6 +156,23 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
+
if (!languageGenerator.hatStackToCode) {
|
|
160
|
+
languageGenerator.hatStackToCode = (hatBlock) => {
|
|
161
|
+
if (!hatBlock) return "";
|
|
162
|
+
|
|
163
|
+
let code = "";
|
|
164
|
+
let current = hatBlock.getNextBlock();
|
|
165
|
+
|
|
166
|
+
while (current) {
|
|
167
|
+
code += (languageGenerator.forBlock.hasOwnProperty(current.type)) ? languageGenerator.forBlock[current.type](current) : "";
|
|
168
|
+
|
|
169
|
+
current = current.getNextBlock();
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
return code;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
|
|
159
176
|
languageGenerator.forBlock[name] = (block) => (((code) => {
|
|
160
177
|
if (!output) return code;
|
|
161
178
|
|