~ubuntu-branches/ubuntu/trusty/kate/trusty

« back to all changes in this revision

Viewing changes to part/script/data/indentation/cppstyle.js

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-12-18 16:28:23 UTC
  • mfrom: (1.1.38)
  • Revision ID: package-import@ubuntu.com-20131218162823-nea1os5bnvlya9km
Tags: 4:4.12.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * name: C++/boost Style
3
3
 * license: LGPL
4
4
 * author: Alex Turbov <i.zaufi@gmail.com>
5
 
 * revision: 10
 
5
 * revision: 21
6
6
 * kate-version: 3.4
7
7
 * priority: 10
8
8
 * indent-languages: C++11, C++11/Qt4
55
55
// ';' is for align `for' parts
56
56
// ' ' is to add a '()' after `if', `while', `for', ...
57
57
// TBD <others>
58
 
triggerCharacters = "{}()[]<>/:;,#\\?!|&/%.@ \"=*^";
 
58
triggerCharacters = "{}()[]<>/:;,#\\?!|&/%.@ '\"=*^";
59
59
 
60
60
var debugMode = false;
61
61
 
125
125
    return text.rtrim();
126
126
}
127
127
 
 
128
/// Return \c true if attribute at given position is a \e Comment
 
129
function isComment(line, column)
 
130
{
 
131
    // Check if we are not withing a string or a comment
 
132
    var c = new Cursor(line, column);
 
133
    var mode = document.attributeName(c);
 
134
    dbg("isComment: Check mode @ " + c + ": " + mode);
 
135
    return gMode == "Doxygen" || document.isComment(c);
 
136
}
 
137
 
 
138
/// Return \c true if attribute at given position is a \e String
 
139
function isString(line, column)
 
140
{
 
141
    // Check if we are not withing a string or a comment
 
142
    var c = new Cursor(line, column);
 
143
    var mode = document.attributeName(c);
 
144
    dbg("isString: Check mode @ " + c + ": " + mode);
 
145
    return document.isString(c) || document.isChar(c);
 
146
}
 
147
 
128
148
/// Return \c true if attribute at given position is a \e String or \e Comment
129
149
function isStringOrComment(line, column)
130
150
{
131
 
    // Check if we are not withning a string or a comment
 
151
    // Check if we are not withing a string or a comment
132
152
    var c = new Cursor(line, column);
133
153
    var mode = document.attributeName(c);
134
154
    dbg("isStringOrComment: Check mode @ " + c + ": " + mode);
135
155
    return gMode == "Doxygen" || document.isString(c) || document.isChar(c) || document.isComment(c);
136
156
}
137
157
 
 
158
function tryIndentRelativePrevLine(line)
 
159
{
 
160
    var current_line = line - 1;
 
161
    while (0 <= current_line && isStringOrComment(current_line, document.firstColumn(current_line)))
 
162
        --current_line;
 
163
    if (current_line == -1)
 
164
        return -2;
 
165
 
 
166
    var prevLineFirstChar = document.firstChar(current_line);
 
167
    var needHalfUnindent = !(
 
168
        prevLineFirstChar == ','
 
169
      || prevLineFirstChar == ':'
 
170
      || prevLineFirstChar == '?'
 
171
      || prevLineFirstChar == '<'
 
172
      || prevLineFirstChar == '>'
 
173
      || prevLineFirstChar == '&'
 
174
      );
 
175
    return document.firstColumn(current_line) - (needHalfUnindent ? 2 : 0);
 
176
}
 
177
 
138
178
/// Try to (re)align (to 60th position) inline comment if present
139
179
function alignInlineComment(line)
140
180
{
141
 
    document.editBegin();
142
181
    // Check is there any comment on the current line
143
182
    var currentLineText = document.line(line);
144
183
    var sc = splitByComment(currentLineText);
174
213
            document.insertText(line, 0, currentLineText);
175
214
        }
176
215
    }
177
 
    document.editEnd();
 
216
}
 
217
 
 
218
/**
 
219
 * Check if a character right before cursor is the very first on the line
 
220
 * and the same as a given one.
 
221
 */
 
222
function justEnteredCharIsFirstOnLine(line, column, char)
 
223
{
 
224
    return document.firstChar(line) == char && document.firstColumn(line) == (column - 1);
178
225
}
179
226
 
180
227
/**
189
236
    if (document.line(line - 1).trim().length == 0)
190
237
        return;
191
238
 
192
 
    document.editBegin();
193
 
 
194
239
    // Check is there any comment on the current line
195
240
    var currentLineText = document.line(line);
196
241
    var sc = splitByComment(currentLineText);
229
274
              );
230
275
        }
231
276
    }
232
 
    document.editEnd();
233
277
}
234
278
 
235
279
/**
279
323
    {
280
324
        var currentIndentation = document.firstVirtualColumn(line - 1);
281
325
        result = currentIndentation + gIndentWidth;
282
 
        document.editBegin();
283
326
        document.insertText(line, document.firstColumn(line), "\n");
284
327
        document.indent(new Range(line + 1, 0, line + 1, 1), currentIndentation / gIndentWidth);
285
328
        // Add half-tab (2 spaces) if matched not a curve bracket or
287
330
        var isOpenCharTheOnlyOnLine = (document.firstColumn(line - 1) == firstCharPos);
288
331
        if (!(isCurveBracketsMatched || isOpenCharTheOnlyOnLine))
289
332
            document.insertText(line + 1, document.firstColumn(line + 1), "  ");
290
 
        document.editEnd();
291
333
        view.setCursorPosition(line, result);
292
334
    }
293
335
    if (result != -1)
399
441
function tryMultilineCommentStart_ch(line)
400
442
{
401
443
    var result = -1;
402
 
    document.editBegin();
403
444
 
404
445
    // Check if multiline comment was started on the line
405
446
    // and ENTER wan't pressed right after a /*C-style comment*/
440
481
    {
441
482
        dbg("tryMultilineCommentStart_ch result="+result);
442
483
    }
443
 
    document.editEnd();
444
484
    return result;
445
485
}
446
486
 
888
928
    if (document.isString(line, column))
889
929
        return;
890
930
 
891
 
    document.editBegin();
892
 
 
893
931
    var sc = splitByComment(document.line(line));
894
932
    if (sc.hasComment)                                      // Is there any comment on a line?
895
933
    {
928
966
            document.insertText(line, column, ' ');
929
967
        }
930
968
    }
931
 
    document.editEnd();
932
969
}
933
970
 
934
971
/**
938
975
 * \li user entered <em>"template &gt;</em>
939
976
 * \li user entered smth like <em>std::map&gt;</em>
940
977
 * \li user wants to output smth to C++ I/O stream by typing <em>&gt;&gt;</em>
 
978
 *     possible at the line start, so it must be half indented
941
979
 * \li shortcut: <tt>some(<|)</tt> transformed into <tt>some()<|</tt>
942
980
 *
943
981
 * But, do not add '>' if there some text after cursor.
946
984
{
947
985
    var line = cursor.line;
948
986
    var column = cursor.column;
 
987
    var result = -2;
949
988
 
950
989
    if (isStringOrComment(line, column))
951
 
        return;                                             // Do nothing for comments and strings
952
 
 
953
 
    document.editBegin();
 
990
        return result;                                      // Do nothing for comments and strings
954
991
 
955
992
    // Check for 'template' keyword at line start
956
993
    var currentString = document.line(line);
968
1005
        document.insertText(cursor, ">");
969
1006
        view.setCursorPosition(cursor);
970
1007
    }
 
1008
    else if (justEnteredCharIsFirstOnLine(line, column, '<'))
 
1009
    {
 
1010
        result = tryIndentRelativePrevLine(line);
 
1011
    }
971
1012
    // Add a space after 2nd '<' if a word before is not a 'operator'
972
1013
    else if (document.charAt(line, column - 2) == '<')
973
1014
    {
997
1038
        cursor = tryJumpOverParenthesis(cursor);            // Try to jump out of parenthesis
998
1039
        tryAddSpaceAfterClosedBracket(cursor);
999
1040
    }
1000
 
    document.editEnd();
 
1041
    return result;
1001
1042
}
1002
1043
 
1003
1044
/**
1049
1090
        switch (c)
1050
1091
        {
1051
1092
            case '.':
 
1093
                if (pc == '(' && cc == ')')
 
1094
                {
 
1095
                    // Make sure this is not a `catch (...)`
 
1096
                    if (document.startsWith(line, "catch (.)", true))
 
1097
                    {
 
1098
                        document.insertText(line, column, "..");
 
1099
                        view.setCursorPosition(line, column + 3);
 
1100
                        break;
 
1101
                    }
 
1102
                }
1052
1103
            case ',':
1053
1104
            case '?':
1054
1105
            case ':':
1150
1201
    var line = cursor.line;
1151
1202
    var column = cursor.column;
1152
1203
    // Check is comma a very first character on a line...
1153
 
    if (document.firstChar(line) == ',' && document.firstColumn(line) == (column - 1))
1154
 
    {
1155
 
        var prevLineFirstChar = document.firstChar(line - 1);
1156
 
        var mustMove = !(prevLineFirstChar == ',' || prevLineFirstChar == ':');
1157
 
        result = document.firstColumn(line - 1) - (mustMove ? 2 : 0);
1158
 
    }
1159
 
    document.editBegin();
 
1204
    if (justEnteredCharIsFirstOnLine(line, column, ','))
 
1205
        result = tryIndentRelativePrevLine(line);
 
1206
 
1160
1207
    cursor = tryJumpOverParenthesis(cursor);                // Try to jump out of parenthesis
1161
1208
    if (document.charAt(cursor) != ' ')
1162
1209
        document.insertText(cursor, " ");                   // Add space only if not present
1163
1210
    else
1164
 
        view.setCursorPosition(line, column + 2);           // Otherwise just move cursor after it
1165
 
    document.editEnd();
 
1211
        view.setCursorPosition(line, column + 1);           // Otherwise just move cursor after it
1166
1212
    return result;
1167
1213
}
1168
1214
 
1234
1280
    if (isStringOrComment(line, column))
1235
1281
        return result;                                      // Do nothing for comments and strings
1236
1282
 
1237
 
    document.editBegin();
1238
 
 
1239
1283
    // If ';' is a first char on a line?
1240
 
    if (document.firstChar(line) == ';' && document.firstColumn(line) == (column - 1))
 
1284
    if (justEnteredCharIsFirstOnLine(line, column, ';'))
1241
1285
    {
1242
1286
        // Check if we are inside a `for' statement
1243
1287
        var openBracePos = document.anchor(line, column, '(');
1300
1344
            }
1301
1345
        }
1302
1346
    }
1303
 
    document.editEnd();
1304
1347
    return result;
1305
1348
}
1306
1349
 
1309
1352
 *
1310
1353
 * \c ?, \c |, \c ^, \c %, \c .
1311
1354
 *
1312
 
 * Add spaces around trenary operator.
 
1355
 * Add spaces around ternary operator.
1313
1356
 */
1314
1357
function tryOperator(cursor, ch)
1315
1358
{
1320
1363
    if (isStringOrComment(line, column))
1321
1364
        return result;                                      // Do nothing for comments and strings
1322
1365
 
1323
 
    var isFirstChar = document.firstChar(line) == ch
1324
 
      && document.firstColumn(line) == (column - 1)
1325
 
      ;
1326
 
    var halfTabNeeded = isFirstChar
 
1366
    var halfTabNeeded = justEnteredCharIsFirstOnLine(line, column, ch)
1327
1367
      && document.line(line - 1).search(/^\s*[A-Za-z_][A-Za-z0-9_]*/) != -1
1328
1368
      ;
1329
1369
    dbg("tryOperator: halfTabNeeded=",halfTabNeeded);
1337
1377
        dbg("tryOperator: insideBraces=",insideBraces);
1338
1378
        result = document.firstColumn(line - 1) + (insideBraces && ch != '.' ? -2 : 2);
1339
1379
    }
1340
 
    document.editBegin();
1341
1380
    var prev = cursor;
1342
1381
    cursor = tryJumpOverParenthesis(cursor);                // Try to jump out of parenthesis
1343
1382
    cursor = tryAddSpaceAfterClosedBracket(cursor);
1375
1414
        if (space_offset != -1)
1376
1415
            addCharOrJumpOverIt(line, column + space_offset, ' ');
1377
1416
    }
1378
 
    document.editEnd();
1379
1417
    if (result != -2)
1380
1418
    {
1381
1419
        dbg("tryOperator result="+result);
1402
1440
 
1403
1441
    // Check if a given closing brace is a first char on a line
1404
1442
    // (i.e. it is 'dangling' brace)...
1405
 
    if (document.firstChar(line) == ch && document.firstColumn(line) == (column - 1) && braceCursor.isValid())
 
1443
    if (justEnteredCharIsFirstOnLine(line, column, ch) && braceCursor.isValid())
1406
1444
    {
1407
1445
        // Move to one half-TAB right, if anything but not closing '}', else
1408
1446
        // align to the corresponding open char
1410
1448
        dbg("tryCloseBracket: setting result="+result);
1411
1449
    }
1412
1450
 
1413
 
    document.editBegin();
1414
 
 
1415
1451
    // Check if ';' required after closing '}'
1416
1452
    if (ch == '}' && braceCursor.isValid())
1417
1453
    {
1469
1505
 
1470
1506
    tryJumpOverParenthesis(view.cursorPosition());
1471
1507
 
1472
 
    document.editEnd();
1473
1508
    return result;
1474
1509
}
1475
1510
 
1495
1530
    if (isStringOrComment(line, column - 2))
1496
1531
        return result;
1497
1532
 
1498
 
    if (document.firstColumn(line) == (column - 1) && document.firstChar(line) == '{')
 
1533
    if (justEnteredCharIsFirstOnLine(line, column, '{'))
1499
1534
    {
1500
1535
        // Check for a dangling close brace on a previous line
1501
1536
        // (this may mean that `for' or `if' or `while' w/ looong parameters list on it)
1546
1581
    var column = cursor.column;
1547
1582
 
1548
1583
    // Check if just entered '#' is a first on a line
1549
 
    if (document.firstChar(line) == '#' && document.firstColumn(line) == (column - 1))
 
1584
    if (justEnteredCharIsFirstOnLine(line, column, '#'))
1550
1585
    {
1551
1586
        // Get current indentation level
1552
1587
        var currentLevel = getPreprocessorLevelAt(line);
1581
1616
    var line = cursor.line;
1582
1617
    var column = cursor.column;
1583
1618
 
1584
 
    document.editBegin();
1585
 
 
1586
1619
    // Check if just entered ':' is a first on a line
1587
 
    if (document.firstChar(line) == ':' && document.firstColumn(line) == (column - 1))
 
1620
    if (justEnteredCharIsFirstOnLine(line, column, ':'))
1588
1621
    {
1589
1622
        // Check if there a dangling ')' or '?' (ternary operator) on a previous line
1590
1623
        var ch = document.firstChar(line - 1);
1643
1676
            tryAddSpaceAfterClosedBracket(cursor);          // Try add a space after close bracket
1644
1677
        }
1645
1678
    }
1646
 
    document.editEnd();
1647
1679
    return result;
1648
1680
}
1649
1681
 
1726
1758
        dbg("maxLength:",result.max);
1727
1759
        // Iterate over macro definition, strip backslash
1728
1760
        // and add a padding string up to result.max length + backslash
1729
 
        document.editBegin();
1730
1761
        for (var i = result.range.start.line; i < result.range.end.line; ++i)
1731
1762
        {
1732
1763
            var currentLineText = document.line(i);
1736
1767
            document.removeText(i, textLength, i, originalTextLength);
1737
1768
            document.insertText(i, textLength, String().fill(' ', result.max - textLength + 1) + "\\");
1738
1769
        }
1739
 
        document.editEnd();
1740
1770
    }
1741
1771
}
1742
1772
 
1757
1787
      ;
1758
1788
    if (looks_like_doxgorup)
1759
1789
    {
1760
 
        document.editBegin();
1761
1790
        document.removeText(line, column - 2, line, column - 1);
1762
1791
        var padding = String().fill(' ', firstColumn);
1763
1792
        document.insertText(line, column - 1, "{\n" + padding + "\n" + padding + "//@}");
1764
1793
        view.setCursorPosition(line + 1, document.lineLength(line + 1));
1765
 
        document.editEnd();
1766
1794
    }
1767
1795
}
1768
1796
 
1773
1801
 * the next one (after \c '"') is not an alphanumeric,
1774
1802
 * then add a delimiters.
1775
1803
 *
1776
 
 * \attention If autobrace plugin used to add quotation marks,
1777
 
 * then next symbol after the current will be another one \c '"'
1778
 
 * if this is a new string. Otherwise, if it turned OFF, the simplest
1779
 
 * case we can detect (and the most typical), is that raw string started
1780
 
 * at fresh line, and current \c column equal to the line length.
 
1804
 * \attention Effect of AutoBrace extension has already neutralized at this point :)
1781
1805
 */
1782
 
function tryRawStringLiteral(cursor)
 
1806
function tryStringLiteral(cursor, ch)
1783
1807
{
1784
1808
    var line = cursor.line;
1785
1809
    var column = cursor.column;
1786
 
    var is_abp_on = document.charAt(line, column) == '"';
1787
 
    var start_raw_string = 2 <= column
1788
 
      && document.charAt(line, column - 2) == 'R'
1789
 
      && (
1790
 
          is_abp_on                                         // Autobracket plugin On?
1791
 
        || column == (document.lineLength(line))            // Autobracket plugin Off? (and end of line)
1792
 
        );
1793
 
    if (start_raw_string)
 
1810
 
 
1811
    if (isComment(line, column - 2))                        // Do nothing for comments
 
1812
        return;
 
1813
 
 
1814
    // First of all we have to determinate where we are:
 
1815
    // 0) new string literal just started, or ...
 
1816
    // 1) string literal just ends
 
1817
 
 
1818
    // Check if the '"' is a very first char on a line
 
1819
    var new_string_just_started;
 
1820
    if (column < 2)
 
1821
        // Yes, then we have to look to the last char of the previous line
 
1822
        new_string_just_started = !(line != 0 && isString(line - 1, document.lastColumn(line - 1)));
 
1823
    else
 
1824
        // Ok, just check attribute of the char right before '"'
 
1825
        new_string_just_started = !isString(line, column - 2);
 
1826
 
 
1827
    //
 
1828
    if (new_string_just_started)
1794
1829
    {
1795
 
        document.editBegin();
1796
 
        /// \todo Make delimiter configurable... HOW?
1797
 
        /// It would be nice if indenters can have a configuration page somehow...
1798
 
        document.insertText(cursor, "~()~");
1799
 
        if (!is_abp_on)
1800
 
            document.insertText(line, column + 4, '"');
1801
 
        view.setCursorPosition(line, column + 2);
1802
 
        document.editEnd();
 
1830
        // Is there anything after just entered '"'?
 
1831
        var nc = document.charAt(line, column);
 
1832
        var need_closing_quote = column == document.lineLength(line)
 
1833
          || document.isSpace(nc)
 
1834
          || nc == ','                                      // user tries to add new string param,
 
1835
          || nc == ')'                                      // ... or one more param to the end of some call
 
1836
          || nc == ']'                                      // ... or string literal as subscript index
 
1837
          || nc == ';'                                      // ... or one more string before end of expression
 
1838
          || nc == '<'                                      // ... or `some << "|<<`
 
1839
          ;
 
1840
        if (need_closing_quote)
 
1841
        {
 
1842
            // Check for 'R' right before '"'
 
1843
            if (ch == '"' && document.charAt(line, column - 2) == 'R')
 
1844
            {
 
1845
                // Yeah, looks like a raw string literal
 
1846
                /// \todo Make delimiter configurable... HOW?
 
1847
                /// It would be nice if indenters can have a configuration page somehow...
 
1848
                document.insertText(cursor, "~()~\"");
 
1849
                view.setCursorPosition(line, column + 2);
 
1850
            }
 
1851
            else
 
1852
            {
 
1853
                document.insertText(cursor, ch);
 
1854
                view.setCursorPosition(line, column);
 
1855
            }
 
1856
        }
1803
1857
    }
1804
1858
}
1805
1859
 
1872
1926
      || text == "switch "
1873
1927
      || text == "catch "
1874
1928
      ;
1875
 
    document.editBegin();
1876
1929
    if (need_brackets)
1877
1930
    {
1878
1931
        document.insertText(cursor, "()");
1888
1941
        document.removeText(line, column, line, column + 1);
1889
1942
        document.insertText(line, column - 2, " ");
1890
1943
    }
1891
 
    document.editEnd();
1892
1944
}
1893
1945
 
1894
1946
/**
1899
1951
{
1900
1952
    // Make sure there is a space at given position
1901
1953
    dbg("addCharOrJumpOverIt: checking @Cursor("+line+","+column+"), c='"+document.charAt(line, column)+"'");
1902
 
    if (column < document.lineLength(line) || document.charAt(line, column) != char)
 
1954
    if (document.lineLength(line) <= column || document.charAt(line, column) != char)
1903
1955
        document.insertText(line, column, char);
1904
1956
    view.setCursorPosition(line, column + 1);
1905
1957
}
1919
1971
    var c = document.charAt(line, column - 2);
1920
1972
    dbg("tryEqualOperator: checking @Cursor("+line+","+(column - 2)+"), c='"+c+"'");
1921
1973
 
1922
 
    document.editBegin();
1923
1974
    switch (c)
1924
1975
    {
1925
1976
        // Two chars operators: !=, ==
1946
1997
            document.insertText(line, column - 1, " ");
1947
1998
            break;
1948
1999
        case '<':
 
2000
            // Shortcut: transfrom "some<=|>" -> "some <= |"
1949
2001
            if (document.charAt(cursor) == '>')
1950
2002
                document.removeText(line, column, line, column + 1);
1951
2003
        case '>':
2003
2055
                    {
2004
2056
                        if (document.charAt(line, column - 4) == c)
2005
2057
                            space_offset = 2;
2006
 
                        else
 
2058
                        else if (document.charAt(line, column - 4) != ' ')
2007
2059
                            space_offset = 1;
2008
2060
                    }
2009
2061
                }
2010
 
                else space_offset = 2;
 
2062
                else if (document.charAt(line, column - 3) != ' ')
 
2063
                    space_offset = 2;
2011
2064
            }
2012
2065
            if (space_offset != -1)
2013
2066
                document.insertText(line, column - space_offset, " ");
2019
2072
            document.insertText(line, column - 1, " ");     // Make sure there is a space before it!
2020
2073
            break;
2021
2074
    }
2022
 
    document.editEnd();
2023
2075
}
2024
2076
 
2025
2077
/**
2027
2079
 *
2028
2080
 * NOTE Cursor positioned right after just entered character and has +1 in column.
2029
2081
 *
 
2082
 * \attention This function will roll back the effect of \b AutoBrace extension
 
2083
 * for quote chars. So this indenter can handle that chars withing predictable
 
2084
 * surround...
 
2085
 *
2030
2086
 */
2031
2087
function processChar(line, ch)
2032
2088
{
2042
2098
        return result;
2043
2099
    }
2044
2100
 
 
2101
    document.editBegin();
 
2102
    // Check if char under cursor is the same as just entered,
 
2103
    // and if so, remove it... to make it behave like "overwrite" mode
 
2104
    if (ch != ' ' && document.charAt(cursor) == ch)
 
2105
        document.removeText(line, cursor.column, line, cursor.column + 1);
 
2106
 
2045
2107
    switch (ch)
2046
2108
    {
2047
2109
        case '\n':
2051
2113
            trySameLineComment(cursor);                     // Possible user wants to start a comment
2052
2114
            break;
2053
2115
        case '<':
2054
 
            tryTemplate(cursor);                            // Possible need to add closing '>' after template
 
2116
            result = tryTemplate(cursor);                   // Possible need to add closing '>' after template
2055
2117
            break;
2056
2118
        case ',':
2057
2119
            result = tryComma(cursor);                      // Possible need to align parameters list
2091
2153
            tryDoxygenGrouping(cursor);
2092
2154
            break;
2093
2155
        case '"':
2094
 
            tryRawStringLiteral(cursor);
 
2156
        case '\'':
 
2157
            tryStringLiteral(cursor, ch);
2095
2158
            break;
2096
2159
        case '!':                                           // Almost all the time there should be a space before!
2097
2160
            tryExclamation(cursor);
2109
2172
        default:
2110
2173
            break;                                          // Nothing to do...
2111
2174
    }
2112
 
 
 
2175
    document.editEnd();
2113
2176
    return result;
2114
2177
}
2115
2178
 
2122
2185
 
2123
2186
/**
2124
2187
 * Try to find a next non comment line assuming that a given
2125
 
 * one is a start or middle of a multiline comment.
 
2188
 * one is a start or middle of a multi-line comment.
2126
2189
 *
2127
2190
 * \attention This function would ignore anything else than
2128
2191
 * a simple comments like this one... I.e. if \b right after