play around with Scintilla and Lexilla

This commit is contained in:
2024-07-02 23:47:26 +08:00
parent d7c71f41b2
commit 727a2ec214
992 changed files with 281111 additions and 195 deletions

View File

@ -0,0 +1,54 @@
Text=0
*Strong Emphasis (bold) 1=1*
**Strong Emphasis (bold) 2=2**
_Emphasis (italic) 1=3_
__Emphasis (italic) 2=4__
= Heading level 1=5
== Heading level 2=6
=== Heading level 3=7
==== Heading level 4=8
===== Heading level 5=9
====== Heading level 6=10
* Unordered list item=11
. Ordered list item=12
> Block quote=13
https://14.com[Link=14]
----
Code block=15
----
++++
Passthrough block=16
++++
// Comment=17
////
Comment Block=18
////
+Literal=19+
....
Literal Block=20
....
:Attrib=21: Attrib Value=22
ifdef::Macro=23
ifeval::Macro=23
ifndef::Macro=23
endif::Macro=23
audio::Macro=23
include::Macro=23
image::Macro=23
video::Macro=23
asciimath:Macro=23
btn:Macro=23
image:Macro=23
kbd:Macro=23
latexmath:Macro=23
link:Macro=23
mailto:Macro=23
menu:Macro=23
pass:Macro=23
stem:Macro=23
xref:Macro=23
CAUTION:Macro=23
IMPORTANT:Macro=23
NOTE:Macro=23
TIP:Macro=23
WARNING:Macro=23

View File

@ -0,0 +1,55 @@
0 400 0 Text=0
0 400 0 *Strong Emphasis (bold) 1=1*
0 400 0 **Strong Emphasis (bold) 2=2**
0 400 0 _Emphasis (italic) 1=3_
0 400 0 __Emphasis (italic) 2=4__
0 400 0 = Heading level 1=5
0 400 0 == Heading level 2=6
0 400 0 === Heading level 3=7
0 400 0 ==== Heading level 4=8
0 400 0 ===== Heading level 5=9
0 400 0 ====== Heading level 6=10
0 400 0 * Unordered list item=11
0 400 0 . Ordered list item=12
0 400 0 > Block quote=13
0 400 0 https://14.com[Link=14]
0 400 0 ----
0 400 0 Code block=15
0 400 0 ----
0 400 0 ++++
0 400 0 Passthrough block=16
0 400 0 ++++
0 400 0 // Comment=17
0 400 0 ////
0 400 0 Comment Block=18
0 400 0 ////
0 400 0 +Literal=19+
0 400 0 ....
0 400 0 Literal Block=20
0 400 0 ....
0 400 0 :Attrib=21: Attrib Value=22
0 400 0 ifdef::Macro=23
0 400 0 ifeval::Macro=23
0 400 0 ifndef::Macro=23
0 400 0 endif::Macro=23
0 400 0 audio::Macro=23
0 400 0 include::Macro=23
0 400 0 image::Macro=23
0 400 0 video::Macro=23
0 400 0 asciimath:Macro=23
0 400 0 btn:Macro=23
0 400 0 image:Macro=23
0 400 0 kbd:Macro=23
0 400 0 latexmath:Macro=23
0 400 0 link:Macro=23
0 400 0 mailto:Macro=23
0 400 0 menu:Macro=23
0 400 0 pass:Macro=23
0 400 0 stem:Macro=23
0 400 0 xref:Macro=23
0 400 0 CAUTION:Macro=23
0 400 0 IMPORTANT:Macro=23
0 400 0 NOTE:Macro=23
0 400 0 TIP:Macro=23
0 400 0 WARNING:Macro=23
0 400 0

View File

@ -0,0 +1,54 @@
{0}Text=0
{1}*Strong Emphasis (bold) 1=1*{0}
{2}**Strong Emphasis (bold) 2=2**{0}
{3}_Emphasis (italic) 1=3_{0}
{4}__Emphasis (italic) 2=4__{0}
{5}= Heading level 1=5{0}
{6}== Heading level 2=6{0}
{7}=== Heading level 3=7{0}
{8}==== Heading level 4=8{0}
{9}===== Heading level 5=9{0}
{10}====== Heading level 6=10{0}
{11}*{0} Unordered list item=11
{12}.{0} Ordered list item=12
{13}> Block quote=13{0}
https://14.com[{14}Link=14{0}]
{15}----
Code block=15
----{0}
{16}++++
Passthrough block=16
++++{0}
{17}// Comment=17{0}
{18}////
Comment Block=18
////{0}
+{19}Literal=19{0}+
{20}....
Literal Block=20
....{0}
{21}:Attrib=21:{22} Attrib Value=22{0}
{23}ifdef{0}::Macro=23
{23}ifeval{0}::Macro=23
{23}ifndef{0}::Macro=23
{23}endif{0}::Macro=23
{23}audio{0}::Macro=23
{23}include{0}::Macro=23
{23}image{0}::Macro=23
{23}video{0}::Macro=23
{23}asciimat{0}h:Macro=23
{23}btn{0}:Macro=23
{23}image{0}:Macro=23
{23}kbd{0}:Macro=23
{23}latexmath{0}:Macro=23
{23}link{0}:Macro=23
{23}mailto{0}:Macro=23
{23}menu{0}:Macro=23
{23}pass{0}:Macro=23
{23}stem{0}:Macro=23
{23}xref{0}:Macro=23
{23}CAUTION{0}:Macro=23
{23}IMPORTANT{0}:Macro=23
{23}NOTE{0}:Macro=23
{23}TIP{0}:Macro=23
{23}WARNING{0}:Macro=23

View File

@ -0,0 +1,3 @@
code.page=65001
lexer.*.adoc=asciidoc
fold=1

View File

@ -0,0 +1,52 @@
; Enumerate all styles: 0 to 15 except for 11(comment block) which is not yet implemented.
; This is not a viable source file, it just illustrates the different states in isolation.
; comment=1
; Comment
; whitespace=0
; w
; number=2
11
; string=3
"String"
; operator=4
+
; identifier=5
identifier
; CPU instruction=6
add
; math Instruction=7
fadd
; register=8
ECX
; directive=9
section
; directive operand=10
rel
; comment block=11 is for future expansion
; character=12
'character'
; string EOL=13
"no line end
; extended instruction=14
movq
; comment directive=15
comment ~ A multiple-line
comment directive~
;end

View File

@ -0,0 +1,53 @@
0 400 0 ; Enumerate all styles: 0 to 15 except for 11(comment block) which is not yet implemented.
0 400 0 ; This is not a viable source file, it just illustrates the different states in isolation.
0 400 0
0 400 0 ; comment=1
0 400 0 ; Comment
0 400 0
0 400 0 ; whitespace=0
0 400 0 ; w
0 400 0
0 400 0 ; number=2
0 400 0 11
0 400 0
0 400 0 ; string=3
0 400 0 "String"
0 400 0
0 400 0 ; operator=4
0 400 0 +
0 400 0
0 400 0 ; identifier=5
0 400 0 identifier
0 400 0
0 400 0 ; CPU instruction=6
0 400 0 add
0 400 0
0 400 0 ; math Instruction=7
0 400 0 fadd
0 400 0
0 400 0 ; register=8
0 400 0 ECX
0 400 0
0 400 0 ; directive=9
0 400 0 section
0 400 0
0 400 0 ; directive operand=10
0 400 0 rel
0 400 0
0 400 0 ; comment block=11 is for future expansion
0 400 0
0 400 0 ; character=12
0 400 0 'character'
0 400 0
0 400 0 ; string EOL=13
0 400 0 "no line end
0 400 0
0 400 0 ; extended instruction=14
0 400 0 movq
0 400 0
0 400 0 ; comment directive=15
0 400 0 comment ~ A multiple-line
0 400 0 comment directive~
0 400 0
0 400 0 ;end
0 400 0

View File

@ -0,0 +1,52 @@
{1}; Enumerate all styles: 0 to 15 except for 11(comment block) which is not yet implemented.
; This is not a viable source file, it just illustrates the different states in isolation.
{0}
{1}; comment=1
; Comment
{0}
{1}; whitespace=0
{0} {1}; w
{0}
{1}; number=2
{2}11{0}
{1}; string=3
{3}"String"{0}
{1}; operator=4
{4}+{0}
{1}; identifier=5
{5}identifier{0}
{1}; CPU instruction=6
{6}add{0}
{1}; math Instruction=7
{7}fadd{0}
{1}; register=8
{8}ECX{0}
{1}; directive=9
{9}section{0}
{1}; directive operand=10
{10}rel{0}
{1}; comment block=11 is for future expansion
{0}
{1}; character=12
{12}'character'{0}
{1}; string EOL=13
{13}"no line end
{0}
{1}; extended instruction=14
{14}movq{0}
{1}; comment directive=15
{0} {9}comment{0} {15}~ A multiple-line
comment directive~{0}
{1};end

View File

@ -0,0 +1,9 @@
lexer.*.asm=asm
keywords.*.asm=add sub xor mov lea call
keywords2.*.asm=fadd
keywords3.*.asm=rsp rax rcx rdx r8 r9 ecx
keywords4.*.asm=db section alignb resq resqdb global extern equ .bss .text .data start comment
keywords5.*.asm=qword rel
keywords6.*.asm=movd movq

View File

@ -0,0 +1,21 @@
hello="hello, "
hello+=word
echo $hello
for ((i = 2; i > 0; i--)); do
echo postfix dec $i
done
for ((i = 2; i > 0; --i)); do
echo prefix dec $i
done
for ((i = 0; i < 2; i++)); do
echo postfix inc $i
done
for ((i = 0; i < 2; ++i)); do
echo prefix inc $i
done
# issue 215
for ((i = 0; i < 2; i++)); do
echo $((((1)) << i))
done

View File

@ -0,0 +1,22 @@
0 400 0 hello="hello, "
0 400 0 hello+=word
0 400 0 echo $hello
1 400 0
2 400 0 + for ((i = 2; i > 0; i--)); do
0 401 0 | echo postfix dec $i
0 401 0 | done
2 400 0 + for ((i = 2; i > 0; --i)); do
0 401 0 | echo prefix dec $i
0 401 0 | done
2 400 0 + for ((i = 0; i < 2; i++)); do
0 401 0 | echo postfix inc $i
0 401 0 | done
2 400 0 + for ((i = 0; i < 2; ++i)); do
0 401 0 | echo prefix inc $i
0 401 0 | done
1 400 0
0 400 0 # issue 215
2 400 0 + for ((i = 0; i < 2; i++)); do
0 401 0 | echo $((((1)) << i))
0 401 0 | done
0 400 0

View File

@ -0,0 +1,21 @@
{8}hello{7}={5}"hello, "{0}
{8}hello{7}+={8}word{0}
{4}echo{0} {9}$hello{0}
{4}for{0} {7}(({8}i{0} {7}={0} {3}2{7};{0} {8}i{0} {7}>{0} {3}0{7};{0} {8}i{7}--));{0} {4}do{0}
{4}echo{0} {8}postfix{0} {8}dec{0} {9}$i{0}
{4}done{0}
{4}for{0} {7}(({8}i{0} {7}={0} {3}2{7};{0} {8}i{0} {7}>{0} {3}0{7};{0} {7}--{8}i{7}));{0} {4}do{0}
{4}echo{0} {8}prefix{0} {8}dec{0} {9}$i{0}
{4}done{0}
{4}for{0} {7}(({8}i{0} {7}={0} {3}0{7};{0} {8}i{0} {7}<{0} {3}2{7};{0} {8}i{7}++));{0} {4}do{0}
{4}echo{0} {8}postfix{0} {8}inc{0} {9}$i{0}
{4}done{0}
{4}for{0} {7}(({8}i{0} {7}={0} {3}0{7};{0} {8}i{0} {7}<{0} {3}2{7};{0} {7}++{8}i{7}));{0} {4}do{0}
{4}echo{0} {8}prefix{0} {8}inc{0} {9}$i{0}
{4}done{0}
{2}# issue 215{0}
{4}for{0} {7}(({8}i{0} {7}={0} {3}0{7};{0} {8}i{0} {7}<{0} {3}2{7};{0} {8}i{7}++));{0} {4}do{0}
{4}echo{0} {7}$(((({3}1{7})){0} {7}<<{0} {8}i{7})){0}
{4}done{0}

View File

@ -0,0 +1,90 @@
# Lexing numeric literals
# From issue #199
# UUIDs
virsh start 61a6a312-86d3-458c-824a-fa0adc2bd22c
virsh start 61969312-86d3-458c-8249-fa0adc2bd22c
virsh restore /opt/61a6a312-86d3-458c-824a-fa0adc2bd22c-suspend
# Git items
git checkout 998d611b516b0e485803089ecd53fdf0ea707a8c
git log --no-walk 0e2ba9c
git log --no-walk rel-5-2-4-97-g7405d4e7
# Arithmetic and character ranges
declare -i a=1+1; echo $a
[[ $a == [0-9] ]] && echo 1
# Brace expansion
for i in {1..10..2}; do
echo $i
done
for a in {A..Z..2}; do
echo $a
done
# From Kein-Hong Man
#--------------------------------------------------------------------------
# Bash number formats
# (20070712)
# Octal lexing relaxed to allow hex digits to avoid flagging unnecessary
# and misleading number errors; radix-prefixed lexing behaviour is unchanged,
# as those cases are uncommon (to get strict lexing, define PEDANTIC_OCTAL).
# NOTE: Some people may want an entire non-number to be lexed in the normal
# style and not as part-number part-normal. If the user thinks there is a
# better case for the former, please lobby for it on the SF issue tracker.
0123 0567 # octal good
08 0789 077ABC # octal bad (disabled 20070712, now lexed as numbers)
066XYZ # octal bad
0xDEAD 0X1234 # hex good
0xABCMNO 0XGHI # hex bad
# extended "[base#]n" format where base is between 2-64
# digits range are 0-9a-zA-Z@_
# if base <= 36, then alphabets are case insensitive
# this style isn't likely in non-number code, so the lexer currently
# opts to colour the error in red -- send feedback if this is too
# intrusive; 'invalid octals' (but valid text) in red proved annoying...
2#10101 # binary
2#23456 # error (in red)
8#0123456789AB # error (in red)
16#abcDEF123
16#abcpqr # bad
64#xyzXYZ@_789 # full base-64
99#xyzXYZ@_789 # error (in red; invalid base)
111#xyzXYZ@_789 # error (in red; invalid base)
567+0123*0xBCD # with operators
(4#0123-3#012)
# 20070712:
# Octal lexing relaxed to avoid marking some number sequences as octal
# errors. This is because the elements or apps controlled by bash may
# have a different view of numbers, so we avoid flagging unnecessary
# (and misleading) number errors. Radix-prefixed number lexing is
# unchanged, as those cases are uncommon (no feedback on it yet.)
# In the following, red-flagged 'octals' should now be lexed as normal
# numbers, allowing hex digits.
# flightgear missing.sh
scriptversion=2004-09-07.08
# git t/t0000/basic.sh
P=087704a96baf1c2d1c869a8b084481e121c88b5b
# openssh config.guess
*:procnto*:*:* | *:QNX:[0123456789]*:*)
# with hex digits, the following will still be an invalid number
066XYZ

View File

@ -0,0 +1,91 @@
0 400 0 # Lexing numeric literals
1 400 0
0 400 0 # From issue #199
1 400 0
0 400 0 # UUIDs
1 400 0
0 400 0 virsh start 61a6a312-86d3-458c-824a-fa0adc2bd22c
0 400 0 virsh start 61969312-86d3-458c-8249-fa0adc2bd22c
0 400 0 virsh restore /opt/61a6a312-86d3-458c-824a-fa0adc2bd22c-suspend
1 400 0
0 400 0 # Git items
1 400 0
0 400 0 git checkout 998d611b516b0e485803089ecd53fdf0ea707a8c
1 400 0
0 400 0 git log --no-walk 0e2ba9c
0 400 0 git log --no-walk rel-5-2-4-97-g7405d4e7
1 400 0
0 400 0 # Arithmetic and character ranges
1 400 0
0 400 0 declare -i a=1+1; echo $a
0 400 0 [[ $a == [0-9] ]] && echo 1
1 400 0
0 400 0 # Brace expansion
1 400 0
2 400 0 + for i in {1..10..2}; do
0 401 0 | echo $i
0 401 0 | done
2 400 0 + for a in {A..Z..2}; do
0 401 0 | echo $a
0 401 0 | done
1 400 0
0 400 0 # From Kein-Hong Man
1 400 0
2 400 0 + #--------------------------------------------------------------------------
0 401 0 | # Bash number formats
0 401 0 | # (20070712)
0 401 0 | # Octal lexing relaxed to allow hex digits to avoid flagging unnecessary
0 401 0 | # and misleading number errors; radix-prefixed lexing behaviour is unchanged,
0 401 0 | # as those cases are uncommon (to get strict lexing, define PEDANTIC_OCTAL).
1 400 0
2 400 0 + # NOTE: Some people may want an entire non-number to be lexed in the normal
0 401 0 | # style and not as part-number part-normal. If the user thinks there is a
0 401 0 | # better case for the former, please lobby for it on the SF issue tracker.
1 400 0
0 400 0 0123 0567 # octal good
0 400 0 08 0789 077ABC # octal bad (disabled 20070712, now lexed as numbers)
0 400 0 066XYZ # octal bad
0 400 0 0xDEAD 0X1234 # hex good
0 400 0 0xABCMNO 0XGHI # hex bad
1 400 0
2 400 0 + # extended "[base#]n" format where base is between 2-64
0 401 0 | # digits range are 0-9a-zA-Z@_
0 401 0 | # if base <= 36, then alphabets are case insensitive
0 401 0 | # this style isn't likely in non-number code, so the lexer currently
0 401 0 | # opts to colour the error in red -- send feedback if this is too
0 401 0 | # intrusive; 'invalid octals' (but valid text) in red proved annoying...
1 400 0
0 400 0 2#10101 # binary
0 400 0 2#23456 # error (in red)
0 400 0 8#0123456789AB # error (in red)
0 400 0 16#abcDEF123
0 400 0 16#abcpqr # bad
0 400 0 64#xyzXYZ@_789 # full base-64
0 400 0 99#xyzXYZ@_789 # error (in red; invalid base)
0 400 0 111#xyzXYZ@_789 # error (in red; invalid base)
1 400 0
0 400 0 567+0123*0xBCD # with operators
0 400 0 (4#0123-3#012)
1 400 0
2 400 0 + # 20070712:
0 401 0 | # Octal lexing relaxed to avoid marking some number sequences as octal
0 401 0 | # errors. This is because the elements or apps controlled by bash may
0 401 0 | # have a different view of numbers, so we avoid flagging unnecessary
0 401 0 | # (and misleading) number errors. Radix-prefixed number lexing is
0 401 0 | # unchanged, as those cases are uncommon (no feedback on it yet.)
1 400 0
2 400 0 + # In the following, red-flagged 'octals' should now be lexed as normal
0 401 0 | # numbers, allowing hex digits.
1 400 0
0 400 0 # flightgear missing.sh
0 400 0 scriptversion=2004-09-07.08
1 400 0
0 400 0 # git t/t0000/basic.sh
0 400 0 P=087704a96baf1c2d1c869a8b084481e121c88b5b
1 400 0
0 400 0 # openssh config.guess
0 400 0 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1 400 0
0 400 0 # with hex digits, the following will still be an invalid number
0 400 0 066XYZ
0 400 0

View File

@ -0,0 +1,90 @@
{2}# Lexing numeric literals{0}
{2}# From issue #199{0}
{2}# UUIDs{0}
{8}virsh{0} {8}start{0} {8}61a6a312-86d3-458c-824a-fa0adc2bd22c{0}
{8}virsh{0} {8}start{0} {8}61969312-86d3-458c-8249-fa0adc2bd22c{0}
{8}virsh{0} {8}restore{0} {7}/{8}opt{7}/{8}61a6a312-86d3-458c-824a-fa0adc2bd22c-suspend{0}
{2}# Git items{0}
{8}git{0} {8}checkout{0} {8}998d611b516b0e485803089ecd53fdf0ea707a8c{0}
{8}git{0} {8}log{0} {8}--no-walk{0} {8}0e2ba9c{0}
{8}git{0} {8}log{0} {8}--no-walk{0} {8}rel-5-2-4-97-g7405d4e7{0}
{2}# Arithmetic and character ranges{0}
{8}declare{0} {8}-i{0} {8}a{7}={3}1{7}+{3}1{7};{0} {4}echo{0} {9}$a{0}
{7}[[{0} {9}$a{0} {7}=={0} {7}[{8}0-9{7}]{0} {7}]]{0} {7}&&{0} {4}echo{0} {3}1{0}
{2}# Brace expansion{0}
{4}for{0} {8}i{0} {4}in{0} {7}{{3}1{7}..{3}10{7}..{3}2{7}};{0} {4}do{0}
{4}echo{0} {9}$i{0}
{4}done{0}
{4}for{0} {8}a{0} {4}in{0} {7}{{8}A{7}..{8}Z{7}..{3}2{7}};{0} {4}do{0}
{4}echo{0} {9}$a{0}
{4}done{0}
{2}# From Kein-Hong Man{0}
{2}#--------------------------------------------------------------------------{0}
{2}# Bash number formats{0}
{2}# (20070712){0}
{2}# Octal lexing relaxed to allow hex digits to avoid flagging unnecessary{0}
{2}# and misleading number errors; radix-prefixed lexing behaviour is unchanged,{0}
{2}# as those cases are uncommon (to get strict lexing, define PEDANTIC_OCTAL).{0}
{2}# NOTE: Some people may want an entire non-number to be lexed in the normal{0}
{2}# style and not as part-number part-normal. If the user thinks there is a{0}
{2}# better case for the former, please lobby for it on the SF issue tracker.{0}
{3}0123{0} {3}0567{0} {2}# octal good{0}
{3}08{0} {3}0789{0} {8}077ABC{0} {2}# octal bad (disabled 20070712, now lexed as numbers){0}
{8}066XYZ{0} {2}# octal bad{0}
{3}0xDEAD{0} {3}0X1234{0} {2}# hex good{0}
{8}0xABCMNO{0} {8}0XGHI{0} {2}# hex bad{0}
{2}# extended "[base#]n" format where base is between 2-64{0}
{2}# digits range are 0-9a-zA-Z@_{0}
{2}# if base <= 36, then alphabets are case insensitive{0}
{2}# this style isn't likely in non-number code, so the lexer currently{0}
{2}# opts to colour the error in red -- send feedback if this is too{0}
{2}# intrusive; 'invalid octals' (but valid text) in red proved annoying...{0}
{3}2#10101{0} {2}# binary{0}
{1}2#23456{0} {2}# error (in red){0}
{1}8#0123456789{8}AB{0} {2}# error (in red){0}
{3}16#abcDEF123{0}
{8}16#abcpqr{0} {2}# bad{0}
{3}64#xyzXYZ@_789{0} {2}# full base-64{0}
{1}99{8}#xyzXYZ{7}@{8}_789{0} {2}# error (in red; invalid base){0}
{1}111{8}#xyzXYZ{7}@{8}_789{0} {2}# error (in red; invalid base){0}
{3}567{7}+{3}0123{7}*{3}0xBCD{0} {2}# with operators{0}
{8}(4#0123-3#012){0}
{2}# 20070712:{0}
{2}# Octal lexing relaxed to avoid marking some number sequences as octal{0}
{2}# errors. This is because the elements or apps controlled by bash may{0}
{2}# have a different view of numbers, so we avoid flagging unnecessary{0}
{2}# (and misleading) number errors. Radix-prefixed number lexing is{0}
{2}# unchanged, as those cases are uncommon (no feedback on it yet.){0}
{2}# In the following, red-flagged 'octals' should now be lexed as normal{0}
{2}# numbers, allowing hex digits.{0}
{2}# flightgear missing.sh{0}
{8}scriptversion{7}={8}2004-09-07.08{0}
{2}# git t/t0000/basic.sh{0}
{8}P{7}={8}087704a96baf1c2d1c869a8b084481e121c88b5b{0}
{2}# openssh config.guess{0}
{7}*:{8}procnto{7}*:*:*{0} {7}|{0} {7}*:{8}QNX{7}:[{3}0123456789{7}]*:*){0}
{2}# with hex digits, the following will still be an invalid number{0}
{8}066XYZ{0}

View File

@ -0,0 +1,41 @@
-a
#
-b
#
declare -A optionSet=([--help]=0)
for option in {-h,--help,--version,--verbose,-,--}; do
case $option in
-h|--help)
optionSet[--help]=1
echo help: $option
;;
-*-version)
echo version: $option
;;
--)
echo stop
;;
-)
echo stdin
;;
-*[-a-zA-Z0-9])
echo other: $option
;;
esac
done
option=--help
[[ $option == *-h* ]] && echo $option=${optionSet[$option]}
for gcc in gcc{,-1{4..0..-1}}; do
echo $gcc
done
for gcc in gcc{,{-14..-10}}; do
echo $gcc
done
# Tilde-refix ~
~+/foo
~-/foo

View File

@ -0,0 +1,42 @@
0 400 0 -a
0 400 0 #
0 400 0 -b
0 400 0 #
1 400 0
0 400 0 declare -A optionSet=([--help]=0)
2 400 0 + for option in {-h,--help,--version,--verbose,-,--}; do
2 401 0 + case $option in
0 402 0 | -h|--help)
0 402 0 | optionSet[--help]=1
0 402 0 | echo help: $option
0 402 0 | ;;
0 402 0 | -*-version)
0 402 0 | echo version: $option
0 402 0 | ;;
0 402 0 | --)
0 402 0 | echo stop
0 402 0 | ;;
0 402 0 | -)
0 402 0 | echo stdin
0 402 0 | ;;
0 402 0 | -*[-a-zA-Z0-9])
0 402 0 | echo other: $option
0 402 0 | ;;
0 402 0 | esac
0 401 0 | done
1 400 0
0 400 0 option=--help
0 400 0 [[ $option == *-h* ]] && echo $option=${optionSet[$option]}
1 400 0
2 400 0 + for gcc in gcc{,-1{4..0..-1}}; do
0 401 0 | echo $gcc
0 401 0 | done
1 400 0
2 400 0 + for gcc in gcc{,{-14..-10}}; do
0 401 0 | echo $gcc
0 401 0 | done
1 400 0
0 400 0 # Tilde-refix ~
0 400 0 ~+/foo
0 400 0 ~-/foo
0 400 0

View File

@ -0,0 +1,41 @@
{8}-a{0}
{2}#{0}
{8}-b{0}
{2}#{0}
{8}declare{0} {8}-A{0} {8}optionSet{7}=([{8}--help{7}]={3}0{7}){0}
{4}for{0} {8}option{0} {4}in{0} {7}{{8}-h{7},{8}--help{7},{8}--version{7},{8}--verbose{7},{8}-{7},{8}--{7}};{0} {4}do{0}
{4}case{0} {9}$option{0} {4}in{0}
{8}-h{7}|{8}--help{7}){0}
{8}optionSet{7}[{8}--help{7}]={3}1{0}
{4}echo{0} {8}help{7}:{0} {9}$option{0}
{7};;{0}
{8}-{7}*{8}-version{7}){0}
{4}echo{0} {8}version{7}:{0} {9}$option{0}
{7};;{0}
{8}--{7}){0}
{4}echo{0} {8}stop{0}
{7};;{0}
{8}-{7}){0}
{4}echo{0} {8}stdin{0}
{7};;{0}
{8}-{7}*[{8}-a-zA-Z0-9{7}]){0}
{4}echo{0} {8}other{7}:{0} {9}$option{0}
{7};;{0}
{4}esac{0}
{4}done{0}
{8}option{7}={8}--help{0}
{7}[[{0} {9}$option{0} {7}=={0} {7}*{8}-h{7}*{0} {7}]]{0} {7}&&{0} {4}echo{0} {9}$option{7}={10}${optionSet[$option]}{0}
{4}for{0} {8}gcc{0} {4}in{0} {8}gcc{7}{,-{3}1{7}{{3}4{7}..{3}0{7}..-{3}1{7}}};{0} {4}do{0}
{4}echo{0} {9}$gcc{0}
{4}done{0}
{4}for{0} {8}gcc{0} {4}in{0} {8}gcc{7}{,{-{3}14{7}..-{3}10{7}}};{0} {4}do{0}
{4}echo{0} {9}$gcc{0}
{4}done{0}
{2}# Tilde-refix ~{0}
{7}~+/{8}foo{0}
{7}~-/{8}foo{0}

View File

@ -0,0 +1,24 @@
[[ $1 == -e* ]] && echo e
if [[ -d /usr/bin &&
-e /usr/bin/bash ]]; then
echo find bash
fi
if [[ -d /usr/bin && -e /usr/bin/bash ]]; then
echo find bash
fi
if [ -d /usr/bin && -e /usr/bin/bash ]; then
echo find bash
fi
if [ -d /usr/bin &&
-e /usr/bin/bash ]; then
echo find bash
fi
if [ -d /usr/bin && \
-e /usr/bin/bash ]; then
echo find bash
fi

View File

@ -0,0 +1,25 @@
0 400 0 [[ $1 == -e* ]] && echo e
1 400 0
2 400 0 + if [[ -d /usr/bin &&
0 401 0 | -e /usr/bin/bash ]]; then
0 401 0 | echo find bash
0 401 0 | fi
1 400 0
2 400 0 + if [[ -d /usr/bin && -e /usr/bin/bash ]]; then
0 401 0 | echo find bash
0 401 0 | fi
1 400 0
2 400 0 + if [ -d /usr/bin && -e /usr/bin/bash ]; then
0 401 0 | echo find bash
0 401 0 | fi
1 400 0
2 400 0 + if [ -d /usr/bin &&
0 401 0 | -e /usr/bin/bash ]; then
0 401 0 | echo find bash
0 401 0 | fi
1 400 0
2 400 0 + if [ -d /usr/bin && \
0 401 0 | -e /usr/bin/bash ]; then
0 401 0 | echo find bash
0 401 0 | fi
0 400 0

View File

@ -0,0 +1,24 @@
{7}[[{0} {9}$1{0} {7}=={0} {8}-e{7}*{0} {7}]]{0} {7}&&{0} {4}echo{0} {8}e{0}
{4}if{0} {7}[[{0} {4}-d{0} {7}/{8}usr{7}/{8}bin{0} {7}&&{0}
{4}-e{0} {7}/{8}usr{7}/{8}bin{7}/{8}bash{0} {7}]];{0} {4}then{0}
{4}echo{0} {8}find{0} {8}bash{0}
{4}fi{0}
{4}if{0} {7}[[{0} {4}-d{0} {7}/{8}usr{7}/{8}bin{0} {7}&&{0} {4}-e{0} {7}/{8}usr{7}/{8}bin{7}/{8}bash{0} {7}]];{0} {4}then{0}
{4}echo{0} {8}find{0} {8}bash{0}
{4}fi{0}
{4}if{0} {7}[{0} {4}-d{0} {7}/{8}usr{7}/{8}bin{0} {7}&&{0} {8}-e{0} {7}/{8}usr{7}/{8}bin{7}/{8}bash{0} {7}];{0} {4}then{0}
{4}echo{0} {8}find{0} {8}bash{0}
{4}fi{0}
{4}if{0} {7}[{0} {4}-d{0} {7}/{8}usr{7}/{8}bin{0} {7}&&{0}
{8}-e{0} {7}/{8}usr{7}/{8}bin{7}/{8}bash{0} {7}];{0} {4}then{0}
{4}echo{0} {8}find{0} {8}bash{0}
{4}fi{0}
{4}if{0} {7}[{0} {4}-d{0} {7}/{8}usr{7}/{8}bin{0} {7}&&{0} {7}\{0}
{8}-e{0} {7}/{8}usr{7}/{8}bin{7}/{8}bash{0} {7}];{0} {4}then{0}
{4}echo{0} {8}find{0} {8}bash{0}
{4}fi{0}

View File

@ -0,0 +1,61 @@
# Enumerate all styles: 0 to 13
# comment=2
# whitespace=0
# w
# error=1
0#0000
# number=3
123
# keyword=4
set
# double-quoted-string=5
"string"
# single-quoted-string=6
'str'
# operator=7
+
# identifier=8
identifier
# scalar=9
$scalar
$?Status
# parameter-expansion=10
${parameter}
# back-ticks=11
`ls`
# here-doc-delimiter=12, here-doc=13
<<EOF
Here-doc.
EOF
# other quoted types are mapped to current classes
# double-quoted-string=5
$"string"
$'str'
# back-ticks=11
`ls`
$`ls`
$(ls)
# Use substyles
# Substyled identifier=128
map
# Substyled scalar=129
$CWD

View File

@ -0,0 +1,62 @@
0 400 0 # Enumerate all styles: 0 to 13
1 400 0
0 400 0 # comment=2
1 400 0
2 400 0 + # whitespace=0
0 401 0 | # w
1 400 0
0 400 0 # error=1
0 400 0 0#0000
1 400 0
0 400 0 # number=3
0 400 0 123
1 400 0
0 400 0 # keyword=4
0 400 0 set
1 400 0
0 400 0 # double-quoted-string=5
0 400 0 "string"
1 400 0
0 400 0 # single-quoted-string=6
0 400 0 'str'
1 400 0
0 400 0 # operator=7
0 400 0 +
1 400 0
0 400 0 # identifier=8
0 400 0 identifier
1 400 0
0 400 0 # scalar=9
0 400 0 $scalar
0 400 0 $?Status
1 400 0
0 400 0 # parameter-expansion=10
0 400 0 ${parameter}
1 400 0
0 400 0 # back-ticks=11
0 400 0 `ls`
1 400 0
0 400 0 # here-doc-delimiter=12, here-doc=13
2 400 0 + <<EOF
0 401 0 | Here-doc.
0 401 0 | EOF
1 400 0
0 400 0 # other quoted types are mapped to current classes
1 400 0
0 400 0 # double-quoted-string=5
0 400 0 $"string"
0 400 0 $'str'
1 400 0
0 400 0 # back-ticks=11
0 400 0 `ls`
0 400 0 $`ls`
0 400 0 $(ls)
1 400 0
0 400 0 # Use substyles
1 400 0
0 400 0 # Substyled identifier=128
0 400 0 map
1 400 0
0 400 0 # Substyled scalar=129
0 400 0 $CWD
0 400 0

View File

@ -0,0 +1,61 @@
{2}# Enumerate all styles: 0 to 13{0}
{2}# comment=2{0}
{2}# whitespace=0{0}
{2}# w{0}
{2}# error=1{0}
{1}0#0000{0}
{2}# number=3{0}
{3}123{0}
{2}# keyword=4{0}
{4}set{0}
{2}# double-quoted-string=5{0}
{5}"string"{0}
{2}# single-quoted-string=6{0}
{6}'str'{0}
{2}# operator=7{0}
{7}+{0}
{2}# identifier=8{0}
{8}identifier{0}
{2}# scalar=9{0}
{9}$scalar{0}
{9}$?{8}Status{0}
{2}# parameter-expansion=10{0}
{10}${parameter}{0}
{2}# back-ticks=11{0}
{11}`ls`{0}
{2}# here-doc-delimiter=12, here-doc=13{0}
{12}<<EOF{13}
Here-doc.
{12}EOF{0}
{2}# other quoted types are mapped to current classes{0}
{2}# double-quoted-string=5{0}
{5}$"string"{0}
{5}$'str'{0}
{2}# back-ticks=11{0}
{11}`ls`{0}
${11}`ls`{0}
{11}$(ls){0}
{2}# Use substyles{0}
{2}# Substyled identifier=128{0}
{128}map{0}
{2}# Substyled scalar=129{0}
{129}$CWD{0}

View File

@ -0,0 +1,7 @@
echo '$'
echo "$"
echo "$"
echo "$"x""
echo x$'\t'y
echo "x$'\t'y"
echo "x\ty"

View File

@ -0,0 +1,8 @@
0 400 0 echo '$'
0 400 0 echo "$"
0 400 0 echo "$"
0 400 0 echo "$"x""
0 400 0 echo x$'\t'y
0 400 0 echo "x$'\t'y"
0 400 0 echo "x\ty"
0 400 0

View File

@ -0,0 +1,7 @@
{4}echo{0} {6}'$'{0}
{4}echo{0} {5}"$"{0}
{4}echo{0} {5}"$"{0}
{4}echo{0} {5}"$"{8}x{5}""{0}
{4}echo{0} {8}x{5}$'\t'{8}y{0}
{4}echo{0} {5}"x$'\t'y"{0}
{4}echo{0} {5}"x\ty"{0}

View File

@ -0,0 +1,7 @@
if [ -n "$eth" -o -n "$wlan" ]; then
fi
test $((1 + 1)) -eq 2 && echo yes
[ $((1 + 1)) -eq 2 ] && echo yes
ls -a --directory

View File

@ -0,0 +1,8 @@
2 400 0 + if [ -n "$eth" -o -n "$wlan" ]; then
0 401 0 | fi
1 400 0
0 400 0 test $((1 + 1)) -eq 2 && echo yes
0 400 0 [ $((1 + 1)) -eq 2 ] && echo yes
1 400 0
0 400 0 ls -a --directory
0 400 0

View File

@ -0,0 +1,7 @@
{4}if{0} {7}[{0} {4}-n{0} {5}"{9}$eth{5}"{0} {4}-o{0} {4}-n{0} {5}"{9}$wlan{5}"{0} {7}];{0} {4}then{0}
{4}fi{0}
{4}test{0} {7}$(({3}1{0} {7}+{0} {3}1{7})){0} {4}-eq{0} {3}2{0} {7}&&{0} {4}echo{0} {8}yes{0}
{7}[{0} {7}$(({3}1{0} {7}+{0} {3}1{7})){0} {4}-eq{0} {3}2{0} {7}]{0} {7}&&{0} {4}echo{0} {8}yes{0}
{8}ls{0} {8}-a{0} {8}--directory{0}

View File

@ -0,0 +1,11 @@
echo $*
echo $@
echo $?
echo $-
echo $$
echo $!
echo $_
echo $%
echo $<
ifeth=$(ls /sys/class/net | grep ^"$intf" | grep "$intf"$)

View File

@ -0,0 +1,12 @@
0 400 0 echo $*
0 400 0 echo $@
0 400 0 echo $?
0 400 0 echo $-
0 400 0 echo $$
0 400 0 echo $!
0 400 0 echo $_
0 400 0 echo $%
0 400 0 echo $<
1 400 0
0 400 0 ifeth=$(ls /sys/class/net | grep ^"$intf" | grep "$intf"$)
0 400 0

View File

@ -0,0 +1,11 @@
{4}echo{0} {9}$*{0}
{4}echo{0} {9}$@{0}
{4}echo{0} {9}$?{0}
{4}echo{0} {9}$-{0}
{4}echo{0} {9}$${0}
{4}echo{0} {9}$!{0}
{4}echo{0} {9}$_{0}
{4}echo{0} ${7}%{0}
{4}echo{0} ${7}<{0}
{8}ifeth{7}=$({8}ls{0} {7}/{8}sys{7}/{8}class{7}/{8}net{0} {7}|{0} {8}grep{0} {7}^{5}"{9}$intf{5}"{0} {7}|{0} {8}grep{0} {5}"{9}$intf{5}"{0}${7}){0}

View File

@ -0,0 +1,11 @@
echo $*
echo $@
echo $?
echo $-
echo $$
echo $!
echo $_
echo $%
echo $<
ifeth=$(ls /sys/class/net | grep ^"$intf" | grep "$intf"$)

View File

@ -0,0 +1,12 @@
0 400 0 echo $*
0 400 0 echo $@
0 400 0 echo $?
0 400 0 echo $-
0 400 0 echo $$
0 400 0 echo $!
0 400 0 echo $_
0 400 0 echo $%
0 400 0 echo $<
1 400 0
0 400 0 ifeth=$(ls /sys/class/net | grep ^"$intf" | grep "$intf"$)
0 400 0

View File

@ -0,0 +1,11 @@
{4}echo{0} {9}$*{0}
{4}echo{0} {9}$@{0}
{4}echo{0} {9}$?{0}
{4}echo{0} {9}$-{0}
{4}echo{0} {9}$${0}
{4}echo{0} {9}$!{0}
{4}echo{0} {9}$_{0}
{4}echo{0} {9}$%{0}
{4}echo{0} {9}$<{0}
{8}ifeth{7}=$({8}ls{0} {7}/{8}sys{7}/{8}class{7}/{8}net{0} {7}|{0} {8}grep{0} {7}^{5}"{9}$intf{5}"{0} {7}|{0} {8}grep{0} {5}"{9}$intf{5}"{0}${7}){0}

View File

@ -0,0 +1,81 @@
# Nested elements and other complex cases
# String with backtick inclusion
"x`ls`"
# Nested string
"x`ls "*.c"`"
# Not terminated at first "
"x`ls" # "`" #
# String with command inclusion
"x$(ls)"
# Nested command
$(ls -la$(ls *.c))
# Check strings and backticks in command
echo $('ls' "." `ls` $'.' $".")
# $( not terminated by ) if contains unterminated string
$('x) # ') #
$("x) # ") #
$(`x) # `) # Bash doesn't like this
$($'x) # ') #
$($"x) # ") #
# Parameter expansion
var=abcdef
sub=abc
rep='& '
echo ${var/$sub/"${rep}}"} #
# issue 216
option="no[foo]"
option=${option%%[<{().[]*}
echo $option
# '$' in variable
echo $$PID
echo $var${var}
# Here-doc with internal elements
cat <<EOF
$scalar
${var}
$((1+2))
$(pwd)
`pwd`
EOF
# Quoted delimiter treats here-doc as simple string
cat <<"EOF"
$scalar
${var}
$((1+2))
$(pwd)
`pwd`
EOF
# Escaped same as quoted
cat <<\EOF
$scalar
EOF
# Nesting
echo "$((1 + 2))" #
echo "$[1 + 2]" #
# Multiple nesting levels
$(ls -la$(ls $(c) $'*.c' ` $(${s})`))
# Multi-line
$(ls |
more)
$(
`x`
"x"
`ls`
$'x'
$"x"
)
#end -- checks termination of previous

View File

@ -0,0 +1,82 @@
0 400 0 # Nested elements and other complex cases
1 400 0
0 400 0 # String with backtick inclusion
0 400 0 "x`ls`"
0 400 0 # Nested string
0 400 0 "x`ls "*.c"`"
0 400 0 # Not terminated at first "
0 400 0 "x`ls" # "`" #
1 400 0
0 400 0 # String with command inclusion
0 400 0 "x$(ls)"
1 400 0
0 400 0 # Nested command
0 400 0 $(ls -la$(ls *.c))
1 400 0
0 400 0 # Check strings and backticks in command
0 400 0 echo $('ls' "." `ls` $'.' $".")
1 400 0
0 400 0 # $( not terminated by ) if contains unterminated string
0 400 0 $('x) # ') #
0 400 0 $("x) # ") #
0 400 0 $(`x) # `) # Bash doesn't like this
0 400 0 $($'x) # ') #
0 400 0 $($"x) # ") #
1 400 0
0 400 0 # Parameter expansion
0 400 0 var=abcdef
0 400 0 sub=abc
0 400 0 rep='& '
0 400 0 echo ${var/$sub/"${rep}}"} #
0 400 0 # issue 216
0 400 0 option="no[foo]"
0 400 0 option=${option%%[<{().[]*}
0 400 0 echo $option
1 400 0
0 400 0 # '$' in variable
0 400 0 echo $$PID
0 400 0 echo $var${var}
1 400 0
0 400 0 # Here-doc with internal elements
2 400 0 + cat <<EOF
0 401 0 | $scalar
0 401 0 | ${var}
0 401 0 | $((1+2))
0 401 0 | $(pwd)
0 401 0 | `pwd`
0 401 0 | EOF
1 400 0
0 400 0 # Quoted delimiter treats here-doc as simple string
2 400 0 + cat <<"EOF"
0 401 0 | $scalar
0 401 0 | ${var}
0 401 0 | $((1+2))
0 401 0 | $(pwd)
0 401 0 | `pwd`
0 401 0 | EOF
1 400 0
0 400 0 # Escaped same as quoted
2 400 0 + cat <<\EOF
0 401 0 | $scalar
0 401 0 | EOF
1 400 0
0 400 0 # Nesting
0 400 0 echo "$((1 + 2))" #
0 400 0 echo "$[1 + 2]" #
1 400 0
0 400 0 # Multiple nesting levels
0 400 0 $(ls -la$(ls $(c) $'*.c' ` $(${s})`))
1 400 0
0 400 0 # Multi-line
0 400 0 $(ls |
0 400 0 more)
1 400 0
0 400 0 $(
0 400 0 `x`
0 400 0 "x"
0 400 0 `ls`
0 400 0 $'x'
0 400 0 $"x"
0 400 0 )
0 400 0 #end -- checks termination of previous
0 400 0

View File

@ -0,0 +1,81 @@
{2}# Nested elements and other complex cases{0}
{2}# String with backtick inclusion{0}
{5}"x`ls`"{0}
{2}# Nested string{0}
{5}"x`ls "*.c"`"{0}
{2}# Not terminated at first "{0}
{5}"x`ls" # "`"{0} {2}#{0}
{2}# String with command inclusion{0}
{5}"x$(ls)"{0}
{2}# Nested command{0}
{11}$(ls -la$(ls *.c)){0}
{2}# Check strings and backticks in command{0}
{4}echo{0} {11}$('ls' "." `ls` $'.' $"."){0}
{2}# $( not terminated by ) if contains unterminated string{0}
{11}$('x) # '){0} {2}#{0}
{11}$("x) # "){0} {2}#{0}
{11}$(`x) # `){0} {2}# Bash doesn't like this{0}
{11}$($'x) # '){0} {2}#{0}
{11}$($"x) # "){0} {2}#{0}
{2}# Parameter expansion{0}
{8}var{7}={8}abcdef{0}
{8}sub{7}={8}abc{0}
{8}rep{7}={6}'& '{0}
{4}echo{0} {10}${var/$sub/"${rep}}"}{0} {2}#{0}
{2}# issue 216{0}
{8}option{7}={5}"no[foo]"{0}
{8}option{7}={10}${option%%[<{().[]*}{0}
{4}echo{0} {9}$option{0}
{2}# '$' in variable{0}
{4}echo{0} {9}$${8}PID{0}
{4}echo{0} {9}$var{10}${var}{0}
{2}# Here-doc with internal elements{0}
{4}cat{0} {12}<<EOF{13}
$scalar
${var}
$((1+2))
$(pwd)
`pwd`
{12}EOF{0}
{2}# Quoted delimiter treats here-doc as simple string{0}
{4}cat{0} {12}<<"EOF"{13}
$scalar
${var}
$((1+2))
$(pwd)
`pwd`
{12}EOF{0}
{2}# Escaped same as quoted{0}
{4}cat{0} {12}<<\EOF{13}
$scalar
{12}EOF{0}
{2}# Nesting{0}
{4}echo{0} {5}"$((1 + 2))"{0} {2}#{0}
{4}echo{0} {5}"$[1 + 2]"{0} {2}#{0}
{2}# Multiple nesting levels{0}
{11}$(ls -la$(ls $(c) $'*.c' ` $(${s})`)){0}
{2}# Multi-line{0}
{11}$(ls |
more){0}
{11}$(
`x`
"x"
`ls`
$'x'
$"x"
){0}
{2}#end -- checks termination of previous{0}

View File

@ -0,0 +1,26 @@
# Use lexer.bash.command.substitution=2 to style command substitution
# so that both the scope of the command and the internal structure are visible.
# Nested command
$(ls -la$(ls *.c))
# Check strings and backticks in command
echo $('ls' "." `ls` $'.' $".")
PROJECT_DIR=$(rlwrap -S "Enter source path: " -e '' -i -o cat)
# Multiple nesting levels
$(ls -la$(ls $(c) $'*.c' ` $(${s})`))
# Multi-line
$(ls |
more)
$(
`x`
"x"
`ls`
$'x'
$"x"
)
#end -- checks termination of previous

View File

@ -0,0 +1,27 @@
2 400 0 + # Use lexer.bash.command.substitution=2 to style command substitution
0 401 0 | # so that both the scope of the command and the internal structure are visible.
1 400 0
0 400 0 # Nested command
0 400 0 $(ls -la$(ls *.c))
1 400 0
0 400 0 # Check strings and backticks in command
0 400 0 echo $('ls' "." `ls` $'.' $".")
1 400 0
0 400 0 PROJECT_DIR=$(rlwrap -S "Enter source path: " -e '' -i -o cat)
1 400 0
0 400 0 # Multiple nesting levels
0 400 0 $(ls -la$(ls $(c) $'*.c' ` $(${s})`))
1 400 0
0 400 0 # Multi-line
0 400 0 $(ls |
0 400 0 more)
1 400 0
0 400 0 $(
0 400 0 `x`
0 400 0 "x"
0 400 0 `ls`
0 400 0 $'x'
0 400 0 $"x"
0 400 0 )
0 400 0 #end -- checks termination of previous
0 400 0

View File

@ -0,0 +1,26 @@
{2}# Use lexer.bash.command.substitution=2 to style command substitution{0}
{2}# so that both the scope of the command and the internal structure are visible.{0}
{2}# Nested command{0}
{71}$({72}ls{64} {72}-la{71}$({72}ls{64} {71}*.{72}c{71})){0}
{2}# Check strings and backticks in command{0}
{4}echo{0} {71}$({70}'ls'{64} {69}"."{64} {75}`ls`{64} {69}$'.'{64} {69}$"."{71}){0}
{8}PROJECT_DIR{7}={71}$({72}rlwrap{64} {72}-S{64} {69}"Enter source path: "{64} {72}-e{64} {70}''{64} {72}-i{64} {72}-o{64} {72}cat{71}){0}
{2}# Multiple nesting levels{0}
{71}$({72}ls{64} {72}-la{71}$({72}ls{64} {71}$({72}c{71}){64} {69}$'*.c'{64} {75}` $(${s})`{71})){0}
{2}# Multi-line{0}
{71}$({72}ls{64} {71}|{64}
{72}more{71}){0}
{71}$({64}
{75}`x`{64}
{69}"x"{64}
{75}`ls`{64}
{69}$'x'{64}
{69}$"x"{64}
{71}){0}
{2}#end -- checks termination of previous{0}

View File

@ -0,0 +1,77 @@
# Nested elements and other complex cases
# String with backtick inclusion
"x`ls`"
# Nested string
"x`ls "*.c"`"
# Not terminated at first "
"x`ls" # "`" #
# String with command inclusion
"x$(ls)"
# Nested command
$(ls -la$(ls *.c))
# Check strings and backticks in command
echo $('ls' "." `ls` $'.' $".")
# $( not terminated by ) if contains unterminated string
$('x) # ') #
$("x) # ") #
$(`x) # `) # Bash doesn't like this
$($'x) # ') #
$($"x) # ") #
# Parameter expansion
var=abcdef
sub=abc
rep='& '
echo ${var/$sub/"${rep}}"} #
# '$' in variable
echo $$PID
echo $var${var}
# Here-doc with internal elements
cat <<EOF
$scalar
${var}
$((1+2))
$(pwd)
`pwd`
EOF
# Quoted delimiter treats here-doc as simple string
cat <<"EOF"
$scalar
${var}
$((1+2))
$(pwd)
`pwd`
EOF
# Escaped same as quoted
cat <<\EOF
$scalar
EOF
# Nesting
echo "$((1 + 2))" #
echo "$[1 + 2]" #
# Multiple nesting levels
$(ls -la$(ls $(c) $'*.c' ` $(${s})`))
# Multi-line
$(ls |
more)
$(
`x`
"x"
`ls`
$'x'
$"x"
)
#end -- checks termination of previous

View File

@ -0,0 +1,78 @@
0 400 0 # Nested elements and other complex cases
1 400 0
0 400 0 # String with backtick inclusion
0 400 0 "x`ls`"
0 400 0 # Nested string
0 400 0 "x`ls "*.c"`"
0 400 0 # Not terminated at first "
0 400 0 "x`ls" # "`" #
1 400 0
0 400 0 # String with command inclusion
0 400 0 "x$(ls)"
1 400 0
0 400 0 # Nested command
0 400 0 $(ls -la$(ls *.c))
1 400 0
0 400 0 # Check strings and backticks in command
0 400 0 echo $('ls' "." `ls` $'.' $".")
1 400 0
0 400 0 # $( not terminated by ) if contains unterminated string
0 400 0 $('x) # ') #
0 400 0 $("x) # ") #
0 400 0 $(`x) # `) # Bash doesn't like this
0 400 0 $($'x) # ') #
0 400 0 $($"x) # ") #
1 400 0
0 400 0 # Parameter expansion
0 400 0 var=abcdef
0 400 0 sub=abc
0 400 0 rep='& '
0 400 0 echo ${var/$sub/"${rep}}"} #
1 400 0
0 400 0 # '$' in variable
0 400 0 echo $$PID
0 400 0 echo $var${var}
1 400 0
0 400 0 # Here-doc with internal elements
2 400 0 + cat <<EOF
0 401 0 | $scalar
0 401 0 | ${var}
0 401 0 | $((1+2))
0 401 0 | $(pwd)
0 401 0 | `pwd`
0 401 0 | EOF
1 400 0
0 400 0 # Quoted delimiter treats here-doc as simple string
2 400 0 + cat <<"EOF"
0 401 0 | $scalar
0 401 0 | ${var}
0 401 0 | $((1+2))
0 401 0 | $(pwd)
0 401 0 | `pwd`
0 401 0 | EOF
1 400 0
0 400 0 # Escaped same as quoted
2 400 0 + cat <<\EOF
0 401 0 | $scalar
0 401 0 | EOF
1 400 0
0 400 0 # Nesting
0 400 0 echo "$((1 + 2))" #
0 400 0 echo "$[1 + 2]" #
1 400 0
0 400 0 # Multiple nesting levels
0 400 0 $(ls -la$(ls $(c) $'*.c' ` $(${s})`))
1 400 0
0 400 0 # Multi-line
0 400 0 $(ls |
0 400 0 more)
1 400 0
0 400 0 $(
0 400 0 `x`
0 400 0 "x"
0 400 0 `ls`
0 400 0 $'x'
0 400 0 $"x"
0 400 0 )
0 400 0 #end -- checks termination of previous
0 400 0

View File

@ -0,0 +1,77 @@
{2}# Nested elements and other complex cases{0}
{2}# String with backtick inclusion{0}
{5}"x{11}`ls`{5}"{0}
{2}# Nested string{0}
{5}"x{11}`ls {5}"*.c"{11}`{5}"{0}
{2}# Not terminated at first "{0}
{5}"x{11}`ls{5}" # "{11}`{5}"{0} {2}#{0}
{2}# String with command inclusion{0}
{5}"x{7}$({8}ls{7}){5}"{0}
{2}# Nested command{0}
{7}$({8}ls{0} {8}-la{7}$({8}ls{0} {7}*.{8}c{7})){0}
{2}# Check strings and backticks in command{0}
{4}echo{0} {7}$({6}'ls'{0} {5}"."{0} {11}`ls`{0} {5}$'.'{0} {5}$"."{7}){0}
{2}# $( not terminated by ) if contains unterminated string{0}
{7}$({6}'x) # '{7}){0} {2}#{0}
{7}$({5}"x) # "{7}){0} {2}#{0}
{7}$({11}`x) # `{7}){0} {2}# Bash doesn't like this{0}
{7}$({5}$'x) # '{7}){0} {2}#{0}
{7}$({5}$"x) # "{7}){0} {2}#{0}
{2}# Parameter expansion{0}
{8}var{7}={8}abcdef{0}
{8}sub{7}={8}abc{0}
{8}rep{7}={6}'& '{0}
{4}echo{0} {10}${var/{9}$sub{10}/{5}"{10}${rep}{5}}"{10}}{0} {2}#{0}
{2}# '$' in variable{0}
{4}echo{0} {9}$${8}PID{0}
{4}echo{0} {9}$var{10}${var}{0}
{2}# Here-doc with internal elements{0}
{4}cat{0} {12}<<EOF{13}
{9}$scalar{13}
{10}${var}{13}
{7}$(({3}1{7}+{3}2{7})){13}
{7}$({4}pwd{7}){13}
{11}`pwd`{13}
{12}EOF{0}
{2}# Quoted delimiter treats here-doc as simple string{0}
{4}cat{0} {12}<<"EOF"{13}
$scalar
${var}
$((1+2))
$(pwd)
`pwd`
{12}EOF{0}
{2}# Escaped same as quoted{0}
{4}cat{0} {12}<<\EOF{13}
$scalar
{12}EOF{0}
{2}# Nesting{0}
{4}echo{0} {5}"{7}$(({3}1{0} {7}+{0} {3}2{7})){5}"{0} {2}#{0}
{4}echo{0} {5}"{7}$[{3}1{0} {7}+{0} {3}2{7}]{5}"{0} {2}#{0}
{2}# Multiple nesting levels{0}
{7}$({8}ls{0} {8}-la{7}$({8}ls{0} {7}$({8}c{7}){0} {5}$'*.c'{0} {11}` {7}$({10}${s}{7}){11}`{7})){0}
{2}# Multi-line{0}
{7}$({8}ls{0} {7}|{0}
{8}more{7}){0}
{7}$({0}
{11}`x`{0}
{5}"x"{0}
{11}`ls`{0}
{5}$'x'{0}
{5}$"x"{0}
{7}){0}
{2}#end -- checks termination of previous{0}

View File

@ -0,0 +1,41 @@
lexer.*.bsh;*.zsh=bash
fold=1
fold.comment=1
keywords.*.bsh;*.zsh=case cat do done echo else esac exit export fi find for if in print pwd set setopt then while
# Can use substyles for identifiers and scalars
substyles.bash.8=1
substylewords.8.1.*.bsh=map
substyles.bash.9=1
substylewords.9.1.*.bsh=CWD
lexer.bash.styling.inside.string=0
lexer.bash.styling.inside.backticks=0
lexer.bash.styling.inside.parameter=0
lexer.bash.styling.inside.heredoc=0
lexer.bash.command.substitution=0
match Issue180.bsh
lexer.bash.styling.inside.string=1
match Issue182.bsh
lexer.bash.styling.inside.string=1
match Issue184.bsh
lexer.bash.styling.inside.string=1
lexer.bash.command.substitution=1
match Issue184Copy.bsh
lexer.bash.styling.inside.string=1
lexer.bash.command.substitution=1
lexer.bash.special.parameter=*@#?-$!%<
match NestedStyledInside.bsh
lexer.bash.styling.inside.string=1
lexer.bash.styling.inside.backticks=1
lexer.bash.styling.inside.parameter=1
lexer.bash.styling.inside.heredoc=1
lexer.bash.command.substitution=1
match NestedRich.bsh
lexer.bash.command.substitution=2

View File

@ -0,0 +1,15 @@
# Tests for line continuation.
# Issue #195.
#backslash1\
echo 1
#backslash2\\
echo 2
if [ 1 ]; then
backslash1=A\
fi
backslash2=B\\
fi
echo $backslash1, $backslash2

View File

@ -0,0 +1,16 @@
2 400 0 + # Tests for line continuation.
0 401 0 | # Issue #195.
1 400 0
0 400 0 #backslash1\
0 400 0 echo 1
0 400 0 #backslash2\\
0 400 0 echo 2
1 400 0
2 400 0 + if [ 1 ]; then
0 401 0 | backslash1=A\
0 401 0 | fi
0 401 0 | backslash2=B\\
0 401 0 | fi
1 400 0
0 400 0 echo $backslash1, $backslash2
0 400 0

View File

@ -0,0 +1,15 @@
{2}# Tests for line continuation.{0}
{2}# Issue #195.{0}
{2}#backslash1\{0}
{4}echo{0} {3}1{0}
{2}#backslash2\\{0}
{4}echo{0} {3}2{0}
{4}if{0} {7}[{0} {3}1{0} {7}];{0} {4}then{0}
{8}backslash1{7}={8}A{7}\{0}
{8}fi{0}
{8}backslash2{7}={8}B\\{0}
{4}fi{0}
{4}echo{0} {9}$backslash1{7},{0} {9}$backslash2{0}

View File

@ -0,0 +1,51 @@
#!/bin/zsh
# Tests for zsh extensions
# Can be executed by zsh with reasonable results
# Some of these were implemented by commit [87286d] for Scintilla bug #1794
# https://zsh.sourceforge.io/Doc/Release/Expansion.html
# Where # does not start a comment
## Formatting base
print $(( [#8] y = 33 ))
print $(( [##8] 32767 ))
# Formatting base and grouping
print $(( [#16_4] 65536 ** 2 ))
## Character values
print $(( ##T+0 ))
print $(( ##^G+0 ))
# Failure: does not work when - included for bindkey syntax. \M-\C-x means Meta+Ctrl+x.
print $(( ##\M-\C-x+0 ))
# Value of first character of variable in expression
var=Tree
print $(( #var+0 ))
## Extended glob
setopt extended_glob
# # is similar to *, ## similar to +
echo [A-Za-z]#.bsh
echo [A-Za-z]##.bsh
# 13 character file names
echo **/[a-zA-Z.](#c13)
# 13-15 character file names
echo **/[a-zA-Z.](#c13,15)
## Glob flag
# i=case-insensitive
echo (#i)a*
# b=back-references
foo="a_string_with_a_message"
if [[ $foo = (a|an)_(#b)(*) ]]; then
print ${foo[$mbegin[1],$mend[1]]}
fi

View File

@ -0,0 +1,52 @@
2 400 0 + #!/bin/zsh
0 401 0 | # Tests for zsh extensions
0 401 0 | # Can be executed by zsh with reasonable results
0 401 0 | # Some of these were implemented by commit [87286d] for Scintilla bug #1794
0 401 0 | # https://zsh.sourceforge.io/Doc/Release/Expansion.html
1 400 0
0 400 0 # Where # does not start a comment
1 400 0
1 400 0
0 400 0 ## Formatting base
0 400 0 print $(( [#8] y = 33 ))
0 400 0 print $(( [##8] 32767 ))
1 400 0
0 400 0 # Formatting base and grouping
0 400 0 print $(( [#16_4] 65536 ** 2 ))
1 400 0
1 400 0
0 400 0 ## Character values
0 400 0 print $(( ##T+0 ))
0 400 0 print $(( ##^G+0 ))
0 400 0 # Failure: does not work when - included for bindkey syntax. \M-\C-x means Meta+Ctrl+x.
0 400 0 print $(( ##\M-\C-x+0 ))
1 400 0
0 400 0 # Value of first character of variable in expression
0 400 0 var=Tree
0 400 0 print $(( #var+0 ))
1 400 0
1 400 0
0 400 0 ## Extended glob
0 400 0 setopt extended_glob
1 400 0
0 400 0 # # is similar to *, ## similar to +
0 400 0 echo [A-Za-z]#.bsh
0 400 0 echo [A-Za-z]##.bsh
1 400 0
0 400 0 # 13 character file names
0 400 0 echo **/[a-zA-Z.](#c13)
0 400 0 # 13-15 character file names
0 400 0 echo **/[a-zA-Z.](#c13,15)
1 400 0
1 400 0
0 400 0 ## Glob flag
1 400 0
0 400 0 # i=case-insensitive
0 400 0 echo (#i)a*
1 400 0
0 400 0 # b=back-references
0 400 0 foo="a_string_with_a_message"
2 400 0 + if [[ $foo = (a|an)_(#b)(*) ]]; then
0 401 0 | print ${foo[$mbegin[1],$mend[1]]}
0 401 0 | fi
0 400 0

View File

@ -0,0 +1,51 @@
{2}#!/bin/zsh{0}
{2}# Tests for zsh extensions{0}
{2}# Can be executed by zsh with reasonable results{0}
{2}# Some of these were implemented by commit [87286d] for Scintilla bug #1794{0}
{2}# https://zsh.sourceforge.io/Doc/Release/Expansion.html{0}
{2}# Where # does not start a comment{0}
{2}## Formatting base{0}
{4}print{0} {7}$(({0} {7}[{8}#8{7}]{0} {8}y{0} {7}={0} {3}33{0} {7})){0}
{4}print{0} {7}$(({0} {7}[{8}##8{7}]{0} {3}32767{0} {7})){0}
{2}# Formatting base and grouping{0}
{4}print{0} {7}$(({0} {7}[{8}#16_4{7}]{0} {3}65536{0} {7}**{0} {3}2{0} {7})){0}
{2}## Character values{0}
{4}print{0} {7}$(({0} {8}##T{7}+{3}0{0} {7})){0}
{4}print{0} {7}$(({0} {8}##^G{7}+{3}0{0} {7})){0}
{2}# Failure: does not work when - included for bindkey syntax. \M-\C-x means Meta+Ctrl+x.{0}
{4}print{0} {7}$(({0} {8}##\M{7}-{8}\C{7}-{8}x{7}+{3}0{0} {7})){0}
{2}# Value of first character of variable in expression{0}
{8}var{7}={8}Tree{0}
{4}print{0} {7}$(({0} {8}#var{7}+{3}0{0} {7})){0}
{2}## Extended glob{0}
{4}setopt{0} {8}extended_glob{0}
{2}# # is similar to *, ## similar to +{0}
{4}echo{0} {7}[{8}A-Za-z{7}]{8}#.bsh{0}
{4}echo{0} {7}[{8}A-Za-z{7}]{8}##.bsh{0}
{2}# 13 character file names{0}
{4}echo{0} {7}**/[{8}a-zA-Z.{7}]{8}(#c13){0}
{2}# 13-15 character file names{0}
{4}echo{0} {7}**/[{8}a-zA-Z.{7}]{8}(#c13,15){0}
{2}## Glob flag{0}
{2}# i=case-insensitive{0}
{4}echo{0} {8}(#i)a{7}*{0}
{2}# b=back-references{0}
{8}foo{7}={5}"a_string_with_a_message"{0}
{4}if{0} {7}[[{0} {9}$foo{0} {7}={0} {7}({8}a{7}|{8}an{7}){8}_(#b){7}(*){0} {7}]];{0} {4}then{0}
{4}print{0} {10}${foo[$mbegin[1],$mend[1]]}{0}
{4}fi{0}

View File

@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -e
# -----------------------------------------------------------------------------
# Voluptatem dolore magnam eius quisquam eius dolor labore. Porro dolor amet ut.
# Numquam labore amet modi. Dolorem velit numquam porro est quiquia ipsum quisquam.
# Magnam consectetur est voluptatem aliquam adipisci. Sed dolorem quaerat quiquia.
# -----------------------------------------------------------------------------
export PYTHONPATH="scripts:$PYTHONPATH"
if [[ -z "$1" ]]; then
PROJECT_DIR=$(rlwrap -S "Enter source path: " -e '' -i -o cat)
PROJECT_PATH="$(pwd)/$PROJECT_DIR"
else
PROJECT_PATH="$(pwd)/${1}"
fi
OUT_FILE=${PROJECT_PATH}/testing.txt
(cat<<EOF
Last run $(date +'%Y-%m-%d') at $(date +'%H:%M:%S.%2N')
EOF
) > $OUT_FILE
# Issue 188, keyword before redirection operator
pwd>>$OUT_FILE
find "$PROJECT_PATH/src" -maxdepth 1 -type f |\
while read -r f; do
{
python3 -c "print();print('='*50)";\
echo `basename "$f"` | tr -d 'x';\
python3 -c "print('='*50)";\
python3 "$f";\
} >> $OUT_FILE
done
# Issue 137, should be shift but here-doc was detected
echo $(( x << END ))
pwd
END
# Issue 194, failed to understand character escaping so string unterminated
echo "foo `echo foo \\" bar` bar"
echo "xinput set-prop bla \"blub\" `grep bla $WRITE_APPENDIX/var/lib/path.txt | cut -d \\" -f 4`" >/some_file.sh
# Issue 194, $ before end of backticks is literal
echo `echo \$`
echo `echo \$bar\$`
echo `echo $`
echo `echo $bar$`
INVALID_NUMBER=0#0000

View File

@ -0,0 +1,53 @@
0 400 0 #!/usr/bin/env bash
0 400 0 set -e
2 400 0 + # -----------------------------------------------------------------------------
0 401 0 | # Voluptatem dolore magnam eius quisquam eius dolor labore. Porro dolor amet ut.
0 401 0 | # Numquam labore amet modi. Dolorem velit numquam porro est quiquia ipsum quisquam.
0 401 0 | # Magnam consectetur est voluptatem aliquam adipisci. Sed dolorem quaerat quiquia.
0 401 0 | # -----------------------------------------------------------------------------
0 400 0 export PYTHONPATH="scripts:$PYTHONPATH"
1 400 0
2 400 0 + if [[ -z "$1" ]]; then
0 401 0 | PROJECT_DIR=$(rlwrap -S "Enter source path: " -e '' -i -o cat)
0 401 0 | PROJECT_PATH="$(pwd)/$PROJECT_DIR"
0 401 0 | else
0 401 0 | PROJECT_PATH="$(pwd)/${1}"
0 401 0 | fi
1 400 0
0 400 0 OUT_FILE=${PROJECT_PATH}/testing.txt
1 400 0
2 400 0 + (cat<<EOF
0 401 0 | Last run $(date +'%Y-%m-%d') at $(date +'%H:%M:%S.%2N')
0 401 0 | EOF
0 400 0 ) > $OUT_FILE
1 400 0
0 400 0 # Issue 188, keyword before redirection operator
0 400 0 pwd>>$OUT_FILE
1 400 0
0 400 0 find "$PROJECT_PATH/src" -maxdepth 1 -type f |\
2 400 0 + while read -r f; do
2 401 0 + {
0 402 0 | python3 -c "print();print('='*50)";\
0 402 0 | echo `basename "$f"` | tr -d 'x';\
0 402 0 | python3 -c "print('='*50)";\
0 402 0 | python3 "$f";\
0 402 0 | } >> $OUT_FILE
0 401 0 | done
1 400 0
0 400 0 # Issue 137, should be shift but here-doc was detected
0 400 0 echo $(( x << END ))
0 400 0 pwd
0 400 0 END
1 400 0
0 400 0 # Issue 194, failed to understand character escaping so string unterminated
0 400 0 echo "foo `echo foo \\" bar` bar"
0 400 0 echo "xinput set-prop bla \"blub\" `grep bla $WRITE_APPENDIX/var/lib/path.txt | cut -d \\" -f 4`" >/some_file.sh
1 400 0
0 400 0 # Issue 194, $ before end of backticks is literal
0 400 0 echo `echo \$`
0 400 0 echo `echo \$bar\$`
0 400 0 echo `echo $`
0 400 0 echo `echo $bar$`
1 400 0
0 400 0 INVALID_NUMBER=0#0000
0 400 0

View File

@ -0,0 +1,52 @@
{2}#!/usr/bin/env bash{0}
{4}set{0} {8}-e{0}
{2}# -----------------------------------------------------------------------------{0}
{2}# Voluptatem dolore magnam eius quisquam eius dolor labore. Porro dolor amet ut.{0}
{2}# Numquam labore amet modi. Dolorem velit numquam porro est quiquia ipsum quisquam.{0}
{2}# Magnam consectetur est voluptatem aliquam adipisci. Sed dolorem quaerat quiquia.{0}
{2}# -----------------------------------------------------------------------------{0}
{4}export{0} {8}PYTHONPATH{7}={5}"scripts:$PYTHONPATH"{0}
{4}if{0} {7}[[{0} {4}-z{0} {5}"$1"{0} {7}]];{0} {4}then{0}
{8}PROJECT_DIR{7}={11}$(rlwrap -S "Enter source path: " -e '' -i -o cat){0}
{8}PROJECT_PATH{7}={5}"$(pwd)/$PROJECT_DIR"{0}
{4}else{0}
{8}PROJECT_PATH{7}={5}"$(pwd)/${1}"{0}
{4}fi{0}
{8}OUT_FILE{7}={10}${PROJECT_PATH}{7}/{8}testing.txt{0}
{7}({4}cat{12}<<EOF{13}
Last run $(date +'%Y-%m-%d') at $(date +'%H:%M:%S.%2N')
{12}EOF{0}
{7}){0} {7}>{0} {9}$OUT_FILE{0}
{2}# Issue 188, keyword before redirection operator{0}
{4}pwd{7}>>{9}$OUT_FILE{0}
{4}find{0} {5}"$PROJECT_PATH/src"{0} {8}-maxdepth{0} {3}1{0} {8}-type{0} {8}f{0} {7}|\{0}
{4}while{0} {8}read{0} {8}-r{0} {8}f{7};{0} {4}do{0}
{7}{{0}
{8}python3{0} {8}-c{0} {5}"print();print('='*50)"{7};\{0}
{4}echo{0} {11}`basename "$f"`{0} {7}|{0} {8}tr{0} {8}-d{0} {6}'x'{7};\{0}
{8}python3{0} {8}-c{0} {5}"print('='*50)"{7};\{0}
{8}python3{0} {5}"$f"{7};\{0}
{7}}{0} {7}>>{0} {9}$OUT_FILE{0}
{4}done{0}
{2}# Issue 137, should be shift but here-doc was detected{0}
{4}echo{0} {7}$(({0} {8}x{0} {7}<<{0} {8}END{0} {7})){0}
{4}pwd{0}
{8}END{0}
{2}# Issue 194, failed to understand character escaping so string unterminated{0}
{4}echo{0} {5}"foo `echo foo \\" bar` bar"{0}
{4}echo{0} {5}"xinput set-prop bla \"blub\" `grep bla $WRITE_APPENDIX/var/lib/path.txt | cut -d \\" -f 4`"{0} {7}>/{8}some_file.sh{0}
{2}# Issue 194, $ before end of backticks is literal{0}
{4}echo{0} {11}`echo \$`{0}
{4}echo{0} {11}`echo \$bar\$`{0}
{4}echo{0} {11}`echo $`{0}
{4}echo{0} {11}`echo $bar$`{0}
{8}INVALID_NUMBER{7}={1}0#0000{0}

View File

@ -0,0 +1,39 @@
rem remark and comment bug
findstr /c:"rem this" "file"
findstr /c:":: this" "file"
:: SingleQuoted command string
for /f %%A in ('rem this') do echo %%A
:: DoubleQuoted string
for /f %%A in ("rem this") do echo %%A
:: BackQuote command string
for /f "usebackq" %%A in (`rem this`) do echo %%A
:: Test the handling of quotes ' and " and escape ^
:: Comment
:: With quotes
":: Text
"":: Comment
':: Text
'':: Comment
:: Mixing quotes - likely incorrect as lexer tries ' and " separately, leaving an active quote
"'":: Text
:: With escapes
^:: Text
^":: Comment
^"":: Text
^""":: Comment
^^":: Text
^^"":: Comment
^^""":: Text
:: With preceding command
mkdir archive ":: Text
mkdir archive "":: Comment
mkdir archive ^":: Comment
mkdir archive ^"":: Text

View File

@ -0,0 +1,40 @@
0 400 0 rem remark and comment bug
0 400 0
0 400 0 findstr /c:"rem this" "file"
0 400 0 findstr /c:":: this" "file"
0 400 0
0 400 0 :: SingleQuoted command string
0 400 0 for /f %%A in ('rem this') do echo %%A
0 400 0
0 400 0 :: DoubleQuoted string
0 400 0 for /f %%A in ("rem this") do echo %%A
0 400 0
0 400 0 :: BackQuote command string
0 400 0 for /f "usebackq" %%A in (`rem this`) do echo %%A
0 400 0
0 400 0 :: Test the handling of quotes ' and " and escape ^
0 400 0 :: Comment
0 400 0
0 400 0 :: With quotes
0 400 0 ":: Text
0 400 0 "":: Comment
0 400 0 ':: Text
0 400 0 '':: Comment
0 400 0 :: Mixing quotes - likely incorrect as lexer tries ' and " separately, leaving an active quote
0 400 0 "'":: Text
0 400 0
0 400 0 :: With escapes
0 400 0 ^:: Text
0 400 0 ^":: Comment
0 400 0 ^"":: Text
0 400 0 ^""":: Comment
0 400 0 ^^":: Text
0 400 0 ^^"":: Comment
0 400 0 ^^""":: Text
0 400 0
0 400 0 :: With preceding command
0 400 0 mkdir archive ":: Text
0 400 0 mkdir archive "":: Comment
0 400 0 mkdir archive ^":: Comment
0 400 0 mkdir archive ^"":: Text
0 400 0

View File

@ -0,0 +1,39 @@
{1}rem remark and comment bug
{0}
{5}findstr{0} /c:"rem this" "file"
{5}findstr{0} /c:":: this" "file"
{1}:: SingleQuoted command string
{2}for{0} /f {6}%%A{2} in{0} ('rem this'){2} do echo{0} {6}%%A{0}
{1}:: DoubleQuoted string
{2}for{0} /f {6}%%A{2} in{0} ("rem this"){2} do echo{0} {6}%%A{0}
{1}:: BackQuote command string
{2}for{0} /f "usebackq" {6}%%A{2} in{0} (`rem this`){2} do echo{0} {6}%%A{0}
{1}:: Test the handling of quotes ' and " and escape ^
:: Comment
{0}
{1}:: With quotes
{0}":: Text
""{1}:: Comment
{0}':: Text
''{1}:: Comment
:: Mixing quotes - likely incorrect as lexer tries ' and " separately, leaving an active quote
{0}"'":: Text
{1}:: With escapes
{5}^::{0} Text
{5}^{0}"{1}:: Comment
{5}^{0}"":: Text
{5}^{0}"""{1}:: Comment
{5}^^{0}":: Text
{5}^^{0}""{1}:: Comment
{5}^^{0}""":: Text
{1}:: With preceding command
{5}mkdir{0} archive ":: Text
{5}mkdir{0} archive ""{1}:: Comment
{5}mkdir{0} archive ^"{1}:: Comment
{5}mkdir{0} archive ^"":: Text

View File

@ -0,0 +1,26 @@
rem Keywords with colon
rem with spacing
call file.bat arg1
call "file.bat" arg1
call :label arg1
goto :label
goto :eof
goto label
echo: %var%
echo: text
echo text
rem no spacing
call:label arg1
goto:label
goto:eof
echo:%var%
echo:text
(call)
(echo:)
(goto)
rem call internal commands
call echo text
call set "a=b"

View File

@ -0,0 +1,27 @@
0 400 0 rem Keywords with colon
0 400 0
0 400 0 rem with spacing
0 400 0 call file.bat arg1
0 400 0 call "file.bat" arg1
0 400 0 call :label arg1
0 400 0 goto :label
0 400 0 goto :eof
0 400 0 goto label
0 400 0 echo: %var%
0 400 0 echo: text
0 400 0 echo text
0 400 0
0 400 0 rem no spacing
0 400 0 call:label arg1
0 400 0 goto:label
0 400 0 goto:eof
0 400 0 echo:%var%
0 400 0 echo:text
0 400 0 (call)
0 400 0 (echo:)
0 400 0 (goto)
0 400 0
0 400 0 rem call internal commands
0 400 0 call echo text
0 400 0 call set "a=b"
0 400 0

View File

@ -0,0 +1,26 @@
{1}rem Keywords with colon
{0}
{1}rem with spacing
{2}call{5} file.bat{0} arg1
{2}call{0} "file.bat" arg1
{2}call{0} :label arg1
{2}goto{0} :label
{2}goto{0} :eof
{2}goto{0} label
{2}echo{0}: {6}%var%{0}
{2}echo{0}: text
{2}echo{0} text
{1}rem no spacing
{2}call{0}:label arg1
{2}goto{0}:label
{2}goto{0}:eof
{2}echo{0}:{6}%var%{0}
{2}echo{0}:text
({2}call{0})
({2}echo{0}:)
({2}goto{0})
{1}rem call internal commands
{2}call echo{0} text
{2}call set{0} "a=b"

View File

@ -0,0 +1,3 @@
lexer.*.bat=batch
keywords.*.bat=call defined do echo else errorlevel exist exit for goto if in not set

View File

@ -0,0 +1,63 @@
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
: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

View File

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

View File

@ -0,0 +1,63 @@
{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}
{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

View File

@ -0,0 +1,49 @@
(* Enumerate all styles: 0 to 15 *)
(* comment=12 *)
(* whitespace=0 *)
(* w *)
(* identifier=1 *)
ident
(* tagname=2 *)
`ident
(* keyword=3 *)
and
(* keyword2=4 *)
None
(* keyword3=5 *)
char
(* linenum=6 *)
#12
(* operator=7 *)
*
(* number=8 *)
12
(* char=9 *)
'a'
(* white=10 *)
(* this state can not be reached in caml mode, only SML mode but that stops other states *)
(* SML mode is triggered by "andalso" being in the keywords *)
"\ \x"
(* string=11 *)
"string"
(* comment1=13 *)
(* (* comment 1 *) *)
(* comment2=14 *)
(* (* (* comment 2 *) *) *)
(* comment3=15 *)
(* (* (* (* comment 1 *) *) *) *)

View File

@ -0,0 +1,50 @@
0 400 0 (* Enumerate all styles: 0 to 15 *)
0 400 0 (* comment=12 *)
0 400 0
0 400 0 (* whitespace=0 *)
0 400 0 (* w *)
0 400 0
0 400 0 (* identifier=1 *)
0 400 0 ident
0 400 0
0 400 0 (* tagname=2 *)
0 400 0 `ident
0 400 0
0 400 0 (* keyword=3 *)
0 400 0 and
0 400 0
0 400 0 (* keyword2=4 *)
0 400 0 None
0 400 0
0 400 0 (* keyword3=5 *)
0 400 0 char
0 400 0
0 400 0 (* linenum=6 *)
0 400 0 #12
0 400 0
0 400 0 (* operator=7 *)
0 400 0 *
0 400 0
0 400 0 (* number=8 *)
0 400 0 12
0 400 0
0 400 0 (* char=9 *)
0 400 0 'a'
0 400 0
0 400 0 (* white=10 *)
0 400 0 (* this state can not be reached in caml mode, only SML mode but that stops other states *)
0 400 0 (* SML mode is triggered by "andalso" being in the keywords *)
0 400 0 "\ \x"
0 400 0
0 400 0 (* string=11 *)
0 400 0 "string"
0 400 0
0 400 0 (* comment1=13 *)
0 400 0 (* (* comment 1 *) *)
0 400 0
0 400 0 (* comment2=14 *)
0 400 0 (* (* (* comment 2 *) *) *)
0 400 0
0 400 0 (* comment3=15 *)
0 400 0 (* (* (* (* comment 1 *) *) *) *)
0 400 0

View File

@ -0,0 +1,49 @@
{12}(* Enumerate all styles: 0 to 15 *){0}
{12}(* comment=12 *){0}
{12}(* whitespace=0 *){0}
{12}(* w *){0}
{12}(* identifier=1 *){0}
{1}ident{0}
{12}(* tagname=2 *){0}
{2}`ident{0}
{12}(* keyword=3 *){0}
{3}and{0}
{12}(* keyword2=4 *){0}
{4}None{0}
{12}(* keyword3=5 *){0}
{5}char{0}
{12}(* linenum=6 *){0}
{6}#12{0}
{12}(* operator=7 *){0}
{7}*{0}
{12}(* number=8 *){0}
{8}12{0}
{12}(* char=9 *){0}
{9}'a'{0}
{12}(* white=10 *){0}
{12}(* this state can not be reached in caml mode, only SML mode but that stops other states *){0}
{12}(* SML mode is triggered by "andalso" being in the keywords *){0}
{11}"\ \x"{0}
{12}(* string=11 *){0}
{11}"string"{0}
{12}(* comment1=13 *){0}
{12}(* {13}(* comment 1 *){12} *){0}
{12}(* comment2=14 *){0}
{12}(* {13}(* {14}(* comment 2 *){13} *){12} *){0}
{12}(* comment3=15 *){0}
{12}(* {13}(* {14}(* {15}(* comment 1 *){14} *){13} *){12} *){0}

View File

@ -0,0 +1,4 @@
lexer.*.ml=caml
keywords.*.ml=and xandalso
keywords2.*.ml=None
keywords3.*.ml=char

View File

@ -0,0 +1,25 @@
if(MSVC80)
# 1
elseif(MSVC90)
# 2
elseif(APPLE)
# 3
else()
# 4
endif()
if(MSVC80)
# 1
elseif(MSVC90)
# 2
endif()
if(MSVC80)
# 1
else()
# 2
endif()
if(MSVC80)
# 1
endif()

View File

@ -0,0 +1,26 @@
2 400 401 + if(MSVC80)
0 401 401 | # 1
0 401 401 | elseif(MSVC90)
0 401 401 | # 2
0 401 401 | elseif(APPLE)
0 401 401 | # 3
0 401 401 | else()
0 401 401 | # 4
0 401 400 | endif()
0 400 400
2 400 401 + if(MSVC80)
0 401 401 | # 1
0 401 401 | elseif(MSVC90)
0 401 401 | # 2
0 401 400 | endif()
0 400 400
2 400 401 + if(MSVC80)
0 401 401 | # 1
0 401 401 | else()
0 401 401 | # 2
0 401 400 | endif()
0 400 400
2 400 401 + if(MSVC80)
0 401 401 | # 1
0 401 400 | endif()
0 400 400

View File

@ -0,0 +1,25 @@
{11}if{0}({6}MSVC80{0})
{1}# 1{0}
{11}elseif{0}({6}MSVC90{0})
{1}# 2{0}
{11}elseif{0}({6}APPLE{0})
{1}# 3{0}
{11}else{0}()
{1}# 4{0}
{11}endif{0}()
{11}if{0}({6}MSVC80{0})
{1}# 1{0}
{11}elseif{0}({6}MSVC90{0})
{1}# 2{0}
{11}endif{0}()
{11}if{0}({6}MSVC80{0})
{1}# 1{0}
{11}else{0}()
{1}# 2{0}
{11}endif{0}()
{11}if{0}({6}MSVC80{0})
{1}# 1{0}
{11}endif{0}()

View File

@ -0,0 +1,25 @@
if(MSVC80)
# 1
elseif(MSVC90)
# 2
elseif(APPLE)
# 3
else()
# 4
endif()
if(MSVC80)
# 1
elseif(MSVC90)
# 2
endif()
if(MSVC80)
# 1
else()
# 2
endif()
if(MSVC80)
# 1
endif()

View File

@ -0,0 +1,26 @@
2 400 401 + if(MSVC80)
0 401 400 | # 1
2 400 401 + elseif(MSVC90)
0 401 400 | # 2
2 400 401 + elseif(APPLE)
0 401 400 | # 3
2 400 401 + else()
0 401 401 | # 4
0 401 400 | endif()
0 400 400
2 400 401 + if(MSVC80)
0 401 400 | # 1
2 400 401 + elseif(MSVC90)
0 401 401 | # 2
0 401 400 | endif()
0 400 400
2 400 401 + if(MSVC80)
0 401 400 | # 1
2 400 401 + else()
0 401 401 | # 2
0 401 400 | endif()
0 400 400
2 400 401 + if(MSVC80)
0 401 401 | # 1
0 401 400 | endif()
0 400 400

View File

@ -0,0 +1,25 @@
{11}if{0}({6}MSVC80{0})
{1}# 1{0}
{11}elseif{0}({6}MSVC90{0})
{1}# 2{0}
{11}elseif{0}({6}APPLE{0})
{1}# 3{0}
{11}else{0}()
{1}# 4{0}
{11}endif{0}()
{11}if{0}({6}MSVC80{0})
{1}# 1{0}
{11}elseif{0}({6}MSVC90{0})
{1}# 2{0}
{11}endif{0}()
{11}if{0}({6}MSVC80{0})
{1}# 1{0}
{11}else{0}()
{1}# 2{0}
{11}endif{0}()
{11}if{0}({6}MSVC80{0})
{1}# 1{0}
{11}endif{0}()

View File

@ -0,0 +1,7 @@
lexer.*.cmake=cmake
keywords2.*.cmake=MSVC80 MSVC90 APPLE
fold=1
fold.at.else=0
match Bug77_1.cmake
fold.at.else=1

View File

@ -0,0 +1,10 @@
* Fix string style to not continue to next line
DISPLAY MESSAGE BOX
"The following process must be applied to Earnings, Deduct
- "ions and Company Contributions separately."
LP61A DISPLAY MESSAGE BOX
lp61b "S*** strives to continually develop and improve its pr
LP61B - "oducts and services to deliver more value to our custo
LP61B - "mers."

View File

@ -0,0 +1,11 @@
0 400 0 * Fix string style to not continue to next line
0 400 0
0 400 0 DISPLAY MESSAGE BOX
0 400 0 "The following process must be applied to Earnings, Deduct
0 400 0 - "ions and Company Contributions separately."
0 400 0
0 400 0 LP61A DISPLAY MESSAGE BOX
0 400 0 lp61b "S*** strives to continually develop and improve its pr
0 400 0 LP61B - "oducts and services to deliver more value to our custo
0 400 0 LP61B - "mers."
0 400 0

View File

@ -0,0 +1,10 @@
{0} {2}* Fix string style to not continue to next line{0}
{11}DISPLAY{0} {11}MESSAGE{0} {11}BOX{0}
{6}"The following process must be applied to Earnings, Deduct{0}
{10}-{0} {6}"ions and Company Contributions separately."{0}
{11}LP61A{0} {11}DISPLAY{0} {11}MESSAGE{0} {11}BOX{0}
{11}lp61b{0} {6}"S*** strives to continually develop and improve its pr{0}
{11}LP61B{0} {10}-{0} {6}"oducts and services to deliver more value to our custo{0}
{11}LP61B{0} {10}-{0} {6}"mers."{0}

View File

@ -0,0 +1,7 @@
* Keywords starting with V to be identified and styled
* in list keywords2
VARIANCE
* in list keywords3
VARYING

View File

@ -0,0 +1,8 @@
0 400 0 * Keywords starting with V to be identified and styled
0 400 0
0 400 0 * in list keywords2
0 400 0 VARIANCE
0 400 0
0 400 0 * in list keywords3
0 400 0 VARYING
0 400 0

View File

@ -0,0 +1,7 @@
{0} {2}* Keywords starting with V to be identified and styled{0}
{2}* in list keywords2{0}
{16}VARIANCE{0}
{2}* in list keywords3{0}
{8}VARYING{0}

View File

@ -0,0 +1,9 @@
* Comment preceded by 6 characters to be styled
* Include / to be styled as a comment
* Comment colored in green
ABCDE * Comment colored in green
ABCDEF* Comment NOT colored in green
/ Comment NOT colored in green
ABCDE / Comment NOT colored in green
ABCDEF/ Comment NOT colored in green

View File

@ -0,0 +1,10 @@
0 400 0 * Comment preceded by 6 characters to be styled
0 400 0 * Include / to be styled as a comment
0 400 0
0 400 0 * Comment colored in green
0 400 0 ABCDE * Comment colored in green
0 400 0 ABCDEF* Comment NOT colored in green
0 400 0 / Comment NOT colored in green
0 400 0 ABCDE / Comment NOT colored in green
0 400 0 ABCDEF/ Comment NOT colored in green
0 400 0

View File

@ -0,0 +1,9 @@
{0} {2}* Comment preceded by 6 characters to be styled{0}
{2}* Include / to be styled as a comment{0}
{2}* Comment colored in green{0}
{11}ABCDE{0} {2}* Comment colored in green{0}
{11}ABCDEF{2}* Comment NOT colored in green{0}
{2}/ Comment NOT colored in green{0}
{11}ABCDE{0} {2}/ Comment NOT colored in green{0}
{11}ABCDEF{2}/ Comment NOT colored in green{0}

View File

@ -0,0 +1,35 @@
* Enumerate all styles: 0, 2 to 11, 16
* SCE_C_COMMENTLINE=2
* SCE_C_DEFAULT=0
* SCE_C_IDENTIFIER=11
identifier
* SCE_C_NUMBER=4
4
* SCE_C_WORD=5
data
* SCE_C_WORD2=16
cancel
* SCE_C_UUID=8
remarks
* SCE_C_COMMENTDOC=3 not implemented
** at line start
* SCE_C_STRING=6
"string"
* SCE_C_CHARACTER=7
'c'
* SCE_C_PREPROCESSOR=9
?preprocessor
* SCE_C_OPERATOR=10
+

View File

@ -0,0 +1,36 @@
0 400 0 * Enumerate all styles: 0, 2 to 11, 16
0 400 0 * SCE_C_COMMENTLINE=2
0 400 0
0 400 0 * SCE_C_DEFAULT=0
0 400 0
0 400 0
0 400 0 * SCE_C_IDENTIFIER=11
0 400 0 identifier
0 400 0
0 400 0 * SCE_C_NUMBER=4
0 400 0 4
0 400 0
0 400 0 * SCE_C_WORD=5
0 400 0 data
0 400 0
0 400 0 * SCE_C_WORD2=16
0 400 0 cancel
0 400 0
0 400 0 * SCE_C_UUID=8
0 400 0 remarks
0 400 0
0 400 0 * SCE_C_COMMENTDOC=3 not implemented
0 400 0 ** at line start
0 400 0
0 400 0 * SCE_C_STRING=6
0 400 0 "string"
0 400 0
0 400 0 * SCE_C_CHARACTER=7
0 400 0 'c'
0 400 0
0 400 0 * SCE_C_PREPROCESSOR=9
0 400 0 ?preprocessor
0 400 0
0 400 0 * SCE_C_OPERATOR=10
0 400 0 +
0 400 0

View File

@ -0,0 +1,35 @@
{0} {2}* Enumerate all styles: 0, 2 to 11, 16{0}
{2}* SCE_C_COMMENTLINE=2{0}
{2}* SCE_C_DEFAULT=0{0}
{2}* SCE_C_IDENTIFIER=11{0}
{11}identifier{0}
{2}* SCE_C_NUMBER=4{0}
{4}4{0}
{2}* SCE_C_WORD=5{0}
{5}data{0}
{2}* SCE_C_WORD2=16{0}
{16}cancel{0}
{2}* SCE_C_UUID=8{0}
{8}remarks{0}
{2}* SCE_C_COMMENTDOC=3 not implemented{0}
{3}** at line start{0}
{2}* SCE_C_STRING=6{0}
{6}"string"{0}
{2}* SCE_C_CHARACTER=7{0}
{7}'c'{0}
{2}* SCE_C_PREPROCESSOR=9{0}
{9}?preprocessor{0}
{2}* SCE_C_OPERATOR=10{0}
{10}+{0}

View File

@ -0,0 +1,4 @@
lexer.*.cob=COBOL
keywords.*.cob=data
keywords2.*.cob=cancel variance
keywords3.*.cob=remarks varying

View File

@ -0,0 +1,9 @@
// coding: utf-8
// All three following symbols should highlight as keywords
cheese
käse
сыр
// Lookalikes with ASCII so should not highlight:
сыp
cыp

View File

@ -0,0 +1,10 @@
0 400 400 // coding: utf-8
0 400 400 // All three following symbols should highlight as keywords
0 400 400 cheese
0 400 400 käse
0 400 400 сыр
1 400 400
0 400 400 // Lookalikes with ASCII so should not highlight:
0 400 400 сыp
0 400 400 cыp
1 400 400

View File

@ -0,0 +1,9 @@
{2}// coding: utf-8
// All three following symbols should highlight as keywords
{5}cheese{0}
{5}käse{0}
{5}сыр{0}
{2}// Lookalikes with ASCII so should not highlight:
{11}сыp{0}
{11}cыp{0}

View File

@ -0,0 +1,11 @@
// SCE_C_WORD2 (16)
second
// SCE_C_IDENTIFIER (11)
Second
// SCE_C_IDENTIFIER (11)
upper
// SCE_C_WORD2 (16)
Upper

View File

@ -0,0 +1,12 @@
0 400 400 // SCE_C_WORD2 (16)
0 400 400 second
1 400 400
0 400 400 // SCE_C_IDENTIFIER (11)
0 400 400 Second
1 400 400
0 400 400 // SCE_C_IDENTIFIER (11)
0 400 400 upper
1 400 400
0 400 400 // SCE_C_WORD2 (16)
0 400 400 Upper
1 400 400

View File

@ -0,0 +1,11 @@
{2}// SCE_C_WORD2 (16)
{16}second{0}
{2}// SCE_C_IDENTIFIER (11)
{11}Second{0}
{2}// SCE_C_IDENTIFIER (11)
{11}upper{0}
{2}// SCE_C_WORD2 (16)
{16}Upper{0}

View File

@ -0,0 +1,31 @@
// Test JavaScript template expressions for issue 94
// Basic
var basic = `${identifier}`;
// Nested
var nested = ` ${ ` ${ 1 } ` } `;
// With escapes
var xxx = {
'1': `\`\u0020\${a${1 + 1}b}`,
'2': `\${a${ `b${1 + 2}c`.charCodeAt(2) }d}`,
'3': `\${a${ `b${ `c${ JSON.stringify({
'4': {},
}) }d` }e` }f}`,
};
// Original request
fetchOptions.body = `
{
"accountNumber" : "248796",
"customerType" : "Shipper",
"destinationCity" : "${order.destination.city}",
"destinationState" : "${order.destination.stateProvince}",
"destinationZip" : ${order.destination.postalCode},
"paymentType" : "Prepaid",
"shipmentInfo" :
{
"items" : [ { "shipmentClass" : "50", "shipmentWeight" : "${order.totalWeight.toString()}" } ]
}
}`;

View File

@ -0,0 +1,32 @@
0 400 400 // Test JavaScript template expressions for issue 94
1 400 400
0 400 400 // Basic
0 400 400 var basic = `${identifier}`;
1 400 400
0 400 400 // Nested
0 400 400 var nested = ` ${ ` ${ 1 } ` } `;
1 400 400
0 400 400 // With escapes
2 400 401 + var xxx = {
0 401 401 | '1': `\`\u0020\${a${1 + 1}b}`,
0 401 401 | '2': `\${a${ `b${1 + 2}c`.charCodeAt(2) }d}`,
2 401 406 + '3': `\${a${ `b${ `c${ JSON.stringify({
0 406 406 | '4': {},
0 406 401 | }) }d` }e` }f}`,
0 401 400 | };
1 400 400
0 400 400 // Original request
0 400 400 fetchOptions.body = `
0 400 400 {
0 400 400 "accountNumber" : "248796",
0 400 400 "customerType" : "Shipper",
0 400 400 "destinationCity" : "${order.destination.city}",
0 400 400 "destinationState" : "${order.destination.stateProvince}",
0 400 400 "destinationZip" : ${order.destination.postalCode},
0 400 400 "paymentType" : "Prepaid",
0 400 400 "shipmentInfo" :
0 400 400 {
0 400 400 "items" : [ { "shipmentClass" : "50", "shipmentWeight" : "${order.totalWeight.toString()}" } ]
0 400 400 }
0 400 400 }`;
1 400 400

View File

@ -0,0 +1,31 @@
{2}// Test JavaScript template expressions for issue 94
{0}
{2}// Basic
{5}var{0} {11}basic{0} {10}={0} {20}`{10}${{11}identifier{10}}{20}`{10};{0}
{2}// Nested
{5}var{0} {11}nested{0} {10}={0} {20}` {10}${{0} {20}` {10}${{0} {4}1{0} {10}}{20} `{0} {10}}{20} `{10};{0}
{2}// With escapes
{5}var{0} {11}xxx{0} {10}={0} {10}{{0}
{7}'1'{10}:{0} {20}`{27}\`\u0020\${20}{a{10}${{4}1{0} {10}+{0} {4}1{10}}{20}b}`{10},{0}
{7}'2'{10}:{0} {20}`{27}\${20}{a{10}${{0} {20}`b{10}${{4}1{0} {10}+{0} {4}2{10}}{20}c`{10}.{16}charCodeAt{10}({4}2{10}){0} {10}}{20}d}`{10},{0}
{7}'3'{10}:{0} {20}`{27}\${20}{a{10}${{0} {20}`b{10}${{0} {20}`c{10}${{0} {19}JSON{10}.{16}stringify{10}({{0}
{7}'4'{10}:{0} {10}{},{0}
{10}}){0} {10}}{20}d`{0} {10}}{20}e`{0} {10}}{20}f}`{10},{0}
{10}};{0}
{2}// Original request
{11}fetchOptions{10}.{11}body{0} {10}={0} {20}`
{
"accountNumber" : "248796",
"customerType" : "Shipper",
"destinationCity" : "{10}${{11}order{10}.{11}destination{10}.{11}city{10}}{20}",
"destinationState" : "{10}${{11}order{10}.{11}destination{10}.{11}stateProvince{10}}{20}",
"destinationZip" : {10}${{11}order{10}.{11}destination{10}.{11}postalCode{10}}{20},
"paymentType" : "Prepaid",
"shipmentInfo" :
{
"items" : [ { "shipmentClass" : "50", "shipmentWeight" : "{10}${{11}order{10}.{11}totalWeight{10}.{11}toString{10}()}{20}" } ]
}
}`{10};{0}

View File

@ -0,0 +1,193 @@
// Enumerate all primary styles: 0 to 27 and secondary styles 64 to 91
// default=0
// comment=1
/* */
/* commentline=2 */
// example line
// commentdoc=3
/** */
// number=4
123
// word=5
int
// string=6
"string"
// character=7
'c'
// uuid=8
uuid(3fd43029-1354-42f0-a5be-4a484c9c5250)
// preprocessor=9
#define xxx 1
// operator=10
{}
// identifier=11
identifier
// stringeol=12
"
// verbatim=13
@"verbatim"
// regex=14
(/regex/)
// commentlinedoc=15
/// example
// word2=16
second
// commentdockeyword=17
/** @file */
// commentdockeyworderror=18
/** @wrongkey */
// globalclass=19
global
// stringraw=20
R"( )"
// tripleverbatim=21
""" xx """
// hashquotedstring=22
#" xx "
// preprocessorcomment=23
#define /* comment */
// preprocessorcommentdoc=24
#define /** comment */
// userliteral=25
1_date_
// taskmarker=26
/* TODO: sleep */
// escapesequence=27
"\001 \b"
// identifier substyles.11.1=128
vector
// identifier substyles.11.2=129
std
// commentdockeyword substyles.17.1=130
/** @module */
// Secondary styles inside preprocessor excluded section
#if 0
// default=0
// comment=1
/* */
/* commentline=2 */
// example line
// commentdoc=3
/** */
// number=4
123
// word=5
int
// string=6
"string"
// character=7
'c'
// uuid=8
uuid(3fd43029-1354-42f0-a5be-4a484c9c5250)
// preprocessor=9
#define xxx 1
// operator=10
{}
// identifier=11
identifier
// stringeol=12
"
// verbatim=13
@"verbatim"
// regex=14
(/regex/)
// commentlinedoc=15
/// example
// word2=16
second
// commentdockeyword=17
/** @file */
// commentdockeyworderror=18
/** @wrongkey */
// globalclass=19
global
// stringraw=20
R"( )"
// tripleverbatim=21
""" xx """
// hashquotedstring=22
#" xx "
// preprocessorcomment=23
#define /* comment */
// preprocessorcommentdoc=24
#define /** comment */
// userliteral=25
1_date_
// taskmarker=26
/* TODO: sleep */
// escapesequence=27
"\001 \b"
// identifier substyles.75.1=192
vector
// identifier substyles.75.2=193
std
// commentdockeyword substyles.81.1=194
/** @module */
#endif

View File

@ -0,0 +1,194 @@
0 400 400 // Enumerate all primary styles: 0 to 27 and secondary styles 64 to 91
1 400 400
0 400 400 // default=0
1 400 400
1 400 400
0 400 400 // comment=1
0 400 400 /* */
1 400 400
0 400 400 /* commentline=2 */
0 400 400 // example line
1 400 400
0 400 400 // commentdoc=3
0 400 400 /** */
1 400 400
0 400 400 // number=4
0 400 400 123
1 400 400
0 400 400 // word=5
0 400 400 int
1 400 400
0 400 400 // string=6
0 400 400 "string"
1 400 400
0 400 400 // character=7
0 400 400 'c'
1 400 400
0 400 400 // uuid=8
0 400 400 uuid(3fd43029-1354-42f0-a5be-4a484c9c5250)
1 400 400
0 400 400 // preprocessor=9
0 400 400 #define xxx 1
1 400 400
0 400 400 // operator=10
0 400 400 {}
1 400 400
0 400 400 // identifier=11
0 400 400 identifier
1 400 400
0 400 400 // stringeol=12
0 400 400 "
1 400 400
0 400 400 // verbatim=13
0 400 400 @"verbatim"
1 400 400
0 400 400 // regex=14
0 400 400 (/regex/)
1 400 400
0 400 400 // commentlinedoc=15
0 400 400 /// example
1 400 400
0 400 400 // word2=16
0 400 400 second
1 400 400
0 400 400 // commentdockeyword=17
0 400 400 /** @file */
1 400 400
0 400 400 // commentdockeyworderror=18
0 400 400 /** @wrongkey */
1 400 400
0 400 400 // globalclass=19
0 400 400 global
1 400 400
0 400 400 // stringraw=20
0 400 400 R"( )"
1 400 400
0 400 400 // tripleverbatim=21
0 400 400 """ xx """
1 400 400
0 400 400 // hashquotedstring=22
0 400 400 #" xx "
1 400 400
0 400 400 // preprocessorcomment=23
0 400 400 #define /* comment */
1 400 400
0 400 400 // preprocessorcommentdoc=24
0 400 400 #define /** comment */
1 400 400
0 400 400 // userliteral=25
0 400 400 1_date_
1 400 400
0 400 400 // taskmarker=26
0 400 400 /* TODO: sleep */
1 400 400
0 400 400 // escapesequence=27
0 400 400 "\001 \b"
1 400 400
0 400 400 // identifier substyles.11.1=128
0 400 400 vector
1 400 400
0 400 400 // identifier substyles.11.2=129
0 400 400 std
1 400 400
0 400 400 // commentdockeyword substyles.17.1=130
0 400 400 /** @module */
1 400 400
0 400 400 // Secondary styles inside preprocessor excluded section
1 400 400
2 400 401 + #if 0
1 401 401 |
0 401 401 | // default=0
1 401 401 |
1 401 401 |
0 401 401 | // comment=1
0 401 401 | /* */
1 401 401 |
0 401 401 | /* commentline=2 */
0 401 401 | // example line
1 401 401 |
0 401 401 | // commentdoc=3
0 401 401 | /** */
1 401 401 |
0 401 401 | // number=4
0 401 401 | 123
1 401 401 |
0 401 401 | // word=5
0 401 401 | int
1 401 401 |
0 401 401 | // string=6
0 401 401 | "string"
1 401 401 |
0 401 401 | // character=7
0 401 401 | 'c'
1 401 401 |
0 401 401 | // uuid=8
0 401 401 | uuid(3fd43029-1354-42f0-a5be-4a484c9c5250)
1 401 401 |
0 401 401 | // preprocessor=9
0 401 401 | #define xxx 1
1 401 401 |
0 401 401 | // operator=10
0 401 401 | {}
1 401 401 |
0 401 401 | // identifier=11
0 401 401 | identifier
1 401 401 |
0 401 401 | // stringeol=12
0 401 401 | "
1 401 401 |
0 401 401 | // verbatim=13
0 401 401 | @"verbatim"
1 401 401 |
0 401 401 | // regex=14
0 401 401 | (/regex/)
1 401 401 |
0 401 401 | // commentlinedoc=15
0 401 401 | /// example
1 401 401 |
0 401 401 | // word2=16
0 401 401 | second
1 401 401 |
0 401 401 | // commentdockeyword=17
0 401 401 | /** @file */
1 401 401 |
0 401 401 | // commentdockeyworderror=18
0 401 401 | /** @wrongkey */
1 401 401 |
0 401 401 | // globalclass=19
0 401 401 | global
1 401 401 |
0 401 401 | // stringraw=20
0 401 401 | R"( )"
1 401 401 |
0 401 401 | // tripleverbatim=21
0 401 401 | """ xx """
1 401 401 |
0 401 401 | // hashquotedstring=22
0 401 401 | #" xx "
1 401 401 |
0 401 401 | // preprocessorcomment=23
0 401 401 | #define /* comment */
1 401 401 |
0 401 401 | // preprocessorcommentdoc=24
0 401 401 | #define /** comment */
1 401 401 |
0 401 401 | // userliteral=25
0 401 401 | 1_date_
1 401 401 |
0 401 401 | // taskmarker=26
0 401 401 | /* TODO: sleep */
1 401 401 |
0 401 401 | // escapesequence=27
0 401 401 | "\001 \b"
1 401 401 |
0 401 401 | // identifier substyles.75.1=192
0 401 401 | vector
1 401 401 |
0 401 401 | // identifier substyles.75.2=193
0 401 401 | std
1 401 401 |
0 401 401 | // commentdockeyword substyles.81.1=194
0 401 401 | /** @module */
1 401 401 |
0 401 400 | #endif
1 400 400

View File

@ -0,0 +1,193 @@
{2}// Enumerate all primary styles: 0 to 27 and secondary styles 64 to 91
{0}
{2}// default=0
{0}
{2}// comment=1
{1}/* */{0}
{1}/* commentline=2 */{0}
{2}// example line
{0}
{2}// commentdoc=3
{3}/** */{0}
{2}// number=4
{4}123{0}
{2}// word=5
{5}int{0}
{2}// string=6
{6}"string"{0}
{2}// character=7
{7}'c'{0}
{2}// uuid=8
{5}uuid{10}({8}3fd43029-1354-42f0-a5be-4a484c9c5250{10}){0}
{2}// preprocessor=9
{9}#define xxx 1
{0}
{2}// operator=10
{10}{}{0}
{2}// identifier=11
{11}identifier{0}
{2}// stringeol=12
{12}"
{0}
{2}// verbatim=13
{13}@"verbatim"{0}
{2}// regex=14
{10}({14}/regex/{10}){0}
{2}// commentlinedoc=15
{15}/// example
{0}
{2}// word2=16
{16}second{0}
{2}// commentdockeyword=17
{3}/** {17}@file{3} */{0}
{2}// commentdockeyworderror=18
{3}/** {18}@wrongkey{3} */{0}
{2}// globalclass=19
{19}global{0}
{2}// stringraw=20
{20}R"( )"{0}
{2}// tripleverbatim=21
{21}""" xx """{0}
{2}// hashquotedstring=22
{22}#" xx "{0}
{2}// preprocessorcomment=23
{9}#define {23}/* comment */{9}
{0}
{2}// preprocessorcommentdoc=24
{9}#define {24}/** comment */{9}
{0}
{2}// userliteral=25
{25}1_date_{0}
{2}// taskmarker=26
{1}/* {26}TODO{1}: sleep */{0}
{2}// escapesequence=27
{6}"{27}\001{6} {27}\b{6}"{0}
{2}// identifier substyles.11.1=128
{128}vector{0}
{2}// identifier substyles.11.2=129
{129}std{0}
{2}// commentdockeyword substyles.17.1=130
{3}/** {130}@module{3} */{0}
{2}// Secondary styles inside preprocessor excluded section
{0}
{9}#if 0
{64}
{66}// default=0
{64}
{66}// comment=1
{65}/* */{64}
{65}/* commentline=2 */{64}
{66}// example line
{64}
{66}// commentdoc=3
{67}/** */{64}
{66}// number=4
{68}123{64}
{66}// word=5
{69}int{64}
{66}// string=6
{70}"string"{64}
{66}// character=7
{71}'c'{64}
{66}// uuid=8
{69}uuid{74}({72}3fd43029-1354-42f0-a5be-4a484c9c5250{74}){64}
{66}// preprocessor=9
{73}#define xxx 1
{64}
{66}// operator=10
{74}{}{64}
{66}// identifier=11
{75}identifier{64}
{66}// stringeol=12
{76}"
{64}
{66}// verbatim=13
{77}@"verbatim"{64}
{66}// regex=14
{74}({78}/regex/{74}){64}
{66}// commentlinedoc=15
{79}/// example
{64}
{66}// word2=16
{80}second{64}
{66}// commentdockeyword=17
{67}/** {81}@file{67} */{64}
{66}// commentdockeyworderror=18
{67}/** {82}@wrongkey{67} */{64}
{66}// globalclass=19
{83}global{64}
{66}// stringraw=20
{84}R"( )"{64}
{66}// tripleverbatim=21
{85}""" xx """{64}
{66}// hashquotedstring=22
{86}#" xx "{64}
{66}// preprocessorcomment=23
{73}#define {87}/* comment */{73}
{64}
{66}// preprocessorcommentdoc=24
{73}#define {88}/** comment */{73}
{64}
{66}// userliteral=25
{89}1_date_{64}
{66}// taskmarker=26
{65}/* {90}TODO{65}: sleep */{64}
{66}// escapesequence=27
{70}"{91}\001{70} {91}\b{70}"{64}
{66}// identifier substyles.75.1=192
{192}vector{64}
{66}// identifier substyles.75.2=193
{193}std{64}
{66}// commentdockeyword substyles.81.1=194
{67}/** {194}@module{67} */{64}
{9}#endif

Some files were not shown because too many files have changed in this diff Show More