Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^5: Regex to strip comments (out not in)

by BrowserUk (Pope)
on Oct 01, 2012 at 18:20 UTC ( #996708=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Regex to strip comments (out not in)
in thread Regex to strip comments

I tried to be quite polite.

Such a shame. You try sooo hard -- and yet still somehow always fail.

I am not surprised that you found it so very hard to admit to even a simple mistake

And it comes as no surprise to me that you would try to bluff, bluster and bore your way around that limited imagination with which you view the world, and which you try to impose on others.

Here is a C file that compiles clean:

C:\test>type junk.c char x[] = "/* comment */"; int n = 1; C:\test>cl /Wall -c junk.c Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64 Copyright (C) Microsoft Corporation. All rights reserved. junk.c

And here it is with a part of it commented out:

C:\test>type junk.c /* char x[] = "/* comment */"; */ int n = 1; C:\test>cl /Wall -c junk.c Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64 Copyright (C) Microsoft Corporation. All rights reserved. junk.c junk.c(2) : error C2001: newline in constant junk.c(2) : error C2059: syntax error : 'string' junk.c(3) : warning C4138: '*/' found outside of comment

Just because the C designers made that mistake, it doesn't mean everyone has to. Maybe there is a language out there that allows a block comment to span an arbitrary chunk of valid code without breaking. Maybe, its even closer to you than you think.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


Comment on Re^5: Regex to strip comments (out not in)
Select or Download Code
Re^6: Regex to strip comments (out not in)
by tye (Cardinal) on Oct 01, 2012 at 19:18 UTC

    Too bad you were still unable to even make the claim (with a straight face) that there might be a language that parses string literals only inside of block comments. Nice distraction, though.

    You claim that I imagine something that the user didn't explicitly state, so you call my genetic heritage into question. You claim I don't imagine such, so you tell stories about how you imagine that I view the world.

    I hope you are having a pleasant day. Thanks for the minor entertainment.

    - tye        

      You know, I get the feeling that you think there is a valid point in there somewhere, but as usual, it is conceal in so much verbiage and vitriol, its impossible to know if it is actually in your posts, or only in your head.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996708]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-09-15 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls