You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
notepad-plus-plus/lexilla/test/examples/cpp/x.cxx.styled

88 lines
2.1 KiB

{2}#!/usr/bin/env node
{0}
{2}// A demonstration program
{9}#include <stdio.h>
#if 0 {23}/* */{9}
{73}#define DUMMY() \
if (1);
{9}#endif
{0}
{2}// Test preprocessor expressions with parentheses
{9}#if ((0))
{75}a{64}
{9}#elif ((1))
{11}b{0}
{9}#endif
{0}
{3}/** {17}@file{3} LexCPP.cxx
<{17}file{3}>
<{17}file{3} >filename</{17}file{3}>
LexCPP.cxx.
</{17}file{3}>
**/{0}
{3}/** Unknown doc keywords so in SCE_C_COMMENTDOCKEYWORDERROR:
{18}@wrong{3} LexCPP.cxx
<{18}wrong{3}>filename</{18}wrong{3}>
Next line should not start a keyword but before 5.4.1 did and caused bad styling or a crash depending on range lexed
<
**/{0}
{9}#define M\
{0}\
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
7 months ago
{2}// Test preprocessor active branches feature
{0}
{9}#if HAVE_COLOUR
{2}// Active
{9}#endif
#if NOT_HAVE_COLOUR
{66}// Inactive
{9}#endif
{0}
{9}#if FEATURE==2
{2}// Active
{9}#endif
#if FEATURE==3
{66}// Inactive
{9}#endif
{0}
{9}#if VERSION(1,2)==3
{2}// Active
{9}#endif
#if VERSION(1,2)==4
{66}// Inactive
{9}#endif
{0}
{9}#undef HAVE_COLOUR
#if HAVE_COLOUR
{66}// Inactive
{9}#endif
{0}
{9}#define MULTIPLY(a,b) a*b
#if MULTIPLY(2,3)==6
{2}// Active
{9}#endif
{0}
{5}int{0} {11}main{10}(){0} {10}{{0}
{11}double{0} {11}x{10}[]{0} {10}={0} {10}{{4}3.14159{10},{4}6.02e23{10},{4}1.6e-19{10},{4}1.0{10}+{4}1{10}};{0}
{5}int{0} {11}y{10}[]{0} {10}={0} {10}{{4}75{10},{4}0113{10},{4}0x4b{10}};{0}
{11}printf{10}({6}"hello world %d %g{27}\n{6}"{10},{0} {11}y{10}[{4}0{10}],{0} {11}x{10}[{4}0{10}]);{0}
{2}// JavaScript regular expression (14) tests
{0} {5}let{0} {11}a{0} {10}={0} {14}/a/{10};{0}
{5}let{0} {11}b{0} {10}={0} {14}/[a-z]+/gi{10};{0}
{14}/a|b/i{10}.{11}test{10}({6}"baby"{10});{0}
{2}// arrow function
{0} {10}(){0} {10}=>{0} {14}/a|b/i{10}.{11}test{10}({6}"baby"{10});{0}
{2}// Escape sequence (27) tests
{0} {11}printf{10}({6}"{27}\'\"\?\\\a\b\f\n\r\t\v{6} {27}\P{6}"{10});{0}
{11}printf{10}({6}"{27}\0{6}a {27}\013{6}a {27}\01{6}9"{10});{0}
{11}printf{10}({6}"{27}\x013a{6}c {27}\xd{6}z"{10});{0}
{11}printf{10}({6}"{27}\ua34d{6}f {27}\u{6}z"{10});{0}
{11}printf{10}({6}"{27}\Ua34df783{6}3 {27}\U{6}z"{10});{0}
{10}}{0}