Explorar el Código

Parse '\*' escape in strings (from Lua 5.2).

Mike Pall hace 15 años
padre
commit
367ff0cdaa
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/lj_lex.c

+ 5 - 0
src/lj_lex.c

@@ -175,6 +175,11 @@ static void read_string(LexState *ls, int delim, TValue *tv)
 	  c += 9;
 	  c += 9;
 	}
 	}
 	break;
 	break;
+      case '*':  /* Skip whitespace. */
+	next(ls);
+	while (lj_char_isspace(ls->current))
+	  if (currIsNewline(ls)) inclinenumber(ls); else next(ls);
+	continue;
       case '\n': case '\r': save(ls, '\n'); inclinenumber(ls); continue;
       case '\n': case '\r': save(ls, '\n'); inclinenumber(ls); continue;
       case END_OF_STREAM: continue;
       case END_OF_STREAM: continue;
       default:
       default: