Commit Graph

23 Commits

Author SHA1 Message Date
Rachel Fenichel 1b29a00267 chore: update php block generators to const and let (#5663) 2021-11-03 10:34:27 -07:00
Neil Fraser 90b3f75d82 Remove @author tags (#5601)
Our files are up to a decade old, and have churned so much, that the initial author of the file no longer has much meaning.

Furthermore, this will encourage developers to post to the developer group, rather than emailing Googlers (usually me) directly.
2021-10-15 09:50:46 -07:00
Neil Fraser c929b3015b chore: Convert == to === and != to !== where possible. (#5599) 2021-10-15 09:17:04 -07:00
Neil Fraser 2f2252f588 Rename variableDB_ to nameDB_
There is significant confusion in names and comments with regards to variables and procedures.  `Blockly.Generator.prototype.variableDB_` is a Blockly.Names database, not a variable map.  This rename introduces a getter and setter so deprecated references still work.  This commit also fixes some comments which are either outright wrong or misleading regarding variable and procedure names.
2021-05-27 21:30:26 -07:00
Neil Fraser 4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Sam El-Husseini 72c6aa8699 Block generator warnings (#3353) 2019-10-28 16:20:25 -07:00
Sam El-Husseini 64c52efb5b Resolve warnings in generator code (#3350) 2019-10-28 09:35:40 -07:00
Neil Fraser b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Neil Fraser e77a9b7e81 Change parseFloat() to Number()
Number() is a bit less forgiving than parseFloat() and is more likely to generate NaN rather than some random number.  An audit of each case shows nowhere that parseFloat()’s features are needed.
2019-08-01 11:36:58 -07:00
Neil Fraser 05253d0766 Add prefix/suffix to orphaned value blocks.
Also respect suppressPrefixSuffix on loops when generating prefix/suffix with continue/break blocks.
2019-05-17 15:04:39 -07:00
Neil Fraser c0e14c3a7c Add method to suppress prefix/suffix from blocks.
This allows generators to have more control over the placement of suffix.  Needed for ‘if’ blocks and function calls which require their suffix code to be somewhere other than the end.
Also, add loop’s prefix to ‘break’ blocks, since the loop’s suffix will be the next statement hit.
Also, reuse procedures_callreturn generator for procedures_callnoreturn.
2019-05-14 17:19:31 -07:00
Neil Fraser 25adb40e66 Prefix and suffix edge cases for flow statements.
Call suffix code on break/continue before executing the break/continue.
Call prefix code for enclosing loop before executing continue.
2019-05-14 17:19:31 -07:00
Neil Fraser 0259f8bb48 Add extra suffix when generating if/return block.
Also fix loops in Lua.
2019-05-14 17:19:31 -07:00
Neil Fraser c8bfc888c8 Throw errors instead of strings. (#1974)
Blocks and generators
2018-07-16 16:33:44 -07:00
Neil Fraser 652e57bc38 Generate for loops on one line. 2016-06-09 17:27:27 -07:00
Neil Fraser cb26a13b00 Fix generators for deprecated controls_repeat block. 2015-09-07 19:42:22 -07:00
Neil Fraser bafb3016fd Remove duplicated generators. 2015-07-23 13:11:51 -07:00
Neil Fraser d819db2acf Lint corrections. 2015-07-02 19:41:10 -07:00
daarond 0faf2b7a53 still working on tests, lists are the only unfinished 2015-05-12 21:35:49 -05:00
daarond 867d6c03da changes from Neil's comments 2015-05-12 16:20:57 -05:00
daarond 5e7f92cec3 more debugging 2015-05-10 00:40:01 -05:00
daarond da2e0710bf fixing some items 2015-05-09 17:48:55 -05:00
daarond f0c837bb2d starting php support addition 2015-05-09 16:52:36 -05:00