-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from JMU-CS/dev
Bug fixes from first sync session
- Loading branch information
Showing
15 changed files
with
855 additions
and
820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* blocks2tree.js */ | ||
|
||
praxlyGenerator['praxly_StringFunc_block'] = (block) => { | ||
const expression = block.getInputTargetBlock('EXPRESSION'); | ||
var procedureName = block.getFieldValue('FUNCTYPE'); | ||
var args = block.getInputTargetBlock('PARAMS'); | ||
var argschildren = args.getChildren(true); | ||
var argsList = []; | ||
argschildren.forEach(element => { | ||
argsList.push(praxlyGenerator[element.type](element)); | ||
}); | ||
return customizeMaybe(block, { | ||
blockID: block.id, | ||
type: NODETYPES.SPECIAL_STRING_FUNCCALL, | ||
left: praxlyGenerator[expression.type](expression), | ||
right: { | ||
name: procedureName, | ||
args: argsList, | ||
type: NODETYPES.FUNCCALL | ||
} | ||
}); | ||
} | ||
|
||
/* newBlocks.js */ | ||
|
||
a = [ | ||
{ // text 1 | ||
"type": "praxly_StringFunc_block", | ||
"message0": "%1.%2(%3)", | ||
"args0": [ | ||
{ | ||
"type": "input_value", | ||
"name": "EXPRESSION" | ||
}, | ||
{ | ||
"type": "field_dropdown", | ||
"name": "FUNCTYPE", | ||
"options": [ | ||
["charAt", StringFuncs.CHARAT], | ||
["contains", StringFuncs.CONTAINS], | ||
['indexOf', StringFuncs.INDEXOF], | ||
["length", StringFuncs.LENGTH], | ||
["substring", StringFuncs.SUBSTRING], | ||
["toLowerCase", StringFuncs.TOLOWERCSE], | ||
["toUpperCase", StringFuncs.TOUPPERCASE], | ||
] | ||
}, | ||
{ | ||
"type": "input_value", | ||
"name": "PARAMS", | ||
"text": "params" | ||
}, | ||
], | ||
"inputsInline": true, | ||
"output": null, | ||
"style": 'other_blocks', | ||
"tooltip": "String methods:\ncharAt(i) - Returns the character at index i\ncontains(s) - Returns true if s is a substring\nindexOf(s) - Returns the first index of substring s, or -1 if not found\nlength() - Returns the length of the string\nsubstring(i, j) - Extracts characters from index i up to but not including index j\ntoLowerCase() - Converts the string to all lowercase\ntoUpperCase() - Converts the string to all uppercase", | ||
"helpUrl": "" | ||
}, | ||
] | ||
|
||
/* toolbox.js */ | ||
|
||
b = [ | ||
{ | ||
'kind': 'block', | ||
'type': 'praxly_StringFunc_block', | ||
'inputs': { | ||
'EXPRESSION': { | ||
'shadow': { | ||
'type': 'praxly_literal_block', | ||
'fields': { | ||
'LITERAL': '\"hello, world\"', | ||
} | ||
}, | ||
}, | ||
'PARAMS': { | ||
'block': { | ||
'type': 'praxly_parameter_block', | ||
} | ||
} | ||
} | ||
}, | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[ | ||
{ // not used | ||
"type": "praxly_null_block", | ||
"message0": "null", | ||
"inputsInline": true, | ||
"output": null, | ||
"style": 'expression_blocks', | ||
"tooltip": "", | ||
"helpUrl": "" | ||
}, | ||
|
||
{ // not used | ||
"type": "praxly_class_block", | ||
"message0": "class %1 %2 end class", | ||
"args0": [ | ||
{ | ||
"type": "input_dummy" | ||
}, | ||
{ | ||
"type": "input_statement", | ||
"name": "class" | ||
} | ||
], | ||
"inputsInline": true, | ||
"previousStatement": null, | ||
"nextStatement": null, | ||
"style": "class_blocks", | ||
"tooltip": "", | ||
"helpUrl": "" | ||
}, | ||
|
||
{ // not used | ||
"type": "praxly_String_block", | ||
"message0": "\"%1\"", | ||
"args0": [ | ||
{ | ||
"type": "field_input", | ||
"name": "LITERAL", | ||
"text": "String" | ||
} | ||
], | ||
"output": null, | ||
"style": 'expression_blocks', | ||
"tooltip": "", | ||
"helpUrl": "" | ||
}, | ||
|
||
{ // not used | ||
"type": "custom_operation_block", | ||
"message0": "Custom Operation %1 %2", | ||
"args0": [ | ||
{ | ||
"type": "input_value", | ||
"name": "input1", | ||
"check": "Number", | ||
"align": "RIGHT", | ||
"defaultType": "math_number", | ||
"defaultValue": 5 | ||
}, | ||
{ | ||
"type": "input_value", | ||
"name": "input2", | ||
"check": "Number", | ||
"align": "RIGHT", | ||
"defaultType": "math_number", | ||
"defaultValue": 10 | ||
} | ||
], | ||
"output": "Number", | ||
"colour": 230, | ||
"tooltip": "Perform custom operation", | ||
"helpUrl": "" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.