-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some additional list functions #844
Add some additional list functions #844
Conversation
var functionName = Blockly.Lua.provideFunction_( | ||
'list_reverse', | ||
['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(l)', | ||
' local t = {}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename these variables to be more descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I just copied the variable names that are used in all the other Lua functions in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit then lgtm
Done. |
@@ -1015,6 +1015,13 @@ Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = 'Split text into a list of texts, breaki | |||
/// https://github.com/google/blockly/wiki/Lists#make-text-from-list] for more information. | |||
Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = 'Join a list of texts into one text, separated by a delimiter.'; | |||
|
|||
/// url - Information describing reversing a list. | |||
Blockly.Msg.LISTS_REVERSE_HELPURL = ''; | |||
/// Reverse a list of items %1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"block text - Title of block that returns a copy of a list (%1) with the order of items reversed."
@@ -1015,6 +1015,13 @@ Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = 'Split text into a list of texts, breaki | |||
/// https://github.com/google/blockly/wiki/Lists#make-text-from-list] for more information. | |||
Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = 'Join a list of texts into one text, separated by a delimiter.'; | |||
|
|||
/// url - Information describing reversing a list. | |||
Blockly.Msg.LISTS_REVERSE_HELPURL = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead and fill this in as: https://github.com/google/blockly/wiki/Lists#reversing-a-list
When you submit, also make a new issue to create this wiki content. We can probably make you an editor for the wiki and would greatly appreciate help adding the docs for your new blocks there.
Unless you find a Wikipedia or similar description of reversing a list. That would be good, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same applies for each of the new text blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do.
Blockly.Msg.LISTS_REVERSE_HELPURL = ''; | ||
/// Reverse a list of items %1. | ||
Blockly.Msg.LISTS_REVERSE_MESSAGE0 = 'reverse %1'; | ||
/// tooltip - See [https://github.com/google/blockly/wiki/Lists#reversing-a-list]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until the wiki docs are created, this will not be sufficient for translators.
"tooltip - Short description for a block that reverses a copy of a list."
Requested rewordings have been made. |
Mirroring #830, this adds
The lists codegen unit tests pass in all five languages (once you remove the pre-exisiting PHP tests that are syntactically invalid).