notepad-plus-plus/lexilla/test/examples/batch/x.bat

64 lines
1.2 KiB
Batchfile
Raw Normal View History

rem comment=1
rem 'echo' is word=2, 'a' is default=0
echo a
rem label=3
:START
rem '@' is hide=4
@echo b
rem 'gcc' is external command=5
gcc --version
rem '%PATH%' is variable=6
echo %PATH%
echo %ProgramFiles(x86)%
rem operator=7 '='
@set Q=A
::comment=1
:: Bug 1624: this construct produced inconsistent brackets in the past
if ERRORLEVEL 2 goto END
@if exist a (
echo exists
) else (
echo not
)
FOR /L %%G IN (2,1,4) DO (echo %%G)
:: Bug 1997: keywords not recognized when preceded by '('
IF NOT DEFINED var (SET var=1)
:: Bug 2065: keywords not recognized when followed by ')'
@if exist a ( exit)
:: Bug: with \r or \n, 'command' is seen as continuation
echo word ^
1
command
:: Bug argument and variable expansion
echo %~dp0123
echo %%-~012
echo %%~%%~-abcd
FOR /F %%I in ("C:\Test\temp.txt") do echo %%~dI
:: Bug ending of argument and variable expansion
echo %~dp0\123
echo "%~dp0123"
echo "%%-~012"
echo "%%~%%~-abcd"
FOR /F %%I in ("C:\Test\temp.txt") do echo "%%~dI"
:: Bug escaped %
echo %%0
echo %%%0
echo %%%%~-abcd
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
2023-05-31 23:11:12 +00:00
:TEST that after label style works
:: Bug 2304: "::" comments not recognised when second command on line
Set /A xxx=%xxx%+1 & :: Increment
Set /A xxx=%xxx%+1 & ::Increment
Set /A xxx=%xxx%+1 & rem Increment
:END