<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/tests, branch v2.3.0</title>
<subtitle>Scintilla-based Text Editor and COrrector</subtitle>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/'/>
<entry>
<title>fixed crashes while setting special Q-Registers with EU (string-building characters)</title>
<updated>2024-12-22T16:33:48+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-12-22T15:08:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=c293f725e55661ae690b52d5e8339e48b07a6a85'/>
<id>c293f725e55661ae690b52d5e8339e48b07a6a85</id>
<content type='text'>
* The teco_qreg_vtable_t::get_string() method should support returning the
  length optionally (may be NULL).
  This already worked with teco_doc_get_string(), even though it wasn't documented,
  and therefore didn't cause problems with regular Q-Registers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The teco_qreg_vtable_t::get_string() method should support returning the
  length optionally (may be NULL).
  This already worked with teco_doc_get_string(), even though it wasn't documented,
  and therefore didn't cause problems with regular Q-Registers.
</pre>
</div>
</content>
</entry>
<entry>
<title>implemented the ^Q command for converting between line and glyph positions</title>
<updated>2024-12-08T13:10:29+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-12-08T02:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=bd87ff40e73929e761e1233aa812a6736cacbed1'/>
<id>bd87ff40e73929e761e1233aa812a6736cacbed1</id>
<content type='text'>
* As known from DEC TECO, but extended to convert absolute positions to line numbers as well.
  :^Q returns the current line.
* Especially useful in macros that accept line arguments,
  as it is much shorter than something like
  ^E@ES/LINEFROMPOSITION//+Q.l@ES/POSITIONFROMLINE//:^E-.
* On the other hand, the fact that ^Q checks the line range means we cannot
  easily replace lexer.checkheader with something like
  [:J 0,^Q::S...$ ]:
  Using SCI_POSITIONFROMLINE still has the advantage that it returns `Z` for out-of-bounds ranges
  which would be cumbersome to write with the current ^Q.
* Perhaps there should be a separate command for converting between absolute lines and positions
  and :^Q should be repurposed to return a failure boolean for out-of-range values?
* fnkeys.tes could be simplified.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* As known from DEC TECO, but extended to convert absolute positions to line numbers as well.
  :^Q returns the current line.
* Especially useful in macros that accept line arguments,
  as it is much shorter than something like
  ^E@ES/LINEFROMPOSITION//+Q.l@ES/POSITIONFROMLINE//:^E-.
* On the other hand, the fact that ^Q checks the line range means we cannot
  easily replace lexer.checkheader with something like
  [:J 0,^Q::S...$ ]:
  Using SCI_POSITIONFROMLINE still has the advantage that it returns `Z` for out-of-bounds ranges
  which would be cumbersome to write with the current ^Q.
* Perhaps there should be a separate command for converting between absolute lines and positions
  and :^Q should be repurposed to return a failure boolean for out-of-range values?
* fnkeys.tes could be simplified.
</pre>
</div>
</content>
</entry>
<entry>
<title>support the ::S anchored search (string comparison) command (and ::FD, ::FR, ::FS as well)</title>
<updated>2024-12-06T14:20:52+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-12-06T14:20:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=e5884ab2166ab5a03294baa54601b8785e6d9727'/>
<id>e5884ab2166ab5a03294baa54601b8785e6d9727</id>
<content type='text'>
* The colon modifier can now occur 2 times.
  Specifying `@` more than once or `:` more than twice is an error now.
* Commands do not check for excess colon modifiers - almost every command would have
  to check it. Instead, a double colon will simply behave like a single colon on most
  commands.
* All search commands inherit the anchored semantics, but it's not very useful in some combinations
  like -::S, ::N or ::FK.
  That's why the `::` variants are not documented everywhere.
* The lexer.checkheader macro could be simplified and should also be faster now,
  speeding up startup.
  Eventually this macro can be made superfluous, e.g. by using 1:FB or 0,1^Q::S.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The colon modifier can now occur 2 times.
  Specifying `@` more than once or `:` more than twice is an error now.
* Commands do not check for excess colon modifiers - almost every command would have
  to check it. Instead, a double colon will simply behave like a single colon on most
  commands.
* All search commands inherit the anchored semantics, but it's not very useful in some combinations
  like -::S, ::N or ::FK.
  That's why the `::` variants are not documented everywhere.
* The lexer.checkheader macro could be simplified and should also be faster now,
  speeding up startup.
  Eventually this macro can be made superfluous, e.g. by using 1:FB or 0,1^Q::S.
</pre>
</div>
</content>
</entry>
<entry>
<title>the &lt;Xq&gt; command now supports the @ modifier for cutting into the register</title>
<updated>2024-12-04T13:43:51+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-12-04T13:43:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=48308687979f26a3498e7af94eacc8fe34307a78'/>
<id>48308687979f26a3498e7af94eacc8fe34307a78</id>
<content type='text'>
* Can be freely combined with the colon-modifier as well.
  :@Xq cut-appends to register q.
* This simply deletes the given buffer range after the copy or append operation
  as if followed by another &lt;K&gt; command.
* This has indeed been a very annoying missing feature, as you often have to retype the
  range for a K or D command.
  At the same time, this cannot be reasonably solved with a macro since macros
  do not accept Q-Register arguments -- so we would have to restrict ourselves to one or a few
  selected registers.
  I was also considering to solve this with a special stack operation that duplicates the
  top values, so that Xq leaves arguments for K, but this couldn't work for cutting lines
  and would also be longer to type.
* It's the first non-string command that accepts @.
  Others may follow in the future.
  We're approaching ITS TECO madness levels.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Can be freely combined with the colon-modifier as well.
  :@Xq cut-appends to register q.
* This simply deletes the given buffer range after the copy or append operation
  as if followed by another &lt;K&gt; command.
* This has indeed been a very annoying missing feature, as you often have to retype the
  range for a K or D command.
  At the same time, this cannot be reasonably solved with a macro since macros
  do not accept Q-Register arguments -- so we would have to restrict ourselves to one or a few
  selected registers.
  I was also considering to solve this with a special stack operation that duplicates the
  top values, so that Xq leaves arguments for K, but this couldn't work for cutting lines
  and would also be longer to type.
* It's the first non-string command that accepts @.
  Others may follow in the future.
  We're approaching ITS TECO madness levels.
</pre>
</div>
</content>
</entry>
<entry>
<title>implemented ^Y/^S commands for receiving pattern match/insertion ranges and lengths (refs #27)</title>
<updated>2024-12-04T08:43:18+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-12-03T23:22:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=3a823fb43ba0abe52f3152d337675e9ed9a3f175'/>
<id>3a823fb43ba0abe52f3152d337675e9ed9a3f175</id>
<content type='text'>
* Allows storing pattern matches into Q-Registers (^YXq).
* You can also refer to subpatterns marked by ^E[...] by passing a number &gt; 0.
  This is equivalent to \0-9 references in many programming languages.
* It's especially useful for supporting TECO's equivalent of structural regular expressions.
  This will be done with additional macros.
* You can also simply back up to the beginning of an insertion or search.
  So I...$^SC leaves dot at the beginning of the insertion.
  S...$^SC leaves dot before the found pattern.
  This has been previously requested by users.
* Perhaps there should be ^Y string building characters as well to backreference
  in search-replacement commands (TODO).
  This means that the search commands would have to store the matched text itself
  in teco_range_t structures since FR deletes the matched text before
  processing the replacement string.
  It could also be made into a FR/FS-specific construct,
  so we don't fetch the substrings unnecessarily.
* This differs from DEC TECO in always returning the same range even after dot movements,
  since we are storing start/end byte positions instead of only the length.
  Also DEC TECO does not support fetching subpattern ranges.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Allows storing pattern matches into Q-Registers (^YXq).
* You can also refer to subpatterns marked by ^E[...] by passing a number &gt; 0.
  This is equivalent to \0-9 references in many programming languages.
* It's especially useful for supporting TECO's equivalent of structural regular expressions.
  This will be done with additional macros.
* You can also simply back up to the beginning of an insertion or search.
  So I...$^SC leaves dot at the beginning of the insertion.
  S...$^SC leaves dot before the found pattern.
  This has been previously requested by users.
* Perhaps there should be ^Y string building characters as well to backreference
  in search-replacement commands (TODO).
  This means that the search commands would have to store the matched text itself
  in teco_range_t structures since FR deletes the matched text before
  processing the replacement string.
  It could also be made into a FR/FS-specific construct,
  so we don't fetch the substrings unnecessarily.
* This differs from DEC TECO in always returning the same range even after dot movements,
  since we are storing start/end byte positions instead of only the length.
  Also DEC TECO does not support fetching subpattern ranges.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed operator precedence application (fixup 5597bc72671d0128e6f0dba446c4dc8d47bf37d0)</title>
<updated>2024-11-25T20:15:43+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-25T20:15:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=8490013e558386d5584cbaba610268adad4ddd89'/>
<id>8490013e558386d5584cbaba610268adad4ddd89</id>
<content type='text'>
* Using teco_expressions_eval() is wrong since it does not pay attention to precedences.
  If you have multiple higher precedence operators in a row, as in 2+3*4*5,
  the lower precedence operators would be resolved prematurely.
* Instead we now call teco_expressions_calc() repeatedly but only for lower precedence
  operators on the stack top.
  This makes sure that as much of the expression as possible is evaluated at any given moment.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Using teco_expressions_eval() is wrong since it does not pay attention to precedences.
  If you have multiple higher precedence operators in a row, as in 2+3*4*5,
  the lower precedence operators would be resolved prematurely.
* Instead we now call teco_expressions_calc() repeatedly but only for lower precedence
  operators on the stack top.
  This makes sure that as much of the expression as possible is evaluated at any given moment.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed subtle operator precedence bug</title>
<updated>2024-11-25T15:58:53+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-25T15:58:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=5597bc72671d0128e6f0dba446c4dc8d47bf37d0'/>
<id>5597bc72671d0128e6f0dba446c4dc8d47bf37d0</id>
<content type='text'>
* It was possible to provoke operator right-associativity when placing a high-precedence
  operator between two low-precedence operators.
  1-6*5-1 evaluated to -28 instead of the expected -30.
* The reason is that SciTECO relies on operators to be resolved from left-to-right as soon as possible.
  The higher precedence operator prevents that and pushing the 2nd "-" only evaluated 6*5.
  At the end 1-30-1 would be left on the stack.
  teco_expressions_eval() however evaluates from right-to-left which is wrong in this case.
* Instead, we now do a full eval on every operator with a lower precedence, making sure that 1-30 is
  evaluated first.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* It was possible to provoke operator right-associativity when placing a high-precedence
  operator between two low-precedence operators.
  1-6*5-1 evaluated to -28 instead of the expected -30.
* The reason is that SciTECO relies on operators to be resolved from left-to-right as soon as possible.
  The higher precedence operator prevents that and pushing the 2nd "-" only evaluated 6*5.
  At the end 1-30-1 would be left on the stack.
  teco_expressions_eval() however evaluates from right-to-left which is wrong in this case.
* Instead, we now do a full eval on every operator with a lower precedence, making sure that 1-30 is
  evaluated first.
</pre>
</div>
</content>
</entry>
<entry>
<title>added special Q-Register ":" for accessing dot</title>
<updated>2024-11-24T01:51:34+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-24T01:38:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=23c90e37ff48707c4aabdb8b1460df382a600d7a'/>
<id>23c90e37ff48707c4aabdb8b1460df382a600d7a</id>
<content type='text'>
* We cannot call it "." since that introduces a local register
  and we don't want to add an unnecessary syntactic exception.
* Allows the idiom [: ... ]: to temporarily move around.
  Also, you can now write ^E\: without having to store dot in a register first.
* In the future we might add an ^E register as well for byte offsets.
  However, there are much fewer useful applications.
* Of course, you can now also write nU: instead of nJ, Q: instead of "." and
  n%: instead of "nC.". However it's all not really useful.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* We cannot call it "." since that introduces a local register
  and we don't want to add an unnecessary syntactic exception.
* Allows the idiom [: ... ]: to temporarily move around.
  Also, you can now write ^E\: without having to store dot in a register first.
* In the future we might add an ^E register as well for byte offsets.
  However, there are much fewer useful applications.
* Of course, you can now also write nU: instead of nJ, Q: instead of "." and
  n%: instead of "nC.". However it's all not really useful.
</pre>
</div>
</content>
</entry>
<entry>
<title>disallow setting the radix to values lower than 2</title>
<updated>2024-11-22T23:41:42+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-22T14:47:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=a61a81ec33188e8e93ec02912c60053107ae0485'/>
<id>a61a81ec33188e8e93ec02912c60053107ae0485</id>
<content type='text'>
* This would actually causes crashes when trying to format numbers.
* The ^R local register has a custom set_integer() method now,
  so that the check is performed also when using nU.^X.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This would actually causes crashes when trying to format numbers.
* The ^R local register has a custom set_integer() method now,
  so that the check is performed also when using nU.^X.
</pre>
</div>
</content>
</entry>
<entry>
<title>the search mode and current radix are mapped to __local__ Q-Registers ^X and ^R now (refs #17)</title>
<updated>2024-11-22T23:33:49+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-22T13:59:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=1cfe37610253c20a4fcb0d937c29e70894ecc4f5'/>
<id>1cfe37610253c20a4fcb0d937c29e70894ecc4f5</id>
<content type='text'>
* This way the search mode and radix are local to the current macro frame,
  unless the macro was invoked with :Mq.
  If colon-modified, you can reproduce the same effect by calling
  [.^X 0^X ... ].^X
* The radix register is cached in the Q-Reg table as an optimization.
  This could be done with the other "special" registers as well, but at the
  cost of larger stack frames.
* In order to allow constructs like [.^X typed with upcarets,
  the Q-Register specification syntax has been extended:
  ^c is the corresponding control code instead of the register "^".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This way the search mode and radix are local to the current macro frame,
  unless the macro was invoked with :Mq.
  If colon-modified, you can reproduce the same effect by calling
  [.^X 0^X ... ].^X
* The radix register is cached in the Q-Reg table as an optimization.
  This could be done with the other "special" registers as well, but at the
  cost of larger stack frames.
* In order to allow constructs like [.^X typed with upcarets,
  the Q-Register specification syntax has been extended:
  ^c is the corresponding control code instead of the register "^".
</pre>
</div>
</content>
</entry>
</feed>
