<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/src/expressions.c, branch v2.5.2</title>
<subtitle>Scintilla-based Text Editor and COrrector</subtitle>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/'/>
<entry>
<title>updated copyright to 2026</title>
<updated>2026-01-01T06:59:49+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-01-01T06:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=c2feb2a6f71fc9adb20226fb3c2260c236e974e0'/>
<id>c2feb2a6f71fc9adb20226fb3c2260c236e974e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>properly document some functions in expressions.c and simplified code</title>
<updated>2025-07-26T13:48:56+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-26T13:30:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=0ea082b74414696a7800455a437656fca2886f6d'/>
<id>0ea082b74414696a7800455a437656fca2886f6d</id>
<content type='text'>
* Practically all calls to teco_expressions_args() must be preceded by teco_expressions_eval().
* In code paths where we know that teco_expressions_args() &gt; 0, it is safe
  to call teco_expressions_pop_num(0) instead of teco_expressions_pop_num_calc().
  This is both easier and faster.
* teco_expressions_pop_num_calc() is for simple applications where you just want to get
  a command argument with default (implied) values.
  Since it includes teco_expressions_eval(), we can avoid superfluous calls.
* -EC...$ turned out to be broken and is fixed now.
  A test case has been added.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Practically all calls to teco_expressions_args() must be preceded by teco_expressions_eval().
* In code paths where we know that teco_expressions_args() &gt; 0, it is safe
  to call teco_expressions_pop_num(0) instead of teco_expressions_pop_num_calc().
  This is both easier and faster.
* teco_expressions_pop_num_calc() is for simple applications where you just want to get
  a command argument with default (implied) values.
  Since it includes teco_expressions_eval(), we can avoid superfluous calls.
* -EC...$ turned out to be broken and is fixed now.
  A test case has been added.
</pre>
</div>
</content>
</entry>
<entry>
<title>support &lt;==&gt; and &lt;===&gt; for printing octal and hexadecimal numbers</title>
<updated>2025-07-20T21:33:13+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-20T21:19:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=48dcfd22f9c2db5cf6745eaec0ff28895858c638'/>
<id>48dcfd22f9c2db5cf6745eaec0ff28895858c638</id>
<content type='text'>
* These are famously in DEC TECO-11, but also in Video TECO.
* The implementation is tricky. They need to use lookahead states,
  but this would be inacceptable during interactive execution.
  Therefore only if executing from the end of the command line
  `==` and `===` are allowed to print multiple values.
  The number is therefore also not popped form the stack immediately
  but only peeked. It's popped only when it has been decided that
  the command has ended.
* This may break existing macros that use multiple `=` in a row
  to print multiple values from the stack.
  You will now e.g. have to insert whitespace to separate such `=` commands.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* These are famously in DEC TECO-11, but also in Video TECO.
* The implementation is tricky. They need to use lookahead states,
  but this would be inacceptable during interactive execution.
  Therefore only if executing from the end of the command line
  `==` and `===` are allowed to print multiple values.
  The number is therefore also not popped form the stack immediately
  but only peeked. It's popped only when it has been decided that
  the command has ended.
* This may break existing macros that use multiple `=` in a row
  to print multiple values from the stack.
  You will now e.g. have to insert whitespace to separate such `=` commands.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed formatting of the smallest possible integer</title>
<updated>2025-04-10T00:16:18+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-04-09T23:00:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=c462509adfd68e8b849b8a6713360fb4f9026578'/>
<id>c462509adfd68e8b849b8a6713360fb4f9026578</id>
<content type='text'>
* In other words, fixed `-9223372036854775808\` on --with-teco-integer=64
  (which is the default).
* The reason is that ABS(G_MININT64) == G_MININT64 since -G_MININT64 == G_MININT64.
  It is therefore important not to call ABS() on arbitrary teco_int_t's.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* In other words, fixed `-9223372036854775808\` on --with-teco-integer=64
  (which is the default).
* The reason is that ABS(G_MININT64) == G_MININT64 since -G_MININT64 == G_MININT64.
  It is therefore important not to call ABS() on arbitrary teco_int_t's.
</pre>
</div>
</content>
</entry>
<entry>
<title>updated copyright to 2025</title>
<updated>2025-01-12T23:39:34+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-01-12T23:39:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=d842eaee19e2723f845d4b8314a230cf68e82653'/>
<id>d842eaee19e2723f845d4b8314a230cf68e82653</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>avoid dynamic stack allocation in teco_expressions_brace_return()</title>
<updated>2024-11-25T16:11:49+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-25T16:11:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=88d65fb8b736a8b3aa2b4c85e5517095a1134a49'/>
<id>88d65fb8b736a8b3aa2b4c85e5517095a1134a49</id>
<content type='text'>
* This is not safe since the size of the stack object comes from the "outside" world,
  so stack overflows can theoretically be provoked by macros.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This is not safe since the size of the stack object comes from the "outside" world,
  so stack overflows can theoretically be provoked by macros.
</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>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>
<entry>
<title>fixed up 68578072bfaf6054a96bb6bcedfccb6e56a508fe: negative numbers weren't parsed correctly</title>
<updated>2024-09-12T23:07:31+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-09-12T23:07:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=f55f50ea54042f8acef27389c50849094075fb01'/>
<id>f55f50ea54042f8acef27389c50849094075fb01</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
