diff --git a/Build/4DPop Macros.4dbase.zip b/Build/4DPop Macros.4dbase.zip
index c715a6e..0a8ff11 100644
Binary files a/Build/4DPop Macros.4dbase.zip and b/Build/4DPop Macros.4dbase.zip differ
diff --git a/Build/Components/4DPop Macros.4dbase/4DPop Macros.4DZ b/Build/Components/4DPop Macros.4dbase/4DPop Macros.4DZ
index 45bd20e..cf1fb7b 100755
Binary files a/Build/Components/4DPop Macros.4dbase/4DPop Macros.4DZ and b/Build/Components/4DPop Macros.4dbase/4DPop Macros.4DZ differ
diff --git a/Build/Components/4DPop Macros.4dbase/Info.plist b/Build/Components/4DPop Macros.4dbase/Info.plist
index a964b7b..fafcdcc 100755
--- a/Build/Components/4DPop Macros.4dbase/Info.plist
+++ b/Build/Components/4DPop Macros.4dbase/Info.plist
@@ -6,13 +6,13 @@
CFBundleName
4DPop Macros
CFBundleVersion
- 277
+ 278
NSHumanReadableCopyright
©vdl 2009-2023
CFBundleGetInfoString
20R4
CFBundleLongVersionString
- 20R4 (276)
+ 20R4 (277)
CFBundleShortVersionString
20R4
CFBundleDisplayName
diff --git a/Build/Components/4DPop Macros.4dbase/Libraries/lib4d-arm64.dylib b/Build/Components/4DPop Macros.4dbase/Libraries/lib4d-arm64.dylib
index 319ed2f..63c836f 100644
Binary files a/Build/Components/4DPop Macros.4dbase/Libraries/lib4d-arm64.dylib and b/Build/Components/4DPop Macros.4dbase/Libraries/lib4d-arm64.dylib differ
diff --git a/Build/Components/4DPop Macros.4dbase/Resources/InfoPlist.strings b/Build/Components/4DPop Macros.4dbase/Resources/InfoPlist.strings
index 5a39683..9bf33d2 100755
Binary files a/Build/Components/4DPop Macros.4dbase/Resources/InfoPlist.strings and b/Build/Components/4DPop Macros.4dbase/Resources/InfoPlist.strings differ
diff --git a/Info.plist b/Info.plist
index a964b7b..fafcdcc 100755
--- a/Info.plist
+++ b/Info.plist
@@ -6,13 +6,13 @@
CFBundleName
4DPop Macros
CFBundleVersion
- 277
+ 278
NSHumanReadableCopyright
©vdl 2009-2023
CFBundleGetInfoString
20R4
CFBundleLongVersionString
- 20R4 (276)
+ 20R4 (277)
CFBundleShortVersionString
20R4
CFBundleDisplayName
diff --git a/Project/Sources/Classes/button.4dm b/Project/Sources/Classes/button.4dm
index 97623c0..f32ab22 100755
--- a/Project/Sources/Classes/button.4dm
+++ b/Project/Sources/Classes/button.4dm
@@ -8,9 +8,7 @@ Some specificity for button widgets
Class extends widget
/*═══════════════════*/
-Class constructor
-
- C_VARIANT:C1683($1)
+Class constructor( ... )
Super:C1705($1)
diff --git a/Project/Sources/Classes/declaration.4dm b/Project/Sources/Classes/declaration.4dm
index 2095f56..9391879 100755
--- a/Project/Sources/Classes/declaration.4dm
+++ b/Project/Sources/Classes/declaration.4dm
@@ -1,5 +1,16 @@
Class extends macro
+property lines; locales; parameters; classes : Collection
+
+//ACI0104313
+//property $notforArray : Collection
+//property $inCommentBlock: Boolean
+
+property settings : Object
+property localeNumber; parameterNumber : Integer
+
+property _patterns : Object
+
Class constructor
Super:C1705()
@@ -7,12 +18,7 @@ Class constructor
// Preferences
var $fileSettings : 4D:C1709.File
$fileSettings:=Folder:C1567(fk user preferences folder:K87:10).file("4DPop/4DPop Macros.settings")
-
- If ($fileSettings.original#Null:C1517)
-
- $fileSettings:=$fileSettings.original
-
- End if
+ $fileSettings:=$fileSettings.original || $fileSettings
If ($fileSettings.exists)
@@ -20,34 +26,46 @@ Class constructor
Else
- DECLARATION("Get_Syntax_Preferences")
+ _o_DECLARATION("Get_Syntax_Preferences")
End if
- This:C1470.lines:=New collection:C1472
- This:C1470.locales:=New collection:C1472
- This:C1470.parameters:=New collection:C1472
- This:C1470.classes:=New collection:C1472
+ This:C1470.lines:=[]
+ This:C1470.locales:=[]
+ This:C1470.parameters:=[]
+ This:C1470.classes:=[]
+ This:C1470.types:=[]
- This:C1470.types:=New collection:C1472
-
- This:C1470.$notforArray:=New collection:C1472
- This:C1470.$notforArray.push("collection"; "variant")
+ This:C1470.$notforArray:=["collection"; "variant"]
// Flags
This:C1470.$inCommentBlock:=False:C215
- This:C1470.init()
- //==============================================================
-Function init()
+ var $t : Text
+ $t:="(?mi-s)(?0) // Begin comment block
This:C1470.$inCommentBlock:=Not:C34(Match regex:C1019("(?mi-s)^/\\*.*\\*/"; $line.code; 1))
- //======================================
+ //╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
: ($pos{3}>0) // End comment block
This:C1470.$inCommentBlock:=False:C215
- //======================================
+ //╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
End case
- //––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (This:C1470.$inCommentBlock) // In comment block
$line.type:="comment"
- //––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
Else
// Remove textual values
Rgx_SubstituteText("(?m-si)(\"[^\"]*\")"; ""; ->$text)
// Remove Comments
- Rgx_SubstituteText("(?m-si)(//.*$)"; ""; ->$text)
+ Rgx_SubstituteText("(?m-si)("+kCommentMark+".*$)"; ""; ->$text)
// Searches parameters $0-N & ${N} into the line
/*------------------------------------------------------
declaration macro must omit the parameters of a formula
---> https:// Github.com/vdelachaux/4DPop-Macros/issues/6
+--> https: // Github.com/vdelachaux/4DPop-Macros/issues/6
--------------------------------------------------------*/
$t:=$text
$l:=Position:C15(Parse formula:C1576("Formula:C1597")+"("; $text; 1; *)
@@ -299,7 +320,9 @@ declaration macro must omit the parameters of a formula
If (Match regex:C1019("(?mi-s)var\\s|C_"; $text; 1)) // Declaration line
- If (Match regex:C1019("(?mi-s)\\s*:\\s*(?:Object)|((?:cs\\.\\w+)|(?:4D\\.\\w+))"; $text; 1; $pos; $len))
+ If (Match regex:C1019("(?mi-s)\\s*:\\s*(?:Object)"+\
+ "|((?:cs\\.\\w+)"+\
+ "|(?:4D\\.\\w+))"; $text; 1; $pos; $len))
If ($pos{1}#-1)
@@ -317,7 +340,7 @@ declaration macro must omit the parameters of a formula
End if
- If (Match regex:C1019("(?mi-s)//(.*)$"; $line.code; 1; $pos; $len))
+ If (Match regex:C1019("(?mi-s)"+kCommentMark+"(.*)$"; $line.code; 1; $pos; $len))
$parameter.comment:=Substring:C12($line.code; $pos{1}; $len{1})
@@ -337,7 +360,7 @@ declaration macro must omit the parameters of a formula
Case of
- //======================================
+ //╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
: (Match regex:C1019("(?mi-s)^var\\s|^C_"; $text; 1)) // DECLARATION LINE
$line.type:="declaration"
@@ -394,7 +417,9 @@ declaration macro must omit the parameters of a formula
End if
- If (Match regex:C1019("(?mi-s)\\s*:\\s*(?:Object)|((?:cs\\.\\w+)|(?:4D\\.\\w+))"; $text; 1; $pos; $len))
+ If (Match regex:C1019("(?mi-s)\\s*:\\s*(?:Object)"+\
+ "|((?:cs\\.\\w+)"+\
+ "|(?:4D\\.\\w+))"; $text; 1; $pos; $len))
If ($pos{1}#-1)
@@ -413,7 +438,7 @@ declaration macro must omit the parameters of a formula
End for each
End if
- //======================================
+ //╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
: (Match regex:C1019("(?mi-s)^(?:^ARRAY|^TABLEAU)\\s*[^(]*\\(([^;]*);\\s*[\\dx]+(?:;\\s*([\\dx]+))?\\)"; $text; 1; $pos; $len)) // ARRAY DECLARATION
$static:=Match regex:C1019("(?mi-s)0x"; $text; 1)
@@ -449,7 +474,7 @@ declaration macro must omit the parameters of a formula
$var.static:=$static
$var.type:=This:C1470.getTypeFromDeclaration($text)
- //======================================
+ //╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
Else // EXTRACT LOCAL VARIABLES
$rgx:=Rgx_match(New object:C1471(\
@@ -550,71 +575,71 @@ declaration macro must omit the parameters of a formula
Case of
- //……………………………………………………………………………………………………
+ //╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
: (Match regex:C1019("(?mi-s)\\"+$var.value+":=((?:cs|4d)\\.\\w*)\\.new\\([^)]*\\)(?!\\.)"; $line.code; 1; $pos; $len))
$var.class:=Substring:C12($line.code; $pos{1}; $len{1})
- //……………………………………………………………………………………………………
+ //╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
: (Match regex:C1019("(?mi-s)\\"+$var.value+":="+Parse formula:C1576("File:C1566")+"\\([^)]*\\)(?!\\.)"; $line.code; 1))
$var.class:="4D.File"
- //……………………………………………………………………………………………………
+ //╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
: (Match regex:C1019("(?mi-s)\\"+$var.value+":="+Parse formula:C1576("Folder:C1567")+"\\([^)]*\\)(?!\\.)"; $line.code; 1))
$var.class:="4D.Folder"
- //……………………………………………………………………………………………………
+ //╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
: (Match regex:C1019("(?mi-s)\\.\\w*(?:\\([^\\)]*\\))$"; $line.code; 1))
Case of
- //------------------------------------
+ //____________________________________
: (Bool:C1537($var.inDeclaration))
// THE DECLARATION MUST WIN
- //------------------------------------
+ //____________________________________
: ($var.class#Null:C1517)
$var.type:=38
- //------------------------------------
+ //____________________________________
: (False:C215)
// MARK:#TODO - get from member fonction or attribute
- //------------------------------------
+ //____________________________________
Else
$var.type:=0
- //------------------------------------
+ //____________________________________
End case
- //……………………………………………………………………………………………………
+ //╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
Else
// A "Case of" statement should never omit "Else"
- //……………………………………………………………………………………………………
+ //╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
End case
End if
Else
- // ie. : This.url:=$1
+ // Ie. : This.url:=$1
End if
End for each
End if
- //======================================
+ //╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
End case
- //––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
End case
This:C1470.lines.push($line)
@@ -627,8 +652,8 @@ declaration macro must omit the parameters of a formula
This:C1470.locales:=This:C1470.locales.orderBy("value asc")
This:C1470.parameters:=This:C1470.parameters.orderBy("value asc")
- // Place the parameter set last
- $o:=This:C1470.parameters.query("value=${@").pop()
+ // Place the variadic last
+ $o:=This:C1470.parameters.query("value = :1"; "...").pop()
If ($o#Null:C1517)
@@ -637,10 +662,16 @@ declaration macro must omit the parameters of a formula
End if
+ // $o:=This.parameters.query("value=${@").pop()
+ // If ($o#Null)
+ // This.parameters.push($o)
+ // This.parameters.remove(This.parameters.indexOf($o))
+ // End if
+
// Finally do a flat list
This:C1470.variables:=This:C1470.parameters.combine(This:C1470.locales)
- return (This:C1470)
+ return This:C1470
//==============================================================
Function parseParameters($line : Object)
@@ -655,17 +686,17 @@ Function parseParameters($line : Object)
//______________________________________________________
: ($line.type="Class constructor")
- $pattern:="(?mi-s)^(?!//)(.*)"+$line.type+"\\s*()(?:\\(([^)]*)\\))?\\s*()?\\s*(//[^$]*)?$"
+ $pattern:="(?mi-s)^(?!"+kCommentMark+")(.*)"+$line.type+"\\s*()(?:\\(([^)]*)\\))?\\s*()?\\s*("+kCommentMark+"[^$]*)?$"
//______________________________________________________
: ($line.type="Function")
- $pattern:="(?m-si)^(?!//)(.*)"+$line.type+"\\s([^(]*)(?:\\s*\\(([^)]*)\\))?(?:\\s*(?:->\\s*)?([^/]*))?\\s*(//[^$]*)?$"
+ $pattern:="(?m-si)^(?!"+kCommentMark+")(.*)"+$line.type+"\\s([^(]*)(?:\\s*\\(([^)]*)\\))?(?:\\s*(?:->\\s*)?([^/]*))?\\s*("+kCommentMark+"[^$]*)?$"
//______________________________________________________
: ($line.type="#DECLARE")
- $pattern:="(?m-si)^(?!//)()"+$line.type+"()(?:\\s*\\(([^)]*)\\))?(?:\\s*(?:->\\s*)?([^/]*))?\\s*(//[^$]*)?$"
+ $pattern:="(?m-si)^(?!"+kCommentMark+")()"+$line.type+"()(?:\\s*\\(([^)]*)\\))?(?:\\s*(?:->\\s*)?([^/]*))?\\s*("+kCommentMark+"[^$]*)?$"
//______________________________________________________
End case
@@ -703,7 +734,7 @@ Function parseParameters($line : Object)
"parameter"; True:C214; \
"value"; Split string:C1554($c[0]; " "; sk ignore empty strings:K86:1).join(""); \
"code"; $line.code; \
- "type"; Choose:C955($c.length=1; Is variant:K8:33; This:C1470.getTypeFromDeclaration($t)); \
+ "type"; $c.length=1 ? Is variant:K8:33 : This:C1470.getTypeFromDeclaration($t); \
"count"; 0; \
"order"; $index)
@@ -763,102 +794,101 @@ Function parseParameters($line : Object)
End if
End if
- //==============================================================
-Function getTypeFromDeclaration($text : Text)->$type : Integer
+ // === === === === === === === === === === === === === === === === === === === === === === === === === ===
+Function getTypeFromDeclaration($text : Text) : Integer
+
+ var $o : Object
+ $o:=This:C1470._patterns
Case of
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_LONGINT:C283"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY LONGINT:C221"); $text)=1)\
- | (Position:C15(Parse formula:C1576("C_INTEGER:C282"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Integer\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varInteger; $text; 1))\
+ || (Position:C15(Parse formula:C1576("ARRAY LONGINT:C221"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_INTEGER:C282"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_LONGINT:C283"); $text)=1)
- $type:=Is longint:K8:6
+ return Is longint:K8:6
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_TEXT:C284"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY TEXT:C222"); $text)=1)\
- | (Position:C15(Parse formula:C1576("C_STRING:C293"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Text\\s*(?:/[/*].*)?$"; $text; 1)
-
- $type:=Is text:K8:3
-
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_REAL:C285"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY REAL:C219"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Real\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varText; $text; 1))\
+ || (Position:C15(Parse formula:C1576("ARRAY TEXT:C222"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_STRING:C293"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_TEXT:C284"); $text)=1)
- $type:=Is real:K8:4
+ return Is text:K8:3
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_PICTURE:C286"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY PICTURE:C279"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Picture\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varReal; $text; 1))\
+ || (Position:C15(Parse formula:C1576("ARRAY REAL:C219"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_REAL:C285"); $text)=1)
- $type:=Is picture:K8:10
+ return Is real:K8:4
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_POINTER:C301"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY POINTER:C280"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Pointer\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varPicture; $text; 1))\
+ || (Position:C15(Parse formula:C1576("ARRAY PICTURE:C279"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_PICTURE:C286"); $text)=1)
- $type:=Is pointer:K8:14
+ return Is picture:K8:10
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_BOOLEAN:C305"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY BOOLEAN:C223"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Boolean\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varPointer; $text; 1))\
+ || (Position:C15(Parse formula:C1576("ARRAY POINTER:C280"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_POINTER:C301"); $text)=1)\
- $type:=Is boolean:K8:9
+ return Is pointer:K8:14
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_TIME:C306"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY TIME:C1223"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Time\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varBoolean; $text; 1))\
+ || (Position:C15(Parse formula:C1576("ARRAY BOOLEAN:C223"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_BOOLEAN:C305"); $text)=1)
- $type:=Is time:K8:8
+ return Is boolean:K8:9
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_DATE:C307"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY DATE:C224"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Date\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varTime; $text; 1))\
+ || (Position:C15(Parse formula:C1576("ARRAY TIME:C1223"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_TIME:C306"); $text)=1)
- $type:=Is date:K8:7
+ return Is time:K8:8
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_BLOB:C604"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY BLOB:C1222"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Blob\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varDate; $text; 1))\
+ || (Position:C15(Parse formula:C1576("ARRAY DATE:C224"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_DATE:C307"); $text)=1)
- $type:=Is BLOB:K8:12
+ return Is date:K8:7
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_OBJECT:C1216"); $text)=1)\
- | (Position:C15(Parse formula:C1576("ARRAY OBJECT:C1221"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Object$"; $text; 1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*(?:4d|cs)\\.\\w*\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varBlob; $text; 1))\
+ || (Position:C15(Parse formula:C1576("C_BLOB:C604"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("ARRAY BLOB:C1222"); $text)=1)
- $type:=Is object:K8:27
+ return Is BLOB:K8:12
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_COLLECTION:C1488"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Collection\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varObject; $text; 1))\
+ || Match regex:C1019($o.varClass; $text; 1; *)\
+ || (Position:C15(Parse formula:C1576("ARRAY OBJECT:C1221"); $text)=1)\
+ || (Position:C15(Parse formula:C1576("C_OBJECT:C1216"); $text)=1)
- $type:=Is collection:K8:32
+ return Is object:K8:27
- //______________________________________________________
- : (Position:C15(Parse formula:C1576("C_VARIANT:C1683"); $text)=1)\
- | Match regex:C1019("(?mi-s)\\s*:\\s*Variant\\s*(?:/[/*].*)?$"; $text; 1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varCollection; $text; 1))\
+ || (Position:C15(Parse formula:C1576("C_COLLECTION:C1488"); $text)=1)
- $type:=Is variant:K8:33
+ return Is collection:K8:32
- //______________________________________________________
- : (Position:C15("var"; $text)=1)
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019($o.varVariant; $text; 1))\
+ || (Position:C15(Parse formula:C1576("C_VARIANT:C1683"); $text)=1)\
+ || (Position:C15("var"; $text)=1)
- $type:=Is variant:K8:33
+ return Is variant:K8:33
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
End case
//==============================================================
@@ -1015,8 +1045,15 @@ Function apply()
End if
- $compilerDirectives+="4d:C"+String:C10(This:C1470.types[$o.type].directive)+"("+This:C1470.name+";$"+String:C10($o.order)+")\r"
-
+ If ($o.value="...") //variadic
+
+ $compilerDirectives+="4d:C"+String:C10(This:C1470.types[$o.type].directive)+"("+This:C1470.name+";${"+String:C10($o.order)+"})\r"
+
+ Else
+
+ $compilerDirectives+="4d:C"+String:C10(This:C1470.types[$o.type].directive)+"("+This:C1470.name+";$"+String:C10($o.order)+")\r"
+
+ End if
End if
End for each
@@ -1316,7 +1353,7 @@ Function addNewLine($text : Text)->$result : Text
End if
End if
- //==============================================================
+ // === === === === === === === === === === === === === === === === === === === === === === === === === ===
Function clairvoyant($text : Text; $line : Text) : Integer
var $pattern; $t; $type : Text
@@ -1327,24 +1364,24 @@ Function clairvoyant($text : Text; $line : Text) : Integer
Case of
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?mi-s).*:=\\{"; $line; 1; *)) // Object literal
- return (Is object:K8:27)
+ return Is object:K8:27
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?mi-s).*:=\\["; $line; 1; *)) // Collection literal
- return (Is collection:K8:32)
+ return Is collection:K8:32
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
End case
$t:=Replace string:C233(Replace string:C233($text; "{"; "\\{"); "}"; "\\}")
Case of
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?m-si)(\\$\\w*):=((?:cs|4d)\\.\\w*)\\.new\\([^)]*\\)(?!\\.)"; $line; 1; $pos; $len)) // Class
// Keep class definition
@@ -1353,71 +1390,70 @@ Function clairvoyant($text : Text; $line : Text) : Integer
$pos{1}; $len{1}); \
"class"; Substring:C12($line; $pos{2}; $len{2})))
- return (Is object:K8:27)
+ return Is object:K8:27
- //______________________________________________________
- : (Match regex:C1019("(?m-si)\\"+$t+":=\"[^\"]*\""\
- +"|"+Command name:C538(16)+"\\(\\"+$t+"\\)"; $line; 1)) // Length
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019("(?m-si)\\"+$t+":=\"[^\"]*\""+"|"+Command name:C538(16)+"\\(\\"+$t+"\\)"; $line; 1)) // Length
- return (Is text:K8:3)
+ return Is text:K8:3
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?mi-s)\\"+$t+"[:><]?[=><]?\\d+[."+This:C1470.decimalSeparator+"]\\d+"; $line; 1))\
- | (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K30:1"); $line; 1))\
- | (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K30:2"); $line; 1))\
- | (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K30:3"); $line; 1))\
- | (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K30:4"); $line; 1))
+ || (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K30:1"); $line; 1))\
+ || (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K30:2"); $line; 1))\
+ || (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K30:3"); $line; 1))\
+ || (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K30:4"); $line; 1))
- return (Is real:K8:4)
+ return Is real:K8:4
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?m-si)\\"+$t+"[:><]?[=><]?\\d+"; $line; 1))\
- | (Match regex:C1019("(?mi-s)\\"+$t+"\\s\\?[?+-]\\s\\d*"; $line; 1))\
- | (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K35:1"); $line; 1))\
- | (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K35:2"); $line; 1))\
- | (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K35:3"); $line; 1))
+ || (Match regex:C1019("(?mi-s)\\"+$t+"\\s\\?[?+-]\\s\\d*"; $line; 1))\
+ || (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K35:1"); $line; 1))\
+ || (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K35:2"); $line; 1))\
+ || (Match regex:C1019(":=\\s*"+Parse formula:C1576(":K35:3"); $line; 1))
- return (Is longint:K8:6)
+ return Is longint:K8:6
- //______________________________________________________
- : (Match regex:C1019("(?m-si)\\"+$t+":=(?:"+Command name:C538(214)+"|"+Command name:C538(215)+")(?=$|\\(|(?:\\s*//)|(?:\\s*/\\*))"; $line; 1))
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
+ : (Match regex:C1019("(?m-si)\\"+$t+":=(?:"+Command name:C538(214)+"|"+Command name:C538(215)+")(?=$|\\(|(?:\\s*"+kCommentMark+")"+\
+ "|(?:\\s*/\\*))"; $line; 1))
- return (Is boolean:K8:9)
+ return Is boolean:K8:9
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?m-si)\\"+$t+"\\."; $line; 1))\
- | (Match regex:C1019("(?m-si):="+Parse formula:C1576("Form:C1466")+"[^.]"; $line; 1))
+ || (Match regex:C1019("(?m-si):="+Parse formula:C1576("Form:C1466")+"[^.]"; $line; 1))
- return (Is object:K8:27)
+ return Is object:K8:27
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?m-si)\\"+$t+":=(?:!\\d+-\\d+-\\d+!)"; $line; 1))
- return (Is date:K8:7)
+ return Is date:K8:7
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?m-si)\\"+$t+":=(?:\\?\\d+:\\d+:\\d+\\?)"; $line; 1))
- return (Is time:K8:8)
+ return Is time:K8:8
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?mi-s)\\"+$t+":=->"; $line; 1))\
- | (Match regex:C1019("(?mi-s)\\"+$t+"->"; $line; 1))
+ || (Match regex:C1019("(?mi-s)\\"+$t+"->"; $line; 1))
- return (Is pointer:K8:14)
+ return Is pointer:K8:14
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?m-si)(?:For|Boucle)\\s\\((?:[^;]*;\\s*){0,3}(\\"+$t+")"; $line; 1))
- return (Is longint:K8:6)
+ return Is longint:K8:6
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
: (Match regex:C1019("(?m-si)(?:If|Si|Not|Non)\\s*\\(\\"+$t+"\\)"; $line; 1))
- return (Is boolean:K8:9)
-
- //______________________________________________________
+ return Is boolean:K8:9
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
Else // Use gram.syntax
For each ($type; This:C1470.gramSyntax) While ($varType=0)
@@ -1439,7 +1475,7 @@ Function clairvoyant($text : Text; $line : Text) : Integer
For each ($pattern; This:C1470.gramSyntax[$type])
- If (Match regex:C1019(Replace string:C233($pattern; "%"; $t)+"(?=$|\\(|(?:\\s*//)|(?:\\s*/\\*))"+")"; $line; 1))
+ If (Match regex:C1019(Replace string:C233($pattern; "%"; $t)+"(?=$|\\(|(?:\\s*"+kCommentMark+")"+"|(?:\\s*/\\*))"+")"; $line; 1))
return Num:C11($type)
@@ -1448,7 +1484,7 @@ Function clairvoyant($text : Text; $line : Text) : Integer
End if
End for each
- //______________________________________________________
+ //┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
End case
//==============================================================
@@ -1487,8 +1523,8 @@ Function loadGramSyntax()
If ($file.exists)
$patterns:=New object:C1471
- $patterns.affectation:="(?m-is)\\%:=(?:(?:#)(?=$|\\(|(?:\\s*//)|(?:\\s*/\\*))"
- $patterns.affectationSuite:="|(?:#)(?=$|\\(|(?:\\s*//)|(?:\\s*/\\*))"
+ $patterns.affectation:="(?m-is)\\%:=(?:(?:#)(?=$|\\(|(?:\\s*"+kCommentMark+")|(?:\\s*/\\*))"
+ $patterns.affectationSuite:="|(?:#)(?=$|\\(|(?:\\s*"+kCommentMark+")|(?:\\s*/\\*))"
$patterns.first:="(?m-is)#\\s*\\(\\%"
For each ($t; Split string:C1554($file.getText(); "\r"; sk trim spaces:K86:2))
diff --git a/Project/Sources/Classes/group.4dm b/Project/Sources/Classes/group.4dm
index f07fab2..f4aa0a6 100755
--- a/Project/Sources/Classes/group.4dm
+++ b/Project/Sources/Classes/group.4dm
@@ -12,51 +12,51 @@ or a comma separated list of object names
in this case, all named objects are initialized with widget class
——————————————————————————*/
-Class constructor
+Class constructor($members; ... : Object)
- C_VARIANT:C1683($1)
- C_OBJECT:C1216(${2})
+ //C_VARIANT($1)
+ //C_OBJECT(${2})
C_LONGINT:C283($i)
C_TEXT:C284($t)
- If (Asserted:C1132(Count parameters:C259>0;"Missing parameter"))
+ If (Asserted:C1132(Count parameters:C259>0; "Missing parameter"))
Case of
- //___________________________
+ //___________________________
: (Value type:C1509($1)=Is collection:K8:32)
This:C1470.members:=$1
- //___________________________
+ //___________________________
: (Value type:C1509($1)=Is object:K8:27) // 1 to n objects
This:C1470.members:=New collection:C1472
- For ($i;1;Count parameters:C259;1)
+ For ($i; 1; Count parameters:C259; 1)
This:C1470.members.push(${$i})
End for
- //___________________________
+ //___________________________
: (Value type:C1509($1)=Is text:K8:3) // Comma separated list of object names
This:C1470.members:=New collection:C1472
- For each ($t;Split string:C1554($1;","))
+ For each ($t; Split string:C1554($1; ","))
This:C1470.members.push(cs:C1710.widget.new($t)) // Widget by default
End for each
- //___________________________
+ //___________________________
Else
- ASSERT:C1129(False:C215;"Bad parameter type")
+ ASSERT:C1129(False:C215; "Bad parameter type")
- //___________________________
+ //___________________________
End case
End if
@@ -77,22 +77,22 @@ Function include
Case of
- //______________________________________________________
+ //______________________________________________________
: (Value type:C1509($1)=Is object:K8:27)
$0:=(This:C1470.members.indexOf($1)#-1)
- //______________________________________________________
+ //______________________________________________________
: (Value type:C1509($1)=Is text:K8:3)
- $0:=(This:C1470.members.query("name=:1";$1).pop()#Null:C1517)
+ $0:=(This:C1470.members.query("name=:1"; $1).pop()#Null:C1517)
- //______________________________________________________
+ //______________________________________________________
Else
- ASSERT:C1129(False:C215;"Unmanaged parameter type")
+ ASSERT:C1129(False:C215; "Unmanaged parameter type")
- //______________________________________________________
+ //______________________________________________________
End case
/*════════════════════════════════════════════
@@ -110,13 +110,13 @@ The optional object type parameter allow to specify:
════════════════════════════════════════════*/
Function distributeHorizontally
- C_OBJECT:C1216($1;$o;$e)
+ C_OBJECT:C1216($1; $o; $e)
$e:=New object:C1471(\
- "start";0;\
- "spacing";0;\
- "minWidth";0;\
- "maxWidth";0)
+ "start"; 0; \
+ "spacing"; 0; \
+ "minWidth"; 0; \
+ "maxWidth"; 0)
If (Count parameters:C259>=1)
@@ -133,7 +133,7 @@ Function distributeHorizontally
End if
End if
- For each ($o;This:C1470.members)
+ For each ($o; This:C1470.members)
If (Count parameters:C259>=1)
@@ -151,25 +151,25 @@ Function distributeHorizontally
End if
- // Calculate the cumulative shift
+ // Calculate the cumulative shift
If ($e.spacing=0)
Case of
- //_______________________________
+ //_______________________________
: ($o.type=Object type push button:K79:16)
- $e.start:=$o.coordinates.right+Choose:C955(Is macOS:C1572;20;20)
+ $e.start:=$o.coordinates.right+Choose:C955(Is macOS:C1572; 20; 20)
- //_______________________________
+ //_______________________________
: (False:C215)
- //_______________________________
+ //_______________________________
Else
$e.start:=$o.coordinates.right
- //_______________________________
+ //_______________________________
End case
Else
@@ -190,7 +190,7 @@ Function show
If (Count parameters:C259>=1)
- For each ($o;This:C1470.members)
+ For each ($o; This:C1470.members)
$o.show($1)
@@ -198,7 +198,7 @@ Function show
Else
- For each ($o;This:C1470.members)
+ For each ($o; This:C1470.members)
$o.show()
@@ -210,7 +210,7 @@ Function hide
C_OBJECT:C1216($o)
- For each ($o;This:C1470.members)
+ For each ($o; This:C1470.members)
$o.hide()
@@ -227,7 +227,7 @@ Function enable
If (Count parameters:C259>=1)
- For each ($o;This:C1470.members)
+ For each ($o; This:C1470.members)
$o.enable($1)
@@ -235,7 +235,7 @@ Function enable
Else
- For each ($o;This:C1470.members)
+ For each ($o; This:C1470.members)
$o.enable()
@@ -247,7 +247,7 @@ Function disable
C_OBJECT:C1216($o)
- For each ($o;This:C1470.members)
+ For each ($o; This:C1470.members)
$o.disable()
diff --git a/Project/Sources/Classes/macro.4dm b/Project/Sources/Classes/macro.4dm
index 99784e9..4ece86a 100755
--- a/Project/Sources/Classes/macro.4dm
+++ b/Project/Sources/Classes/macro.4dm
@@ -134,7 +134,7 @@ Function PasteColor()
/// Compiler Directives for local variables
Function Declarations()
- DECLARATION
+ _o_DECLARATION
// === === === === === === === === === === === === === === === === === === === === === === === === === ===
Function Beautifier()
diff --git a/Project/Sources/Classes/widget.4dm b/Project/Sources/Classes/widget.4dm
index 626adee..88d6c05 100755
--- a/Project/Sources/Classes/widget.4dm
+++ b/Project/Sources/Classes/widget.4dm
@@ -14,13 +14,11 @@ I prefer to call them widgets to make the difference with language objects
Class extends static
/*═══════════════════*/
-Class constructor
- var $1 : Text
- var $2 : Text
+Class constructor($name : Text; $datasource : Text)
var $p : Pointer
- Super:C1705($1)
+ Super:C1705($name)
$p:=OBJECT Get pointer:C1124(Object named:K67:5; This:C1470.name)
This:C1470.assignable:=Not:C34(Is nil pointer:C315($p))
@@ -34,8 +32,8 @@ Class constructor
If (Count parameters:C259>=2)
- This:C1470.dataSource:=$2
- This:C1470.value:=Formula from string:C1601($2).call()
+ This:C1470.dataSource:=$datasource
+ This:C1470.value:=Formula from string:C1601($datasource).call()
End if
End if
@@ -47,9 +45,9 @@ Class constructor
This:C1470.events:=New collection:C1472
ARRAY TO COLLECTION:C1563(This:C1470.events; $_)
-Function addEvents
+Function addEvents( ... : Integer)
- var ${1}; $i : Integer
+ var $i : Integer
For ($i; 1; Count parameters:C259; 1)
@@ -62,10 +60,9 @@ Function addEvents
//OBJECT SET EVENTS(*; This.name; $_; Enable events others unchanged)
/*══════════════════════════*/
-Function getEnterable
- var $0 : Boolean
+Function getEnterable : Boolean
- $0:=OBJECT Get enterable:C1067(*; This:C1470.name)
+ return OBJECT Get enterable:C1067(*; This:C1470.name)
/*══════════════════════════
.enterable()
diff --git a/Project/Sources/Forms/DECLARATIONS/ObjectMethods/b.options.escape.4dm b/Project/Sources/Forms/DECLARATIONS/ObjectMethods/b.options.escape.4dm
index af43bce..1243fe0 100755
--- a/Project/Sources/Forms/DECLARATIONS/ObjectMethods/b.options.escape.4dm
+++ b/Project/Sources/Forms/DECLARATIONS/ObjectMethods/b.options.escape.4dm
@@ -1,3 +1,3 @@
_o_Preferences("Get_Value"; "ignoreDeclarations"; OBJECT Get pointer:C1124(Object named:K67:5; "ignoreDirectives"))
_o_Preferences("Get_Value"; "numberOfVariablePerLine"; OBJECT Get pointer:C1124(Object named:K67:5; "variableNumber"))
-DECLARATION("Get_Syntax_Preferences")
\ No newline at end of file
+_o_DECLARATION("Get_Syntax_Preferences")
\ No newline at end of file
diff --git a/Project/Sources/Forms/DECLARATIONS/ObjectMethods/b.options.ok.4dm b/Project/Sources/Forms/DECLARATIONS/ObjectMethods/b.options.ok.4dm
index 70b7b9f..5407fbf 100755
--- a/Project/Sources/Forms/DECLARATIONS/ObjectMethods/b.options.ok.4dm
+++ b/Project/Sources/Forms/DECLARATIONS/ObjectMethods/b.options.ok.4dm
@@ -8,8 +8,8 @@ OPTIONS_SET(\
_o_Preferences("Set_Value"; "ignoreDeclarations"; OBJECT Get pointer:C1124(Object named:K67:5; "ignoreDirectives"))
_o_Preferences("Set_Value"; "numberOfVariablePerLine"; OBJECT Get pointer:C1124(Object named:K67:5; "variableNumber"))
-DECLARATION("Set_Syntax_Preferences"; -><>tLon_Declaration_Types; -><>tTxt_Patterns)
-DECLARATION("Get_Syntax_Preferences")
+_o_DECLARATION("Set_Syntax_Preferences"; -><>tLon_Declaration_Types; -><>tTxt_Patterns)
+_o_DECLARATION("Get_Syntax_Preferences")
(OBJECT Get pointer:C1124(Object named:K67:5; "spinner"))->:=1
OBJECT SET VISIBLE:C603(*; "spinner"; True:C214)
diff --git a/Project/Sources/Methods/4DPop_MACROS.4dm b/Project/Sources/Methods/4DPop_MACROS.4dm
index 7ad9487..27c9928 100755
--- a/Project/Sources/Methods/4DPop_MACROS.4dm
+++ b/Project/Sources/Methods/4DPop_MACROS.4dm
@@ -5,21 +5,15 @@
// 4DPop Macros v 3.0
// ----------------------------------------------------
// Description
-// Entry point of all 4DPop's macros
+// Entry point of all macros
// ----------------------------------------------------
-// Modified by Vincent de Lachaux (12/05/10)
-// v12
-// ----------------------------------------------------
-// Declarations
-#DECLARE($action : Text; $text : Text; $title : Text)
-
-var ${4} : Pointer
+#DECLARE($action : Text; $text : Text; $title : Text; ... : Pointer)
If (False:C215)
C_TEXT:C284(4DPop_MACROS; $1)
C_TEXT:C284(4DPop_MACROS; $2)
C_TEXT:C284(4DPop_MACROS; $3)
- C_POINTER:C301(4DPop_MACROS; $4)
+ C_POINTER:C301(4DPop_MACROS; ${4})
End if
var $t : Text
diff --git a/Project/Sources/Methods/Compiler_.4dm b/Project/Sources/Methods/Compiler_.4dm
index ffb2a35..d8a2343 100755
--- a/Project/Sources/Methods/Compiler_.4dm
+++ b/Project/Sources/Methods/Compiler_.4dm
@@ -14,8 +14,8 @@ If (False:C215)
End if
If (False:C215)
- C_TEXT:C284(DECLARATION; $1)
- C_POINTER:C301(DECLARATION; ${2})
+ C_TEXT:C284(_o_DECLARATION; $1)
+ C_POINTER:C301(_o_DECLARATION; ${2})
End if
If (False:C215)
diff --git a/Project/Sources/Methods/DECLARATION.4dm b/Project/Sources/Methods/_o_DECLARATION.4dm
old mode 100755
new mode 100644
similarity index 99%
rename from Project/Sources/Methods/DECLARATION.4dm
rename to Project/Sources/Methods/_o_DECLARATION.4dm
index d920dd9..27f60cb
--- a/Project/Sources/Methods/DECLARATION.4dm
+++ b/Project/Sources/Methods/_o_DECLARATION.4dm
@@ -57,8 +57,8 @@ C_OBJECT:C1216($file; $o; $oo)
C_COLLECTION:C1488($c; $cArrays; $cDirectives; $Col_settings; $Col_type)
If (False:C215)
- C_TEXT:C284(DECLARATION; $1)
- C_POINTER:C301(DECLARATION; ${2})
+ C_TEXT:C284(_o_DECLARATION; $1)
+ C_POINTER:C301(_o_DECLARATION; ${2})
End if
// ----------------------------------------------------
@@ -68,7 +68,7 @@ $Lon_parameters:=Count parameters:C259
// ----------------------------------------------------
If ($Lon_parameters=0) // Display the dialog
- DECLARATION("_init")
+ _o_DECLARATION("_init")
OPTIONS_GET(27)
$file:=File:C1566("/RESOURCES/declarations.settings")
@@ -129,8 +129,8 @@ If ($Lon_parameters=0) // Display the dialog
"method"; win_title(Frontmost window:C447); \
"settings"; $o; \
"controlFlow"; $c; \
- "refresh"; Formula:C1597(DECLARATION("DISPLAY")); \
- "setType"; Formula:C1597(DECLARATION("TYPE"))\
+ "refresh"; Formula:C1597(_o_DECLARATION("DISPLAY")); \
+ "setType"; Formula:C1597(_o_DECLARATION("TYPE"))\
)
$l:=Open form window:C675("DECLARATIONS"; Movable form dialog box:K39:8; *)
@@ -2017,7 +2017,7 @@ Else
End if
- DECLARATION("Get_Syntax_Preferences")
+ _o_DECLARATION("Get_Syntax_Preferences")
//______________________________________________________
: ($Txt_entryPoint="Get_Syntax_Preferences")
diff --git a/Project/Sources/folders.json b/Project/Sources/folders.json
index 0c0be05..b980a38 100755
--- a/Project/Sources/folders.json
+++ b/Project/Sources/folders.json
@@ -7,6 +7,7 @@
"_o_beautifier_Next_semicolon",
"_o_beautifier_Split_key_value",
"_o_CENTERED",
+ "_o_DECLARATION",
"_o_EXTRACT_LOCAL_VARIABLES",
"_o_Files_And_Folders",
"_o_isNumeric",
@@ -25,13 +26,7 @@
"4DPop_TEST_Macros",
"COMPILER_TESTS",
"createSymbolicLink",
- "macro",
- "Method2",
- "Method3",
- "Method4",
- "Method5",
- "Method6",
- "Method7"
+ "macro"
]
},
"#️⃣ API": {},
@@ -110,7 +105,6 @@
},
"Binary database": {
"methods": [
- "DECLARATION",
"OPTIONS_GET",
"OPTIONS_SET"
],
diff --git a/Resources/InfoPlist.strings b/Resources/InfoPlist.strings
index 5a39683..9bf33d2 100755
Binary files a/Resources/InfoPlist.strings and b/Resources/InfoPlist.strings differ