Compiler bug spreading <> over lines

20 views
Skip to first unread message

Carlo Hogeveen

unread,
Mar 23, 2026, 4:46:53 AM (11 days ago) Mar 23
to sem...@googlegroups.com

I need to compare two very long pieces of syntax that each result in a string.
A shortened example of that would be
if 'a' <> 'b'
The compiler accepts that and produces a correctly running macro.
For readability (because the real syntax is very long), I changed that to
if 'a'
<>
'b'
Unfortunately, the compiler then returns the error "numeric expression expected".
Below is a full example macro.

Muwahaha (evil laughter): From now on I can blame any unreadable macro programs on the compiler!

Carlo


proc Main()
if 'a'
<>
'b'
Warn('Irrelevant 1')
else
Warn('Irrelevant 2')
endif
PurgeMacro(CurrMacroFilename())
end Main



Knud van Eeden

unread,
Mar 23, 2026, 1:34:18 PM (10 days ago) Mar 23
to sem...@googlegroups.com
image.pngimage.png


Assumption:

In general one can not split just any TSE SAL (mathematical) expression over multiple lines,
it has to be kept on 1 line by design.

Otherwise the TSE SAL parser will not handle that mathematical multi-line expression and show an error because of seeing
e.g. unexpected new lines in an expression in this case.

Current verdict: not a bug, but behavior by design.

with friendly greetings
Knud van Eeden




--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/001301dcbaa1%24984434a0%24c8cc9de0%24%40ecarlo.nl.

Eckhard Hillmann

unread,
Mar 23, 2026, 5:33:24 PM (10 days ago) Mar 23
to Carlo Hogeveen
That's interesting!

Seems that it only happens when the first compare sign is the less '<' char.
Looks like any other combination works (tested with TSE 4.50.20).

proc Main()
if 'a'
<>
'b'
Warn('Irrelevant 1')
else
Warn('Irrelevant 2')
endif
PurgeMacro(CurrMacroFilename())
end Main

// error
// if 'a'
// <>
// 'b'

// error
// if 'a'
// <
// 'b'

// error
// if 'a'
// <=
// 'b'

// works
// if 'a'
// >=
// 'b'

// works
// if 'a'
// ==
// 'b'

// works
// if 'a'
// >
// 'b'

CH> Muwahaha (evil laughter): From now on I can blame any unreadable macro programs on the compiler!
Nice one!
Well, you know it's a bad day when your horrible tasting toothpaste turn out to be Preparation-H ;-)

--
Best regards
Eckhard


Ihre Nachricht vom Montag, 23. März 2026 09:46:


CH> I need to compare two very long pieces of syntax that each result in a string.
CH> A shortened example of that would be
CH> if 'a' <> 'b'
CH> The compiler accepts that and produces a correctly running macro.
CH> For readability (because the real syntax is very long), I changed that to
CH> if 'a'
CH> <>
CH> 'b'
CH> Unfortunately, the compiler then returns the error "numeric expression expected".
CH> Below is a full example macro.

CH> Muwahaha (evil laughter): From now on I can blame any unreadable macro programs on the compiler!

CH> Carlo


CH> proc Main()
CH> if 'a'
CH> <>
CH> 'b'
CH> Warn('Irrelevant 1')
CH> else
CH> Warn('Irrelevant 2')
CH> endif
CH> PurgeMacro(CurrMacroFilename())
CH> end Main

CH>

Knud van Eeden

unread,
Mar 23, 2026, 7:36:50 PM (10 days ago) Mar 23
to sem...@googlegroups.com
Indeed there is something special in this example context about this 

<

other operators work OK.

zhong zhao

unread,
Mar 23, 2026, 9:02:25 PM (10 days ago) Mar 23
to SemWare TSE Pro text editor
Because <hotkey name> I guess.

Knud van Eeden

unread,
Mar 23, 2026, 9:42:09 PM (10 days ago) Mar 23
to sem...@googlegroups.com
It is already in TSE version 2.8 (released in June 1997, thus about 30 years ago)

image.png


S.E. Mitchell

unread,
Mar 23, 2026, 10:54:22 PM (10 days ago) Mar 23
to sem...@googlegroups.com
It relates to key assignments:
<>> foo()
Assigns foo() to the ">" key.

It is fixed now. Hopefully I didn't break <<> key assignments! :)
--
Sammy
Reply all
Reply to author
Forward
0 new messages