Skip to content

Commit

Permalink
don't replace C_xx(${n})
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Oct 30, 2024
1 parent 8525b3f commit 6e5e3c1
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 3 deletions.
Binary file modified BUILD/4D-Macros.zip
Binary file not shown.
Binary file modified BUILD/Components/4D Macros.4dbase/Contents/4D Macros.4DZ
Binary file not shown.
17 changes: 17 additions & 0 deletions BUILD/Components/4D Macros.4dbase/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<plist>

<dict>
<key>CFBundleName</key>
<string>4D Macros</string>
<key>CFBundleDisplayName</key>
<string>4D Macros</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>CFBundleVersion</key>
<string></string>
</dict>

</plist>
Binary file not shown.
2 changes: 1 addition & 1 deletion Project/Sources/Classes/_regex.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ Function lookingAt() : Boolean
// <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <==
Function get lastError() : Object

If (This:C1470.errorsnull)\
If (This:C1470.errors#Null:C1517)\
&& (This:C1470.errors.length>0)

return This:C1470.errors[This:C1470.errors.length-1]
Expand Down
2 changes: 1 addition & 1 deletion Project/Sources/Classes/modernize.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Class constructor
// Replace declaration lines using the old “(_o_)C_xxx(...)” syntax with the new one “var ... : type”.
Function C_2var() : Boolean

var $pattern : Text:="(?-msi)(?<!//)(?<!//\\s){C_}\\((?![\\w\\s]+;\\s*\\$\\{?\\d+\\}?)([^\\)]*)\\)"
var $pattern : Text:="(?-msi)(?<!//)(?<!//\\s){C_}\\((?![\\w\\s]+;\\s*\\$\\{?\\d+\\}?)([^{\\)]*)\\)"

var $code : Text:=This:C1470.fullMethodText

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Example transformation:
**Before:**

```4d
_O_C_LONGINT($1)
_O_C_TEXT(${2})
_O_C_TEXT(vDetail; $message)
// _O_C_TEXT(vMessage)
_O_C_LONGINT(vError)
Expand All @@ -70,17 +73,21 @@ _O_C_LONGINT(myMethod; $0)
**After**:

```4d
var $1 : Integer
_O_C_TEXT(${2})
var vDetail; $message : Text
// _O_C_TEXT(vMessage)
var vError : Integer
_O_C_LONGINT(myMethod; $0)
```

>📍 The lines **C_xx** ( ***\<method>***; $… )\*\* & the comments are not modified
>📍 The lines **C_xx** ( ***\<method>***; $… )\*\* & the comments are not modified, nor the syntax **C_xx** (${n})\*\*\*
<br>\* With 20R7+, **C_xxx** commands are preceded by the obsolete marking prefix and are displayed as **\_O\_C_xxx**.
<br>\*\* The **C_xx** ( ***\<method>*** ; $... ) declarations used in `COMPILER_xxx` methods to define parameters and returns for project methods are obsolete. The use of the syntax [#DECLARE](https://developer.4d.com/docs/Concepts/parameters/#declaring-parameters) dispenses with these declarations.
<br>\*\*\* This syntax, which allows you to declare a variable number of parameters of the same type, is also deprecated and must be replaced by the use of the syntax [#DECLARE](https://developer.4d.com/docs/Concepts/parameters/#declaring-parameters)

# <a name="improvment">Improvements and Bug Fixes</a>

Expand Down

0 comments on commit 6e5e3c1

Please sign in to comment.