notepad-plus-plus/lexilla/test/examples/cpp/x.cxx.folded

81 lines
2.2 KiB
Plaintext
Raw Normal View History

0 400 400 // A demonstration program
0 400 400 #include <stdio.h>
2 400 401 + #if 0 /* */
0 401 401 | #define DUMMY() \
0 401 401 | if (1);
0 401 400 | #endif
1 400 400
0 400 400 // Test preprocessor expressions with parentheses
2 400 401 + #if ((0))
0 401 401 | a
0 401 401 | #elif ((1))
0 401 401 | b
0 401 400 | #endif
1 400 400
2 400 401 + /** @file LexCPP.cxx
0 401 401 | <file>
0 401 401 | <file >filename</file>
0 401 401 | LexCPP.cxx.
0 401 401 | </file>
0 401 400 | **/
1 400 400
2 400 401 + /** Unknown doc keywords so in SCE_C_COMMENTDOCKEYWORDERROR:
0 401 401 | @wrong LexCPP.cxx
0 401 401 | <wrong>filename</wrong>
0 401 400 | **/
1 400 400
0 400 400 #define M\
1 400 400
0 400 400 \
1 400 400
Update to scintilla 5.5.0 & Lexilla 5.3.2 Sintilla Release 5.5.0 (https://www.scintilla.org/scintilla550.zip) Released 23 April 2024. Add elements for inactive additional selections SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT and SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK. When not set these default to SC_ELEMENT_SELECTION_INACTIVE_TEXT and SC_ELEMENT_SELECTION_INACTIVE_BACK. Bug #2417. On Cocoa, avoid use of NSUserDefaults which will soon require justification when used in applications on the App Store. Fix Win32 IME crash in windowed mode. Bug #2433. Scale reverse arrow cursor for margins to match other cursors when user changes pointer size. Bug #2321. Lexilla Release 5.3.2 (https://www.scintilla.org/lexilla532.zip) Released 23 April 2024. COBOL: Stop string literal continuing over line end. Issue #229. COBOL: Stop doc comment assigning different styles to \r and \n at line end. Issue #229. COBOL: Recognize keywords that start with 'V'. Issue #230. COBOL: Recognize comments after tag or that start with '/'. Issue #231. HTML: Implement substyles for tags, attributes, and identifiers SCE_H_TAG, SCE_H_ATTRIBUTE, SCE_HJ_WORD, SCE_HJA_WORD, SCE_HB_WORD, SCE_HP_WORD, SCE_HPHP_WORD. HTML: Implement context-sensitive attributes. "tag.attribute" matches "attribute" only inside "tag". HTML: Match standard handling of comments. Issue #232. Lua: Implement substyles for identifiers SCE_LUA_IDENTIFIER. Ruby: Allow non-ASCII here-doc delimiters. Issue #234. Ruby: Allow modifier if, unless, while and until after heredoc delimiter. Issue #236. Rust: Recognize raw identifiers. Issue #239, Pull request #240. Close #15042
2024-04-24 16:45:59 +00:00
1 400 400
0 400 400 // Test preprocessor active branches feature
1 400 400
2 400 401 + #if HAVE_COLOUR
0 401 401 | // Active
0 401 400 | #endif
2 400 401 + #if NOT_HAVE_COLOUR
0 401 401 | // Inactive
0 401 400 | #endif
1 400 400
2 400 401 + #if FEATURE==2
0 401 401 | // Active
0 401 400 | #endif
2 400 401 + #if FEATURE==3
0 401 401 | // Inactive
0 401 400 | #endif
1 400 400
2 400 401 + #if VERSION(1,2)==3
0 401 401 | // Active
0 401 400 | #endif
2 400 401 + #if VERSION(1,2)==4
0 401 401 | // Inactive
0 401 400 | #endif
1 400 400
0 400 400 #undef HAVE_COLOUR
2 400 401 + #if HAVE_COLOUR
0 401 401 | // Inactive
0 401 400 | #endif
1 400 400
0 400 400 #define MULTIPLY(a,b) a*b
2 400 401 + #if MULTIPLY(2,3)==6
0 401 401 | // Active
0 401 400 | #endif
1 400 400
2 400 401 + int main() {
0 401 401 | double x[] = {3.14159,6.02e23,1.6e-19,1.0+1};
0 401 401 | int y[] = {75,0113,0x4b};
0 401 401 | printf("hello world %d %g\n", y[0], x[0]);
1 401 401 |
0 401 401 | // JavaScript regular expression (14) tests
0 401 401 | let a = /a/;
0 401 401 | let b = /[a-z]+/gi;
1 401 401 |
0 401 401 | // Escape sequence (27) tests
0 401 401 | printf("\'\"\?\\\a\b\f\n\r\t\v \P");
0 401 401 | printf("\0a \013a \019");
0 401 401 | printf("\x013ac \xdz");
0 401 401 | printf("\ua34df \uz");
0 401 401 | printf("\Ua34df7833 \Uz");
0 401 400 | }
1 400 400