-
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.
- Loading branch information
Showing
21 changed files
with
167 additions
and
114 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 @@ | ||
Assert←{⍺←'' ⋄ (,1)≡,⍵:r←1 ⋄ ⎕ML←3 ⋄ ⍺ ⎕SIGNAL 1↓(↑∊⍵),11} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
History | ||
⍝⍝ Contains information regarding the last release. A full history is available on GitHub. (This line is ignored) | ||
⍝ * 7.2.2 | ||
⍝ * When an object was removed from the hit list then the message in the status bar was not changed accordingly. | ||
⍝ * When an object was removed from the hit via "Report Hits" then the context menu should not offer "Remove" again. | ||
⍝ * A "Hit report" windows should be closed automatically when the user hits either "Find" or "Replace". | ||
⍝ * A "Replace" operation should clear the hit list because it might well be outdated. | ||
⍝ * Information provided in the status bar improved. | ||
⍝ * 7.2.1 | ||
⍝ * Bug fix: the "Search for" field lost its memory ot one stage. | ||
⍝ * 7.2.3 | ||
⍝ * Bug fixes: | ||
⍝ * With commit from 2019-05-30 a serious bug was introduced regarding removing any items from the hit list.\\ | ||
⍝ Rather than just removing the selected items the objects were also deleted from the workspace. However, | ||
⍝ acre was **not** told to delete them, so after re-opening the project everything was back again. | ||
⍝ * The assignment of a variable in a namespace script was ignored when on the same line a dfn was defined | ||
⍝ and the next function was a trad fun that carried the definition of a dfns. | ||
⍝ \\ | ||
⍝ For information regarding older version see <https://github.com/aplteam/Fire/releases> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,25 @@ | ||
body←RemoveFnsAndOpr body;mask;b1;b2;b;split;ind;buffer;hits;part;start;length;buff | ||
body←RemoveFnsAndOpr body;masked;tradFns;b1;b0;b;isCR | ||
⍝ Remove all functions and operators from script code ⍵. | ||
⍝ This is necessary because fns and opr are dealt with already as if | ||
⍝ they were members of an ordinary namespace, so we just need to focus | ||
⍝ on stuff outside functions and operators, typically comments and the | ||
⍝ assignment of any variables. | ||
⍝ We must ignore "∇{}" inside comments and text, and we must be able to | ||
⍝ deal with both, multiline dfns and interlocked dfns. | ||
mask←Replace.MaskText¨body | ||
mask←{((⍴⍵)=i←⍵⍳'⍝'):⍵ ⋄ (⍴⍵)↑i↑⍵}¨mask | ||
(body mask)←{1↓Simplify CR,¨⍵}¨body mask | ||
b1←'{'=mask | ||
b2←'}'=mask | ||
b←(CR≠mask)∧b2∨0≠(+\b1)-+\b2 | ||
(b1/b)←0 ⍝ Let the "{" survive - we need this later | ||
⍝ deal with both, multiline dfns, nested dfns and dfns without a name. | ||
masked←Replace.MaskText¨body | ||
masked←{((⍴⍵)=i←⍵⍳'⍝'):⍵ ⋄ (⍴⍵)↑i↑⍵}¨masked ⍝ Remove comments from `masked` | ||
(body masked)←{1↓Simplify CR,¨⍵}¨body masked ⍝ We need a simple vector from now an | ||
isCR←body=CR ⍝ CR must survive to keep the original structure intact | ||
tradFns←{⍵∨≠\⍵}'∇'=masked ⍝ Where are trad fns? | ||
(tradFns/body)←' ' ⍝ Remove... | ||
(tradFns/masked)←' ' ⍝ ...them! | ||
b1←'{'=masked ⍝ Opening curlies | ||
b0←'}'=masked ⍝ Closing curlies | ||
b←(masked≠CR)∧b0∨0≠(+\b1)-+\b0 ⍝ Where are the (possibly nested) dfns? | ||
(b1/b)←0 ⍝ Let the "{" survive - we need this later for removing the dfn names | ||
(b/body)←' ' | ||
(b/mask)←' ' | ||
body[Where(CR≠mask)∧({⍵∨≠\⍵}'∇'=mask)]←' ' | ||
((mask='}')/mask)←' ' | ||
body←'\w{1,}←\{'⎕R ReplaceAssignedDfnNameBySpace⊣body ⍝ Get rid of "name←{" | ||
(('{'=masked)/body)←' ' ⍝ Get rid of opening curlies (lambdas) | ||
(isCR/body)←CR ⍝ Brings the CRs back for sure (those tfns might have been replaced by spaces) | ||
body←CR A.Split body | ||
mask←CR A.Split mask | ||
b1←∨/¨mask='{' | ||
b2←~'⋄'∊¨b1/mask ⍝ Those in b1 have no "⋄" | ||
ind←b2/Where b1 ⍝ Transform into index | ||
mask[ind]←(↑∘⍴¨mask[ind])⍴¨' ' ⍝ ...therefore they are getting blanks. | ||
b1[b2/Where b1]←0 ⍝ Forget those | ||
:If 0<+/b1 ⍝ Are there any "⋄" at all? | ||
split←{1,'⋄'=⍵}¨b1/mask | ||
buffer←split{⎕IO←⎕ML←1 ⋄ ⍺⊂'⋄',⍵}¨b1/body | ||
:AndIf 0<+/b2←∊{∨/'←{'⍷⍵}¨¨buffer | ||
(b2/buffer)←{1↓↑,/{(∨/'←{'⍷⍵):(⍴,⍵)⍴' ' ⋄ ⍵}¨⍵}¨b2/buffer | ||
(b1/body)←buffer | ||
:EndIf | ||
⍝ Get rid of "name←{" | ||
hits←⌽'\w{1,}←\{'⎕S 2 0 1⊣body | ||
:For part start length :In hits | ||
buff←part⊃body | ||
buff←(-start)⌽(length⍴' '),length↓start⌽buff | ||
(part⊃body)←buff | ||
:EndFor | ||
⍝Done |
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 was deleted.
Oops, something went wrong.
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,4 @@ | ||
ReplaceAssignedDfnNameBySpace←{ | ||
ns←⍵ | ||
ns.Lengths⍴' ' | ||
} |
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
r←Version | ||
⍝ See also `History` | ||
r←(1↓↑¯1↑⎕NPARTS⍕⎕THIS)'7.2.2.111' '2019-07-21' | ||
r←(1↓↑¯1↑⎕NPARTS⍕⎕THIS)'7.2.3.112' '2019-07-25' |
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,31 @@ | ||
R←Test_Replace_005(stopFlag batchFlag);n;ref;n2;⎕TRAP | ||
⍝ Replace string "foo" in a namespace script that contains nested dfns. | ||
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') | ||
R←∆Failed | ||
|
||
⍝ Preconditions | ||
1 #._Fire.Fire.Run 0 | ||
n←#._Fire.Fire.GUI.n | ||
#.⎕SHADOW'TEMP' | ||
'TEMP'#.⎕NS'' | ||
ref←#.TEMP.⎕FIX':Namespace MyNamespace' 'MyDfn←{' 'a←1' 'sub←{' 'a←''foo''' '}' '42' '}' ':EndNamespace' | ||
Assert 42≡ref.MyDfn ⍬ | ||
n.LookIn.Text←'#.TEMP' | ||
n.SearchFor.Text←'foo' | ||
|
||
{}∆Select n.StartBtn | ||
0.2 ∆Process n.Form | ||
→GoToTidyUp n.HitList.Items≢,⊂'MyDfn' | ||
|
||
{}∆Select n.ReplaceBtn | ||
∆Process n.Form | ||
n2←#._Fire.Fire.Replace.n | ||
n2.ReplaceBy.Text←'_GOO_' | ||
|
||
{}∆Select n2.StartBtn | ||
∆Process n.Form | ||
|
||
→GoToTidyUp 1≠+/'a←''_GOO_'''⍷1↓↑,/(⎕UCS 13),¨⎕SRC ref | ||
|
||
∆TidyUp: | ||
CloseFire |
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,31 @@ | ||
R←Test_Replace_006(stopFlag batchFlag);n;ref;n2;⎕TRAP | ||
⍝ Replace string "foo" in a namespace script that contains a ⋄-separated fns assignment and a vars assignment on a single line | ||
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') | ||
R←∆Failed | ||
|
||
⍝ Preconditions | ||
1 #._Fire.Fire.Run 0 | ||
n←#._Fire.Fire.GUI.n | ||
#.⎕SHADOW'TEMP' | ||
'TEMP'#.⎕NS'' | ||
ref←#.TEMP.⎕FIX':Namespace MyNamespace' 'MyDfn←{''foo''} ⋄ pi←2.14' '' ':EndNamespace' | ||
Assert'foo'≡ref.MyDfn ⍬ | ||
n.LookIn.Text←'#.TEMP' | ||
n.SearchFor.Text←'foo' | ||
|
||
{}∆Select n.StartBtn | ||
0.2 ∆Process n.Form | ||
→GoToTidyUp n.HitList.Items≢,⊂'MyDfn' | ||
|
||
{}∆Select n.ReplaceBtn | ||
∆Process n.Form | ||
n2←#._Fire.Fire.Replace.n | ||
n2.ReplaceBy.Text←'_GOO_' | ||
|
||
{}∆Select n2.StartBtn | ||
∆Process n.Form | ||
|
||
→GoToTidyUp 1≠+/'''_GOO_'''⍷1↓↑,/(⎕UCS 13),¨⎕SRC ref | ||
|
||
∆TidyUp: | ||
CloseFire |
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,32 @@ | ||
R←Test_Replace_008(stopFlag batchFlag);n;ref;n2;⎕TRAP;body | ||
⍝ Replace "42" by 2.14". This was once a bug: it crashed on "Find" and, after fixing that, caused an endless loop in "Replace" | ||
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') | ||
R←∆Failed | ||
|
||
⍝ Preconditions | ||
1 #._Fire.Fire.Run 0 | ||
n←#._Fire.Fire.GUI.n | ||
#.⎕SHADOW'TEMP' | ||
'TEMP'#.⎕NS'' | ||
ref←#.TEMP.⎕FIX':Namespace NS' 'f1←{r←⍺{PI←42 ⋄ ⍺+⍵}⍵ ⋄ 1+r} ⋄ f2←f1∘⌽' '∇ Fns y;a;b' 'PI←42' 'a←⍬ ⋄ b←{⍵}' '∇' 'PI←42' ':EndNamespace' | ||
Assert 42≡ref.PI | ||
n.LookIn.Text←'#.TEMP' | ||
n.SearchFor.Text←'42' | ||
|
||
{}∆Select n.StartBtn | ||
0.2 ∆Process n.Form | ||
→GoToTidyUp n.HitList.Items≢'Fns' 'f1' 'NS' 'PI' | ||
|
||
{}∆Select n.ReplaceBtn | ||
∆Process n.Form | ||
n2←#._Fire.Fire.Replace.n | ||
n2.ReplaceBy.Text←'2.14' | ||
|
||
{}∆Select n2.StartBtn | ||
∆Process n.Form | ||
body←1↓↑,/(⎕UCS 13),¨⎕SRC #.TEMP.NS | ||
→GoToTidyUp 3≠+/'2.14'⍷body | ||
→GoToTidyUp 0≠+/'42'⍷body | ||
|
||
∆TidyUp: | ||
CloseFire |
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.