lev_comp,dgn_comp vs CRLF style input

Allow the special level and dungeon compilers to handle input
files which have CR+LF delimited lines.  Apparently Cygwin doesn't
convert MSDOS style line ends into newlines the way stdio should
do for text I/O.  The resulting unexpected CR characters result in
syntax errors.

     And explicitly using '\n' on both the lex and yacc sides of
MAP processing allows removal of the old NEWLINE hack for Mac MPW.
It won't matter what numeric value that character escape sequence
has internally.
This commit is contained in:
nethack.rankin
2002-03-28 01:37:39 +00:00
parent 63e0b1ec2d
commit e835e2f420
6 changed files with 529 additions and 515 deletions

View File

@@ -1,5 +1,5 @@
%{
/* SCCS Id: @(#)dgn_lex.c 3.4 1996/03/02 */
/* SCCS Id: @(#)dgn_lex.c 3.4 2002/03/27 */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* Copyright (c) 1990 by M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
@@ -111,7 +111,7 @@ RNDCHLEVEL return(RNDCHLEVEL);
Strcpy(yylval.str, yytext+1); /* Discard the first \" */
return(STRING); }
^#.*\n { line_number++; }
\n { line_number++; }
\r?\n { line_number++; }
[ \t]+ ; /* skip trailing tabs & spaces */
. { return yytext[0]; }
%%