mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Fix order errors in text generators (#4329)
* Fix dart text generator logic * Fix Javascript text generator logic. * Fix Lua text generator logic * Fix php text generator logic * Fix python text generator logic * Fix error in substring logic * Fix unit test block generators * Update from ORDER_COMMA to ORDER_NONE * Update golden files
This commit is contained in:
@@ -50,7 +50,7 @@ Blockly.Dart.addReservedWords(
|
||||
|
||||
/**
|
||||
* Order of operation ENUMs.
|
||||
* https://www.dartlang.org/docs/dart-up-and-running/ch02.html#operator_table
|
||||
* https://dart.dev/guides/language/language-tour#operators
|
||||
*/
|
||||
Blockly.Dart.ORDER_ATOMIC = 0; // 0 "" ...
|
||||
Blockly.Dart.ORDER_UNARY_POSTFIX = 1; // expr++ expr-- () [] . ?.
|
||||
@@ -158,7 +158,7 @@ Blockly.Dart.scrubNakedValue = function(line) {
|
||||
* Encode a string as a properly escaped Dart string, complete with quotes.
|
||||
* @param {string} string Text to encode.
|
||||
* @return {string} Dart string.
|
||||
* @private
|
||||
* @protected
|
||||
*/
|
||||
Blockly.Dart.quote_ = function(string) {
|
||||
// Can't use goog.string.quote since $ must also be escaped.
|
||||
@@ -174,7 +174,7 @@ Blockly.Dart.quote_ = function(string) {
|
||||
* quotes.
|
||||
* @param {string} string Text to encode.
|
||||
* @return {string} Dart string.
|
||||
* @private
|
||||
* @protected
|
||||
*/
|
||||
Blockly.Dart.multiline_quote_ = function (string) {
|
||||
var lines = string.split(/\n/g).map(Blockly.Dart.quote_);
|
||||
@@ -183,7 +183,6 @@ Blockly.Dart.multiline_quote_ = function (string) {
|
||||
return lines.join(' + \'\\n\' + \n');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Common tasks for generating Dart from blocks.
|
||||
* Handles comments for the specified block and any connected value blocks.
|
||||
@@ -192,7 +191,7 @@ Blockly.Dart.multiline_quote_ = function (string) {
|
||||
* @param {string} code The Dart code created for this block.
|
||||
* @param {boolean=} opt_thisOnly True to generate code for only this statement.
|
||||
* @return {string} Dart code with comments and subsequent blocks added.
|
||||
* @private
|
||||
* @protected
|
||||
*/
|
||||
Blockly.Dart.scrub_ = function(block, code, opt_thisOnly) {
|
||||
var commentCode = '';
|
||||
|
||||
Reference in New Issue
Block a user