modula3 / cm3

Critical Mass Modula-3
http://modula3.github.io/cm3/
Other
133 stars 26 forks source link

caltech parser fails with Windows newlines #970

Open jaykrell opened 2 years ago

jaykrell commented 2 years ago

rm .M3SHIP rm .M3OVERRIDES C:/s/cm3/caltech-parser/parserlib/ktok/I386_NT/ktok ../src\Calc.t -o CalcTok.i3 C:/s/cm3/caltech-parser/parserlib/klex/I386_NT/klex ../src\Calc.l -o CalcLex.i3 -t ../src\Calc.t -ti3 CalcTok.i3 ../src\Calc.l line 5: name and expression required "c:\cm3\pkg\cit_util\src\generics.tmpl", line 37: quake runtime error: exit 1: C:/s/cm3/caltech-parser/parserlib/klex/I386_NT/klex ../src\Calc.l -o CalcLex.i3 -t ../src\Calc.t -ti3 CalcTok.i3

VictorMiasnikov commented 2 years ago

} caltech parser always fails to build

IMHO, failed only "embeded test". It's should be refactored ( for "beautiful reasons") And I haven't seen this error a long time ago . . .

see logs:


== package D:\cm3\src\caltech-parser\parserlib\parserlib\test_parserlib ==

 +++ d:\cm3\bin\cm3.exe   -DBUILD_DIR=I386_NT   -build -DROOT=D:/cm3/src -DTARGET=I386_NT +++
--- building in I386_NT ---

ignoring ../src\m3overrides

D:/cm3/src/caltech-parser/parserlib/ktok/I386_NT/ktok ../src\Calc.t -o CalcTok.i3
D:/cm3/src/caltech-parser/parserlib/klex/I386_NT/klex ../src\Calc.l -o CalcLex.i3 -t ../src\Calc.t -ti3 CalcTok.i3
D:/cm3/src/caltech-parser/parserlib/kyacc/I386_NT/kyacc ../src\Calc.y -o CalcParse.i3 -t ../src\Calc.t -ti3 CalcTok.i3
D:/cm3/src/caltech-parser/parserlib/kext/I386_NT/kext ../src\CalcTokStd.e
D:/cm3/src/caltech-parser/parserlib/kext/I386_NT/kext ../src\CalcLexStd.e
D:/cm3/src/caltech-parser/parserlib/kext/I386_NT/kext ../src\CalcParseStd.e
D:/cm3/src/caltech-parser/parserlib/kext/I386_NT/kext ../src\CalcParseTree.e
new source -> compiling CalcTok.i3
new source -> compiling CalcTok.m3
"../I386_NT/CalcTok.m3", line 36: warning: potentially unhandled exception: RTAllocator.OutOfMemory
1 warning encountered
new source -> compiling CalcLex.i3
new source -> compiling CalcLex.m3
new source -> compiling CalcParse.i3
new source -> compiling CalcParse.m3
new source -> compiling CalcTokStd.i3
new source -> compiling CalcTokStd.m3
new source -> compiling CalcLexStd.i3
new source -> compiling CalcLexStd.m3
new source -> compiling CalcParseStd.i3
new source -> compiling CalcParseStd.m3
new source -> compiling CalcParseTree.i3
new source -> compiling CalcParseTree.m3
new source -> compiling Main.m3
****  PARALLEL BACK-END BUILD, M3_PARALLEL_BACK = 20
 -> linking test.exe
jaykrell commented 2 years ago

I think it has to do with carriage returns, and so your git settings are a factor. But I have run dos2unix.

jaykrell commented 2 years ago

ok.. I was worrying about C++ backend..but it works on OpenBSD/amd64 with C++ backend. So it is something about \r vs. \n.

jaykrell commented 2 years ago

Ok, I got it to work. I just had to run dos2unix more. I tried fixing the source in a few places to handle \r\n like \n but didn't get it right yet.

VictorMiasnikov commented 2 years ago

Move here from: https://github.com/modula3/cm3/issues/927#issuecomment-1019833736

I want write about refactoring "caltech-parser/parserlib" a long time . . .

At first we should move(?) testing outside of building.

P.S.

2) I prefer this style of folder structure: C:/s/cm3/src/caltech-parser/

but we should use this: C:/s/cm3/caltech-parser/