about summary refs log tree commit diff
path: root/src/libexpr/lexer.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/lexer.l')
-rw-r--r--src/libexpr/lexer.l8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index bc9a38da42f9..892543ec2eeb 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -21,6 +21,10 @@ static void adjustLoc(YYLTYPE * loc, const char * s, size_t len)
 {
     while (len--) {
        switch (*s++) {
+       case '\r':
+           if (*s == '\n') /* cr/lf */
+               s++;
+           /* fall through */
        case '\n': 
            ++loc->first_line;
            loc->first_column = 1;
@@ -85,8 +89,8 @@ inherit     { return INHERIT; }
 {PATH}      { yylval->t = toATerm(yytext); return PATH; /* !!! alloc */ }
 {URI}       { yylval->t = toATerm(yytext); return URI; /* !!! alloc */ }
 
-[ \t\n]+    /* eat up whitespace */
-\#[^\n]*    /* single-line comments */
+[ \t\r\n]+    /* eat up whitespace */
+\#[^\r\n]*    /* single-line comments */
 \/\*([^*]|\*[^\/])*\*\/  /* long comments */
 
 .           return yytext[0];