Ande Turner
Ande Turner

Reputation: 7212

Java: Triple Curly Bracing

I've been given some code with commenting unlike anything I've come across before:

//{{{ Imports
import imports;
//}}}

It is the same for each method block,

//{{{ above the code block  
//}}} below the code block

Also see: http://en.wikipedia.org/wiki/Folding_editor

Upvotes: 3

Views: 1119

Answers (5)

Aleksandar Dimitrov
Aleksandar Dimitrov

Reputation: 9487

Actually, Vim uses those triple braces in comments, too.

Tell the one you got the code from, that folding this way is a bad idea. Vim can set fold points at syntactic folding hints, defined in the highlighting file.

Upvotes: 1

Scott Stanchfield
Scott Stanchfield

Reputation: 30652

It may also be for some code generators. Some generators allow you to edit generated code, and use markers like that so the generator knows where it can regenerate.

Upvotes: 1

Matt
Matt

Reputation: 32302

jEdit uses {{{ and }}} to mark "explicit" folds.

Upvotes: 4

aib
aib

Reputation: 47001

A quick search for "triple curly" comment suggests it's "Emacs folding mode".

Or some other code folding marker in any case.

Upvotes: 8

Glitch
Glitch

Reputation: 2785

Maybe it's to emphasize a code block?

shrugs

Upvotes: -2

Related Questions