What is this {}{/} curly brace syntax? - syntax

I have inherited Excel files where some of the cell content looks like this:
{MY}Jan 2022{/MY} {TY}Webcast{/TY}
What is this syntax, and are there programming languages to handle it? It looks like xml except that it uses curly braces instead of angle brackets.

Related

Format document" in Visual Studio to insert braces around single-statement blocks for C++

Is there a way to "Format document" in Visual Studio 2015 to insert braces around single-statement blocks for C++ code?
For example this:
if (x)
y();
should become something like:
if (x)
{
y();
}
The auto formatting seems to deal with indentation, but not this brace insertion. Is there a way to do it?
I looked into this a while back, the only formatter I found that looked like it would perform anything like this is the "Artistic Style" formatter:
http://astyle.sourceforge.net/astyle.html
The --add-braces option looks as though it would perform what you need, coupled with the --style=allman option.
You can use clang-format to style your code as you want.
To add curly brackets you can set InsertBraces property as true.
For brackets style you can set BreakBeforeBraces property as:
BS_Attach
BS_Linux
BS_Mozilla
BS_Stroustrup
BS_Allman
BS_Whitesmiths
BS_GNU
BS_WebKit
BS_Custom
Source: https://clang.llvm.org/docs/ClangFormatStyleOptions.html

How can I use Rubymine to automatically convert a ruby block from curly braced style to begin..end style and vice versa?

I'm using Rubymine and wondering, how can I convert a block from curly braced notation to begin..end and vice versa?
for example
loop do
end
to
loop {}
To toggle between do..end blocks and {``} blocks, place your cursor on the do (or open bracket) and press Alt + Enter. You see the option to toggle.

Sublime Text 2 operator highlighting

Just wondering how I could add operator highlighting in Sublime Text 2. None of the default themes highlight operators and the tmLanguage file for Monokai doesn't seem to have any option for operators either. Can anyone tell me how this can be done? Thanks.
I don't think the highlighting can be done i general. However, this can be done for specific syntaxes by creating (or editing) .tmLanguage files (references can be found in this answer: https://stackoverflow.com/a/11288058/4207760).
For instance by adding =| to the (regex) match key in the standard C.tmLanguage file:
<key>match</key>
<string>\b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\b</string>
this becomes:
<key>match</key>
<string>\b(=|break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\b</string>
and all equality signs (=) are now highlighted pretty much like "if", "else", "for" etc.

Notepad++ Custom Language Highlighting

I have a specific language (its private, and closed source) that I'm writing code highlighting for in Notepad++. I've never done anything like this before... so, for the most part, I'm clueless.
There are a bunch of keywords, and I've figured out how to implement those, but the strings are denoted by square brackets ([ and ]) instead of normal quotes. How do I register those as strings in the XML file?
Another thing, the language relies heavily on recursion and nesting; is there some way to say "Level 1 of the square brackets is this color, level 2 is this color, etc..."?
There's a useful help page that explains how to use the GUI to define a custom language for Notepad++. As Alex K noted in a comment above, the option for setting string delimiters appears to be in the Delimiters boxes in the Operators tab. It doesn't look like it supports different colours for different levels of nesting, though.
Update for those who have been asking the same question:
(Temporary) Documentation for custom syntax highlighting is on: http://udl20.weebly.com/index.html
There is a link to this in Notepad++ but it doesn't stand out.
I had log4net files that I wanted to view in Notepad++. They contained lines like:
2015-06-03 16:38:10,751 [Compname][Thread:29][FATAL]
To highlight [FATAL] just the keyword list wasn't enough. I added this:
On tabpage "Folder & Default" > Folding in code style 1: >
Open: [
Close: ]
On tabpage "Keyword lists" > 1ste group > FATAL with some styling.

Highlighting delimiters without spaces before parentheses in user defined language

I have a problem with custom syntax highlighting in Notepad++.
I want to display text in parentheses in a different color. In View → User Define Dialogue I've defined a custom language and set up corresponding delimiters, "(" and ")".
However, the problem is that Notepad++ is highlighting the text between parentheses only when there is a space before the left parenthesis. So for example, in ^reg(ular)?$ (ular) is not highlighted, but in ^reg (ular)$ it is.
Is there a way to force Notepad++ to recognize delimiters without the space before parentheses?
If you add open parenthesis, "(", to the list of activated operators in the User Define [sic] Language, then the content will be highlighted between the opening and closing parentheses (which you set as the delimiters).
add ( and ) in Operators 1 es better, then if you select ) in the source, the ( is hightlighted

Resources