question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(C) \ not respected

See original GitHub issue

Describe the issue

Which language seems to have the issue?

C

Are you using highlight or highlightAuto? highlight

Sample Code to Reproduce

https://jsfiddle.net/gm16s8nf/

// this is a comment, but since I added a slash, \
this is part of it too

Expected behavior

In C, a ‘\’ character extends the current lined (effectively negating the following \n ) Since the second line is also part of the comment, it should be highlighted as such.

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
klmrcommented, Oct 16, 2020

Hmmm. C_LINE_COMMENT_MODE is used in 62 language definitions. As far as I know (might be wrong), no languages other than C and C++ actually support line continuations though. And while rare I don’t think it’s unthinkable that somebody is using \ at the end of their line, e.g. as an ornamental border. I think it would be best if we kept C_LINE_COMMENT_MODE unchanged and used something different for c-like. The name is a bit odd then, but not really; these are C-style line comments, after all.

0reactions
joshgoebelcommented, Oct 16, 2020

HAHAHAHA.

Handling single-line comments only should be sufficient.

Wholly agree - lets fix the reported problem. 😃 The rest is outside scope. Do you have any thoughts on negative impact that might have on other languages using the C rule but NOT fully complying? I’m guessing it would be minimal (or zero impact) and therefore ok to add this to our C_ modes (esp. since that is their name).

Read more comments on GitHub >

github_iconTop Results From Across the Web

c++ - alignas keyword not respected - Stack Overflow
operator new is borken, the compiler knows the alignment requirement but has no way to tell the operator about it. So this is...
Read more >
shortmess+=c not respected by "Pattern not found" #11530
@brammool My use case is that I have a component in my statusline that shows up whenever search for something and shows me...
Read more >
$C([0,1])$ is not complete with respect to $L^1$-norm.
I have a more general question about showing that a normed vector space is not complete with respect to a given norm. We...
Read more >
Do Your Employees Feel Respected?
Earned respect recognizes individuals who display valued qualities or behaviors and acknowledges that each employee has specific strengths and talents.
Read more >
49 CFR § 40.347 - What functions may C/TPAs perform with ...
49 CFR § 40.347 - What functions may C/TPAs perform with respect to ... (2) Employees not covered by DOT agency regulations may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found