Merge pull request #285 from drigz/reswords

Add missing comma to Lua reserved words
This commit is contained in:
Neil Fraser
2016-03-14 15:53:25 -07:00
2 changed files with 3 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ Blockly.Lua = new Blockly.Generator('Lua');
*/
Blockly.Lua.addReservedWords(
// Special character
'_' +
'_,' +
// From theoriginalbit's script:
// https://github.com/espertus/blockly-lua/issues/6
'__inext,assert,bit,colors,colours,coroutine,disk,dofile,error,fs,' +

View File

@@ -119,12 +119,12 @@ Blockly.Lua['lists_indexOf'] = function(block) {
* @private
* @param {string} listname Name of the list, used to calculate length.
* @param {string} where The method of indexing, selected by dropdown in Blockly
* @param {=string} opt_at The optional offset when indexing from start/end.
* @param {string=} opt_at The optional offset when indexing from start/end.
* @return {string} Index expression.
*/
Blockly.Lua.lists.getIndex_ = function(listname, where, opt_at) {
if (where == 'FIRST') {
return 1;
return '1';
} else if (where == 'FROM_END') {
return '#' + listname + ' + 1 - ' + opt_at;
} else if (where == 'LAST') {