Open sancarn opened 8 years ago
It might also be useful to include other transpiler options. For instance:
CONTAINS{ Start: {" End: "} } WITH CONTAINS { contained = replace(contained,"\r\n", """ & mbCrLf & """ contained = makeMultilineCommand(contained) return contained }
It may be desired for these custom MapBasic functions to reside separate from the standard application (perhaps in a sub-folder, A_ScriptDir/Libraries/...)
Required information:
Each of these statements should be surrounded in a special string to provide easy extraction with RegEx. For example:
Declares will be automatically added into the header of the file and should not be included in the code block. All Declare blocks will be removed with RegexReplace(str,"Declare.*","") [unless anyone can offer a reason as to why this is a bad idea!]
Each sub/function should be kept separate. If one requires the existence of another a comment should be added 'Requires "Name of Function or Sub". - Why? Mainly for future features. It may be nice for users to select which functions they want to use from which libraries.
It may also be nice to add functionality for custom statements. Classes and COMObjects would also be a nice feature if possible to implement in MB.
Custom Statement Idea: Set up a Regex replace to find statements and replace them with sub-routine calls:
Then define the sub-routine calls separately:
This setup would convert something like this: place "this" on "that"
Into this: call place("this","on","that")
Which would call the base sub-routine function. In the end these are simply sub-routines, but they may be easier to understand in this context than as actual sub-routine.