Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #238 from proxv/multiline-strings-semicolons

Don't insert semicolons before multi-line strings.
  • Loading branch information...
commit 120ed08cae61a38062de05d6bc4e39ed9abe7647 2 parents 3dc988b + 48d2fe7
Mihai Bazon mishoo authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 lib/parse-js.js
10 lib/parse-js.js
@@ -291,12 +291,12 @@ function tokenizer($TEXT) {
291 291
292 292 function peek() { return S.text.charAt(S.pos); };
293 293
294   - function next(signal_eof) {
  294 + function next(signal_eof, in_string) {
295 295 var ch = S.text.charAt(S.pos++);
296 296 if (signal_eof && !ch)
297 297 throw EX_EOF;
298 298 if (ch == "\n") {
299   - S.newline_before = true;
  299 + S.newline_before = S.newline_before || !in_string;
300 300 ++S.line;
301 301 S.col = 0;
302 302 } else {
@@ -393,8 +393,8 @@ function tokenizer($TEXT) {
393 393 }
394 394 };
395 395
396   - function read_escaped_char() {
397   - var ch = next(true);
  396 + function read_escaped_char(in_string) {
  397 + var ch = next(true, in_string);
398 398 switch (ch) {
399 399 case "n" : return "\n";
400 400 case "r" : return "\r";
@@ -442,7 +442,7 @@ function tokenizer($TEXT) {
442 442 return false;
443 443 });
444 444 if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));
445   - else ch = read_escaped_char();
  445 + else ch = read_escaped_char(true);
446 446 }
447 447 else if (ch == quote) break;
448 448 ret += ch;

0 comments on commit 120ed08

Please sign in to comment.
Something went wrong with that request. Please try again.