Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
albireo77 committed Apr 12, 2018
1 parent ea6e1c9 commit cf8cad5
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
6.0 [09.04.2018]
6.0 [12.04.2018]
- add Java support
- add FileContentsTemplate tag to language definition files
- fix disappearing forms when showing dialog window
Expand Down
11 changes: 7 additions & 4 deletions Common/ApplicationCommon.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1284,18 +1284,21 @@ class function TInfra.GetDimensions(const AText: string): TArray<string>;

class function TInfra.GetDimensionCount(const AText: string): integer;
var
i: integer;
i, len: integer;
txt: string;
nextOpen: boolean;
begin
txt := ReplaceStr(AText, ' ', '');
if txt.StartsWith('[') then
len := txt.Length;
if len = 0 then
Exit(-1);
if txt[1] = '[' then
begin
if not txt.EndsWith(']') then
if txt[len] <> ']' then
Exit(-1);
result := 0;
nextOpen := true;
for i := 1 to txt.Length do
for i := 1 to len do
begin
if txt[i] = '[' then
begin
Expand Down
6 changes: 3 additions & 3 deletions LanguageDefinitions/Java.xml
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,14 @@ Available placeholders are the same as for element FunctionHeaderTemplate.
<!--
Element FunctionHeaderTypeModifier1
Description: It returns value based on whether or not function returns specific type
It returns value "void" if function type is none or an empty string if not
It returns value "void" if function type is none or an empty string otherwise
-->
<FunctionHeaderTypeModifier1>void|</FunctionHeaderTypeModifier1>

<!--
Element FunctionHeaderStaticModifier
Description: It returns value based on whether or not function is static
In given example, it returns value "static " if function is static or empty string if not
In given example, it returns value "static " if function is static or an empty string otherwise
-->
<FunctionHeaderStaticModifier>static |</FunctionHeaderStaticModifier>

Expand All @@ -463,7 +463,7 @@ It returns value "public " if function is external or "private " if not
<!--
Element FunctionHeaderTypeArrayModifier
Description: It returns value based on whether or not function return type is an array
In given example, it returns value "[]" if function return type is array or an empty string if not
In given example, it returns value "[]" if function return type is array or an empty string otherwise
-->
<FunctionHeaderTypeArrayModifier>[]|</FunctionHeaderTypeArrayModifier>

Expand Down
2 changes: 1 addition & 1 deletion LanguageDefinitions/Pascal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ end;
<!--
Element ForDoTemplateModifier1
Description: It returns value based on whether for..do block is increasing or decreasing
It returns value "<=" if block is increasing or ">=" if decreasing
It returns value "to" if block is increasing or "downto" if decreasing
-->
<ForDoTemplateModifier1>to|downto</ForDoTemplateModifier1>

Expand Down
137 changes: 134 additions & 3 deletions LanguageDefinitions/Python.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,24 @@ It may not contain all supported tags. For all supported tags and their descript
<KeyWord>with</KeyWord>
<KeyWord>yield</KeyWord>
</KeyWords>


<!--
Element ProcedureLabelKey
Description: Key for abel displayed for flowchart of function that returns nothing (type = none).
It should contain name of key (free to be added) present in translation file (.lng) in Others section
-->
<ProcedureLabelKey>ProcedureLabelPython</ProcedureLabelKey>

<!--
Element ConstructorLabelKey
Description: Key for label displayed for constructor flowchart
-->
<ConstructorLabelKey>ConstructorLabelPython</ConstructorLabelKey>

<!--
Element FunctionLabelKey
Description: Key for label displayed for flowchart of function that returns some data
-->
<FunctionLabelKey>FunctionLabelPython</FunctionLabelKey>

<!--
Expand Down Expand Up @@ -146,6 +161,10 @@ else:
break
</RepeatUntilTemplate>

<!--
Element ForDoVarList
Determines whether control variable in for..do block should be selected from dropdown list (true) or user is free to enter anything (false)
-->
<ForDoVarList>false</ForDoVarList>

<ForDoVarString>in</ForDoVarString>
Expand All @@ -168,56 +187,168 @@ else:

<FolderTemplate>%b1</FolderTemplate>

<!--
Element ProgramHeaderTemplate
Available placeholders:
%s1 - project name
%s2 - language name
%s3 - text from comment marked as Program Header
%s4 - code generation timestamp
%s5 - language definition file used for code generation
-->
<ProgramHeaderTemplate># %s2 program generated by devFlowcharter
# for %s1 project
#
# %s3

</ProgramHeaderTemplate>

<!--
Element FunctionHeaderArgsEntryMask
Available placeholders:
%s1 - argument name
%s2 - argument type
%s3 - used if argument is passed by reference (element FunctionHeaderArgsEntryRef)
%s4 - used if argument is an array (element FunctionHeaderArgsEntryArray)
%s5 - used if argument is a record (element FunctionHeaderArgsEntryRecord)
%s6 - used if argument is an enumeration (element FunctionHeaderArgsEntryEnum)
%s7 - expression for argument default value (element FunctionHeaderArgsEntryDefault)
-->
<FunctionHeaderArgsEntryMask>%s1%s7, </FunctionHeaderArgsEntryMask>

<!--
Element FunctionHeaderArgsEntryDefault
Description: Template for function parameter default value
Available placeholders:
%s - default value
-->
<FunctionHeaderArgsEntryDefault> = %s</FunctionHeaderArgsEntryDefault>

<FunctionHeaderArgsStripCount>2</FunctionHeaderArgsStripCount>

<!--
Element FunctionHeaderTemplate
Description: Template for function header
Available placeholders:
%s1 - name of the function
%s2 - description/prefix of the function
%s3 - list of function parameters (list of FunctionHeaderArgsEntryMask elements)
%s4 - return type
%s5 - first string that depends if return type is none or specific (element FunctionHeaderTypeModifier1)
%s6 - second string that depends if return type is none or specific (element FunctionHeaderTypeModifier2)
%s7 - string that depends if function is external or not (element FunctionHeaderExternalModifier); see also description for element ExternalLabel
%s8 - string that depends if function return type is array or not (element FunctionHeaderTypeArrayModifier)
%s9 - string that depends if function is of static context (element FunctionHeaderStaticModifier); see also description for element StaticLabel
-->
<FunctionHeaderTemplate>%s2
def %s1(%s3):
</FunctionHeaderTemplate>

<!--
Element FunctionBodyTemplate
Description: Template for function body
Available placeholders:
%s1 - function name
%s2 - function local variables (element VarTemplate)
%b1 - body of function
-->
<FunctionBodyTemplate> %s2
%b1
</FunctionBodyTemplate>

<!--
Element FunctionTemplate
Description: Template for function (header + body)
Available placeholders:
%s1 - function's header line (element FunctionHeaderTemplate or ConstructorHeaderTemplate)
%s2 - function's local variables (element VarTemplate)
%s3 - function's body (element FunctionBodyTemplate)
-->
<FunctionTemplate>%s1
%s3

</FunctionTemplate>

<!--
Element FunctionsTemplate
Description: Template for user functions section
Available placeholders:
%s1 - list of function declarations (list of FunctionTemplate elements)
-->
<FunctionsTemplate>%s1</FunctionsTemplate>

<!--
Element MainFunctionTemplate
Description: Template for main program body
Available placeholders:
%s1 - project name
%s2 - global variables (element VarTemplate)
%s3 - return statement which is generated if last statement of program isn't return block (element ProgramReturnTemplate)
%b1 - main function body
-->
<MainFunctionTemplate>
%b1

</MainFunctionTemplate>

<!--
Element VarEntry
Description: Entry for single variable (non-array) declaration
Available placeholders:
%s1 - variable name
%s2 - variable type
%s4 - variable initial value (element VarEntryInit or VarEntryInitExtern)
%s5 - used if variable is a record (element FunctionHeaderArgsEntryRecord)
%s6 - used if variable is an enumeration (element FunctionHeaderArgsEntryEnum)
%s7 - string depending if variable is external (element ExternVarModifier)
-->
<VarEntry>%s1%s4</VarEntry>

<!--
Element VarEntryArray
Description: Entry for single array variable declaration
Available placeholders are the same as for VarEntry element and:
%s3 - list of array sizes (VarEntryArraySize element)
-->
<VarEntryArray>%s1%s4</VarEntryArray>

<!--
Element VarEntryInit
Description: Mask for not external variable initial value
Available placeholders:
%s1 - variable initial value
-->
<VarEntryInit> = %s1</VarEntryInit>

<!--
Element VarEntryInitExtern
Description: Mask for external variable initial value
Available placeholders:
%s1 - variable initial value
-->
<VarEntryInitExtern> = %s1</VarEntryInitExtern>

<!--
Element VarTemplate
Description: Template for section to declare variables
Available placeholders:
%s1 - list of variables (VarEntry or VarEntryArray elements)
-->
<VarTemplate>%s1
</VarTemplate>

<!--
Element LibTemplate
Description: Template for section containing libraries
Available placeholders:
%s1 - list of libraries as separated entries (list of LibEntry elements)
%s2 - list of libraries as single list (element LibEntryList)
Notice: %s1 and %s2 placeholders should be used interchangeably
-->
<LibTemplate>import %s2

</LibTemplate>

<LibEntryList>%s, </LibEntryList>

<LibEntryListStripCount>2</LibEntryListStripCount>

</Language>
16 changes: 16 additions & 0 deletions LanguageDefinitions/TIBASIC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,15 @@ EndIf

<ElseLabel>Else</ElseLabel>

<!--
Element ForDoTemplate
Available placeholders:
%s1 - control variable
%s2 - start value
%s3 - stop value
%s4 - first "increasing or decreasing" modifier string (element ForDoTemplateModifier1)
%s5 - second "increasing or decreasing" modifier string (element ForDoTemplateModifier2)
-->
<ForDoTemplate>For %s1,%s2,%s3
%b1
EndFor
Expand All @@ -476,6 +485,13 @@ Determines whether control variable in for..do block should be selected from dro

<FolderTemplate>%b1</FolderTemplate>

<!--
Element UserTypeDesc
Description: Mask for user datatype description
Available placeholders:
%s1 - type name
%s2 - type kind
-->
<UserTypeDesc>%s2 %s1</UserTypeDesc>

</Language>

0 comments on commit cf8cad5

Please sign in to comment.