Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/tpl-mode fix for multiline comments #45

Closed
GoogleCodeExporter opened this issue Mar 12, 2015 · 4 comments
Closed

contrib/tpl-mode fix for multiline comments #45

GoogleCodeExporter opened this issue Mar 12, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

In tpl-mode.el
http://code.google.com/p/google-ctemplate/source/browse/trunk/contrib/tpl-mode.e
l

There's a TODO for multiline comments,

;; TODO(tonyg) Figure out a way to support multiline comments.
(defconst tpl-mode-comment "\\({{!.*?}}\\)")

The repaired line could read
(defconst tpl-mode-comment "\\({{![^}]?}}\\)")

This is known to work.

See
http://code.google.com/p/hapax2/source/browse/support/emacs/tpl-mode.el

Original issue reported on code.google.com by john.douglas.pritchard on 10 Oct 2009 at 1:20

@GoogleCodeExporter
Copy link
Author

Thanks for the suggestion.  I'll track down tonyg and pass this along.

Original comment by csilv...@gmail.com on 13 Oct 2009 at 1:04

  • Changed state: Started
  • Added labels: Type-Patch, Priority-Medium

@GoogleCodeExporter
Copy link
Author

Hi John,

Thanks for the patch!

I'm assuming you mean "\\({{![^}]*?}}\\)" instead of "\\({{![^}]?}}\\)". Right?

In that case, it looks like this would prevent comments like:

{{! I'm a closing brace "}". }}

But allow comments like:

{{! Line 1
    Line 2 }}

That seems okay, but I wonder if we could allow line breaks without preventing 
closing braces in comments. In some 
regex implementations, [^] matches any character including line breaks (i.e. 
"\\({{![^]*?}}\\)"), but I haven't 
tested that in an emacs mode. Have you tried that?

Tony

Original comment by tonyg@google.com on 14 Oct 2009 at 2:04

@GoogleCodeExporter
Copy link
Author

Hi Tony,

I haven't.  I'm getting by with "\\({{![^}]+?}}\\)".  

John

Original comment by john.douglas.pritchard on 14 Oct 2009 at 5:53

@GoogleCodeExporter
Copy link
Author

I took something similar to the original proposal for ctemplate 0.96, just 
released.
 I agree with Tony's comment it doesn't deal properly with } inside comments, but I
think that's pretty rare, so I'm not worrying about it too much.  I'm happy to 
accept
better regexp's in the future, though. :-)

Original comment by csilv...@gmail.com on 20 Oct 2009 at 5:33

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant