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/batch/x.bat.styled

64 lines
1.7 KiB

{1}rem comment=1
rem 'echo' is word=2, 'a' is default=0
{2}echo{0} a
{1}rem label=3
{3}:START
{1}rem '@' is hide=4
{4}@{2}echo{0} b
{1}rem 'gcc' is external command=5
{5}gcc{0} --version
{1}rem '%PATH%' is variable=6
{2}echo{0} {6}%PATH%{0}
{2}echo{0} {6}%ProgramFiles(x86)%{0}
{1}rem operator=7 '='
{4}@{2}set{0} Q{7}={0}A
{1}::comment=1
{0}
{1}:: Bug 1624: this construct produced inconsistent brackets in the past
{2}if ERRORLEVEL{0} 2{2} goto{0} END
{4}@{2}if exist{0} a (
{2}echo{0} exists
){2} else{0} (
{2}echo{0} not
)
{2}FOR{0} /L {6}%%G{2} IN{0} (2,1,4){2} DO{0} ({2}echo{0} {6}%%G{0})
{1}:: Bug 1997: keywords not recognized when preceded by '('
{2}IF NOT DEFINED{0} var ({2}SET{0} var{7}={0}1)
{1}:: Bug 2065: keywords not recognized when followed by ')'
{4}@{2}if exist{0} a ({2} exit{0})
{1}:: Bug: with \r or \n, 'command' is seen as continuation
{2}echo{0} word ^
1
{5}command{0}
{1}:: Bug argument and variable expansion
{2}echo{0} {6}%~dp0{0}123
{2}echo{0} {6}%%-{0}~012
{2}echo{0} %%~{6}%%~-abcd{0}
{2}FOR{0} /F {6}%%I{2} in{0} ("C:\Test\temp.txt"){2} do echo{0} {6}%%~dI{0}
{1}:: Bug ending of argument and variable expansion
{2}echo{0} {6}%~dp0{0}\123
{2}echo{0} "{6}%~dp0{0}123"
{2}echo{0} "{6}%%-{0}~012"
{2}echo{0} "%%~{6}%%~-abcd{0}"
{2}FOR{0} /F {6}%%I{2} in{0} ("C:\Test\temp.txt"){2} do echo{0} "{6}%%~dI{0}"
{1}:: Bug escaped %
{2}echo{0} {6}%%0{0}
{2}echo{0} %%{6}%0{0}
{2}echo{0} %%{6}%%~-abcd{0}
Update: Scintilla 5.3.5 Lexilla 5.2.5 update to Scinitlla Release 5.3.5 (https://www.scintilla.org/scintilla535.zip) Released 31 May 2023. On Win32, implement IME context sensitivity with IMR_DOCUMENTFEED. Feature #1310. On Win32 remove dependence on MSIMG32.DLL by replacing AlphaBlend by GdiAlphaBlend. Bug #1923. On Qt, stop movement of IME candidate box. On Qt, report correct caret position within paragraph for IME retrieve surrounding text. On Qt for Cocoa, fix crash in entry of multi-character strings with IME. and Lexilla Release 5.2.5 (https://www.scintilla.org/lexilla525.zip) Released 31 May 2023. Add CharacterSetArray constructor without setBase initial argument for common case where this is setNone and the initialSet argument completely defines the characters. This shortens and clarifies use of CharacterSetArray. Bash: implement highlighting inside quoted elements and here-docs. Controlled with properties lexer.bash.styling.inside.string, lexer.bash.styling.inside.backticks, lexer.bash.styling.inside.parameter, and lexer.bash.styling.inside.heredoc. Issue #154, Issue #153, Feature #1033. Bash: add property lexer.bash.command.substitution to choose how to style command substitutions. 0 → SCE_SH_BACKTICKS; 1 → surrounding "$(" and ")" as operators and contents styled as bash code; 2 → use distinct styles (base style + 64) for contents. Choice (2) is a provisional feature and details may change before it is finalized. Issue #153. Bash: fix nesting of parameters (SCE_SH_PARAM) like ${var/$sub/"${rep}}"}. Issue #154. Bash: fix single character special parameters like $? by limiting style. Issue #154. Bash: treat "$$" as special parameter and end scalars before "$". Issue #154. Bash: treat "<<" in arithmetic contexts as left bitwise shift operator instead of here-doc. Issue #137. Batch: style SCE_BAT_AFTER_LABEL used for rest of line after label which is not executed. Issue #148. F#: Lex interpolated verbatim strings as verbatim. Issue #156. VB: allow multiline strings when lexer.vb.strings.multiline set. Issue #151. Close #13729
2 years ago
{3}:TEST{8} that after label style works
{1}:: Bug 2304: "::" comments not recognised when second command on line
{2}Set{0} /A xxx{7}={6}%xxx%{7}+{0}1 {7}&{0} {1}:: Increment
{2}Set{0} /A xxx{7}={6}%xxx%{7}+{0}1 {7}&{0} {1}::Increment
{2}Set{0} /A xxx{7}={6}%xxx%{7}+{0}1 {7}&{0} {1}rem Increment
{0}
{3}:END