iASL/DTC: Fix scanner issues with comments and line numbers.

Comment remover could get confused and miss a comment ending.
Fixed a problem with line counter maintenance.
This commit is contained in:
Robert Moore 2011-02-03 13:54:18 -08:00
parent 4ac95ece8f
commit 5629930ac6

View File

@ -138,7 +138,7 @@ DtParseLine (
UINT32 Line,
UINT32 Offset);
static UINT32
UINT32
DtGetNextLine (
FILE *Handle);
@ -466,7 +466,7 @@ DtParseLine (
*
*****************************************************************************/
static UINT32
UINT32
DtGetNextLine (
FILE *Handle)
{
@ -481,6 +481,16 @@ DtGetNextLine (
c = (char) getc (Handle);
if (c == EOF)
{
switch (State)
{
case DT_START_QUOTED_STRING:
case DT_SLASH_ASTERISK_COMMENT:
case DT_SLASH_SLASH_COMMENT:
AcpiOsPrintf ("**** EOF within comment/string %u\n", State);
break;
}
return (0);
}
@ -601,6 +611,16 @@ DtGetNextLine (
State = DT_NORMAL_TEXT;
break;
case '\n':
CurrentLineOffset = Gbl_NextLineOffset;
Gbl_NextLineOffset = (UINT32) ftell (Handle);
Gbl_CurrentLineNumber++;
break;
case '*':
/* Consume all adjacent asterisks */
break;
default:
State = DT_SLASH_ASTERISK_COMMENT;
break;