Repository navigation
What this release is
A release of minor fixes to 2.0.0. Some of them fix changes that made code that did not compile, or gave a different
answer. Most of the others make the tool leave your code as you wrote it in a few rare cases where a change could
have made it behave differently. Nothing you have to change: the switches, the styles and the rule files work as in
2.0.0.
Code that is now left as you wrote it
- A method that has the name of a variable. Merging a copy into its source no longer renames another object's
method that has the copy's name (Counter.buf()staysCounter.buf()), and moving a value into its one read no
longer takes such a method (Counter.n()) for a read of the variable. Both made code that did not compile. Folding
a re-split copy, dropping a line buffer and merging two locals leave such a method as written too. - A variable that may have a second name. Inlining a value, merging IFs or CASEs, removing an unused assignment,
the known-ranges clean-up and the loop rewrites leave code alone when what they read could be changed under another
name: a parameter passed by address while the procedure has another one or uses a global (a caller may pass the
same variable twice), a global that a reference elsewhere in the file points at, a field of aGROUP,PRE()written
by its own name, a variable declaredOVERanother one or with aGROUPtype, and a local handed by address to a
procedure or method that may keep a reference to it. ACASEon aGROUPor on such a variable is not joined with
theIFafter it, cutting to a split leaves alone a cut whose position has such a name, and moving a per-line
change in front of a split leaves a loop alone whose index has one. Moving a line common to both halves of anIF
no longer moves a write to aGROUPfield above a test that reads the group, or a variable declaredOVERit,
under another name. COMPILEand conditionalOMITblocks. A build may leave such a block out, so a clean-up no longer relies on
a line inside the block for code outside it. When the line and everything that relies on it are inside the same
block, or in a block inside it, the clean-ups still make the change. A variable declared differently in the two
arms of aCOMPILEand anOMIT, or declared only inside such a block, is left alone by the clean-ups that move,
merge or remove code, and a rule that depends on a variable's type does not take a name used outside such a block
for the variable declared inside it. When a clean-up removes a whole line, anOMITblock just in front of it
stays.- Where an
OMITorCOMPILEblock ends. A terminator in the directive line's own comment ends the block on
that line, as the compiler does:OMIT('**end**') ! runs to **end**omits nothing, so the code below it is read
and changed like any other. This holds in anINCLUDEd file too. A terminator on a row of a statement carried on
with|ends the block on that row, also when the terminator there is not in a comment, and the terminator is
not looked for inside the block's condition. A line inside anOMITblock that ends in|does not carry on into
the first line after the block. - A StringTheory copy and its error state. A copy made with
getValue()orsetValue(<object>)is no longer
merged into its source when the copy'slastErrororwinErrorCodeis read afterwards, or when the copy is handed
to a procedure that could read them. - A copy read in a loop. A copy is kept when a loop runs an
IForCASEagain and the source is changed in one
branch while the copy is read in another, or when it is handed to a procedure whose local class has a method that
uses that parameter. - Base64 and encoding. The clean-ups that depend on them now also see an object handed to one of your procedures
that may set them, and removing trailing spaces also looks in a procedure's ROUTINEs, and in the methods of a class
it declares, for a call that makes the object UTF-16. clip()around a number (NOTBOOL) is kept wherever the answer depends on the type: any compare, any argument
ofchoose(), the first argument ofassert(), the value aCASEtests or anOFgives, the upper end of an
OF ... TOrange; a value stored in anANY, an untyped?parameter or a target whose type the tool cannot
find, or returned from a procedure that returns?; an argument whose type can change the answer; and an argument
of a procedure whose prototype the tool cannot see - one in anINCLUDEit did not read, or, in aMEMBERmodule
or a file another one includes, in the program'sMAP. A call to a Clarion runtime procedure such asmessage()
orputini()is still rewritten.- Adding
,AUTOno longer takes aRETURNthat also closes an innerIForLOOPfor the end of the outer
branch, no longer accepts a field of aGROUP, a variable of aGROUPtype or declaredLIKEone, or a reference
as the test that proves a variable was set, and does not make a localAUTOwhen its declaration carriesSTATIC,
THREADorOVERon a second row. - An
IFmarked! #Possible bug. The code such anIFalways ran, every line of it, is left exactly as
written, so theIFcan be put back as it was. - Smaller cases: a test is not moved above a store when the next line has a label a
GOTOjumps to; a split is
left alone when it is one arm of anEXECUTE, when aDOfollows it on the same line, or when aGOTObelow it
jumps back above it; a split whose clip option is an expression is not taken as one that clips; a method of your own
class calledAppend,SetValueorPrependis not taken for StringTheory's; a StringTheory copy whose length is
taken by reference is kept; cutting to a split keeps the cut when, inside a loop around it, the object is handed
above the cut to a call that may read its lines; moving a line common to both halves of anIFmatches a prefix
to the field's own group, so two procedures that use one prefix are not mixed up; a line buffer is kept when its
next load is in a one-lineIFcarried over two rows; dropping a line buffer keeps the clip when other code also
writes the object's lines; the extreme style's
left()andchoose()clean-ups and the known-ranges clean-up keep their test when the length or buffer may be
changed through another parameter or a module reference; a+=on the last line of a file with no line break
after it is checked before it becomes=; a variable namedMapis not read as the start of aMAP; a method of
a class the procedure declares is seen to use what the routines it calls withDOuse; and a field of a local
GROUP,PRE()after a nested group with its own prefix, or declaredLIKEa field, hides a module
variable of the same name.
Small improvements
- A variable that only carries a value to the next line is now also moved into a call to a Clarion runtime procedure,
such asmessage()orputini(), when the runtime takes that argument by value. This is done in a
PROGRAMfile only: in aMEMBERmodule, or a file another one includes, the program's ownMAPmay declare a
procedure of that name. - A line common to both halves of an
IFcan now move above a test that cannot read it when it writes a field of a
prefixedGROUP. - A never-true
IFwhose test is carried over two rows is commented out whole. --ignoremarkson the command line now wins over a style profile'signoremarks=off, and the report says so.- Under
--ignoremarks, the rules that turn asetValue()into a call that works in place are also made on an object
given another object's value.
Rule files
- A new guard,
isWhole(): the match is made only of whole numbers. The shipped rules that split a length or a
position into two parts use it, so a fraction is not dropped once for each part. fold()andisConst()work out numbers only, at any depth of brackets: a call or a piece of text is written as
it stands. A shipped rule wrotelen(clip('ab '))aslen(ab), which did not compile, andval(upper('k'))as
val(K), a different value; a call such asday(today())is never replaced by its value on the day the tool ran.- A rule whose pattern ends on
THENmay carry an option after it, itsREVERSEtwin loads and fires on the same
IFs as the rule (so does the twin of a rule ending onELSE), and a pattern that endsthen ;, with blanks or a
tab before the;, loads. - A field equate such as
?Skipat the end of a replacement is a name, not theSKIPoption, and a tab inside a
quoted literal is kept. - Every shipped rule that writes its match beside
+or-, or insidefold(), carriesnoConcat, so a position
or length holding an&is never regrouped.
VitStyle
- Apply on the style already in force puts its alignment settings back, also for "(file defaults)".
- Save... no longer refuses a profiles file another VitStyle window created, and after a profile is saved under a
shipped style's name, applying it uses the settings the file now holds. - A line changed by the automatic declaration check is listed and counted once, and a change the tool refused is not
listed. The changes of every built-in are listed, the move of a test above a store among them, as changes and not
as layout rows.
Documentation
--ignoremarksis now listed in Appendix B, and its warning names more of the methods that make it unsafe:
loadFile(), and the ones whose answer depends on the encoding (chars(),equals(),clip()).- The
plainstyle,val()of a digit,WHERE isPlainand VitStyle's layout rows are described correctly, and a
new note in Appendix D says how the tool readsOMITandCOMPILEblocks.