diff options
Diffstat (limited to 'iup/src/iup_ledlex.c')
-rwxr-xr-x | iup/src/iup_ledlex.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/iup/src/iup_ledlex.c b/iup/src/iup_ledlex.c index 3283a43..5cf8640 100755 --- a/iup/src/iup_ledlex.c +++ b/iup/src/iup_ledlex.c @@ -35,7 +35,7 @@ static struct /* lexical variables */ static int iLexGetChar (void); static int iLexToken(int *erro); static int iLexCapture (char* dlm); -static int iLexSkip (char* dlm); +static void iLexSkipComment (void); static int iLexCaptureAttr (void); int iupLexStart(const char* filename, int is_file) /* initialize lexical analysis */ @@ -186,9 +186,9 @@ static int iLexToken(int *erro) case ']': return IUPLEX_TK_ENDATTR; - case '#': /* iLexSkip comment */ - case '%': /* iLexSkip comment */ - iLexSkip ("\n\r"); + case '#': /* Skip comment */ + case '%': /* Skip comment */ + iLexSkipComment(); continue; case ' ': /* ignore whitespace */ @@ -276,14 +276,13 @@ static int iLexCaptureAttr (void) return c; /* return delimiter */ } -static int iLexSkip (char* dlm) +static void iLexSkipComment (void) { int c; do { - c = iLexGetChar (); - } while ((c > 0) && !strchr (dlm,c)); - return c; /* return delimiter */ + c = iLexGetChar(); + } while ((c > 0) && (c != '\n')); } static int iLexGetChar (void) |