16 Commits

Author SHA1 Message Date
Olaf Seibert
8d7414d7c3 Rename stream2 method "gets" to "getline"
because FORTIFY re#defines gets, and this gets is something different.
2022-01-05 22:29:03 +01:00
Olaf Seibert
0ab2a4fa16 Add consistency checking for symbol flags
while also adding some consistency.
All listings now list . (dot) as defined so they need updating.
2021-05-30 13:19:39 +02:00
Olaf Seibert
43aef73305 Fix logical error in listing from maclib.
It seems the code was similarly wrong before I introduced the flag
CALLED_NOLIST in f07c9045f5bf60ccd821a33bb4ebf06d06fe7c48.

No change in regression tests as we don't have macro libraries available
to test.
2020-03-07 23:23:44 +01:00
Olaf Seibert
f07c9045f5 Prepare for macros being defined in "other ways" which are not yet put in the macro definition table. 2017-04-27 20:43:28 +02:00
Olaf Seibert
a685d341c5 First changes in 0.5wip: correct some grammar (it's vs. its). 2016-02-21 21:13:50 +01:00
Olaf Seibert
d38f4009c4 Crank up the warning levels, and adjust the code to silence ...
several compilers:
- gcc version 4.5.3 (NetBSD nb2 20110806)
- gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
- Ubuntu clang version 3.6.0-2ubuntu1 (tags/RELEASE_360/final) (based on LLVM 3.6.0)

The warnings were mostly about local variables shadowing others,
unused function parameters, and C++ style comments. Some variables were
indeed used before set.

Note that on Linux, using -std=c99 does stupid things like *remove* the
declaration of strdup() from <string.h>. Therefore I've reluctantly used
-std=gnu99.
2015-05-27 21:51:26 +02:00
Olaf Seibert
435cdb0b7f Separate out the string parsing for .include/.library file names and macro arguments.
They behave observably different from generic string parsing and trying
to account for them generically just gets in the way.
.rept is treated the same as a macro.
2015-05-22 16:36:16 +02:00
Olaf Seibert
b45cf742f7 A trailing comma in a macro call is an empty argument
which should also be counted for the purposes of .NARG.
2015-05-19 22:10:44 +02:00
Olaf Seibert
4fabe28497 Make .narg work
it should count only non-keyword (actual) arguments.
2015-05-14 14:33:54 +02:00
Olaf Seibert
e703403017 Bring .ENDM label in correspondence with the manual. 2015-05-12 22:59:21 +02:00
Olaf Seibert
74c2399c7d Remove some remaining logging. 2015-05-12 22:42:05 +02:00
Olaf Seibert
7e45c8a656 Change .ENDM name in self-redefining macros to be more forgiving
The original intent of the code, when faced with something like

	.MACRO	A
	.MACRO	B
	.ENDM	A

is to terminate the outer macro definition immediately.
However some macros redefine themselves, and that broke.
For now, detect self-redefinition and disable the early
end if there is one.

Since this does not match what's described on page 7-3,
this will change if it doesn't break my test cases.
2015-05-12 21:55:18 +02:00
Olaf Seibert
f75f5e1242 Change delimiters of local symbol blocks to be more like page 3-10 of the manual.
Also, to make Kermit sources work, only increase the local symbol block
counter if there actually was a local symbol used in the block.
This way, conditional inclusions (which include source text only in the
first pass) will have less potential for de-synchronisation between the
passes. After all, if the generated internal local symbol names do
not match, phase errors will result (showing themselves as strange label
redefinition problems).
2015-05-10 17:51:32 +02:00
Olaf Seibert
2bc55f39f3 Add debug flag to command line interpretation. 2015-05-10 17:39:38 +02:00
Toby Thain
7ab53debb8 Fix some warnings under clang. 2015-02-01 22:11:54 -05:00
Sergey Svishchev
6a2afc3fa7 Import J Hoppe's 20090427 release from http://retrocmp.com/tools/macro-11-on-windows 2013-02-15 23:50:38 +04:00