Open processor286 opened 2 years ago
Thanks, I will look into it.
One thing: the parser is - in many points - currently geared towards uppercase-only source. I know this is a limitation (a major one for some existing code bases) and it will be addressed in the future, as well as (probably not at the same time) the lack of support for free-format source. In the meantime I just wanted to point this out because it's probably not totally clear from the docs.
I find it is sensitive to the location of some lines even within area A, e.g. this works ( I shfted working-storage section to begin in column 8 instead of 9):
00002 : identification division.
00002 : program-id. t1.
00003 : data division.
00004 : working-storage section.
00005 : 01 block1.
00006 : 03 mypic1 pic x(10).
00007 : 01.
00008 : 03 mypic2 pic x(10).
00009 :
00010 : procedure division.
00011 : a-main section.
00012 : display 'hello world'.
00013 : stop run.
I lazily use TAB - 8 spaces when I'm writing short COBOL programs, as one TAB puts you in area A at column 9 , then two puts you in area B at column 17. Good enough for short snippets mostly.
But apparently working-storage section. needs to be in column 8.
I don't know what the standard says about this, but in my old head I was sure that 'anywhere in area A' was acceptable for division and section headers even before free form source.
I performed some tests, most of this is definitely linked to the parser (actually the lexer) being case-sensitive and geared towards uppercase. This behavior must obviously be changed but it is not going to be a quick fix
Attempting to preprocess simple program for testing, this one doesn't have any SQL in it yet.
I was actually trying to test anonymous 01 levels as I have a lot of these in the codebase, and a more complex test program failed SIGSEGV on an anonymous 01 level, so I thought to provide a simple test program:
This will compile and run with cobc:
But attempting to preprocess it:
versions in use:
And: