Code Monkey home page Code Monkey logo

Comments (5)

strager avatar strager commented on September 5, 2024

Actually, I realized this task isn't done. Escaping <CR><LF> doesn't work!

$ hexdump -C hello.js
00000000  63 6f 6e 73 6f 6c 65 2e  6c 6f 67 28 22 68 65 6c  |console.log("hel|
00000010  6c 6f 5c 0d 0a 77 6f 72  6c 64 22 29 3b           |lo\..world");|
0000001d
$ node hello.js
helloworld
$ ./build/quick-lint-js hello.js
hello.js:1:13: error: unclosed string literal
../src/parse.cpp:413: internal check failed in parse_expression_remainder: this->peek().type == token_type::right_paren
zsh: illegal hardware instruction  ./build/quick-lint-js hello.js

from quick-lint-js.

strager avatar strager commented on September 5, 2024

I knew there was more to this task than met the eye. I just forgot what the gotcha was. =]

from quick-lint-js.

AngelJA avatar AngelJA commented on September 5, 2024

@strager Just wanted to make sure I'm reproducing the problem correctly here. In vscode with end of line sequence set to CRLF.
image

This should report no error, right?

from quick-lint-js.

AngelJA avatar AngelJA commented on September 5, 2024

Just to clarify, templates don't require the escaped newline like strings, so the rules are a bit different.

# valid
let a = `hello
         world`;

from quick-lint-js.

strager avatar strager commented on September 5, 2024

This was implemented by @AngelJA.

from quick-lint-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.