From 870a8cae89775f6f6bc01d995067c2cf917892f4 Mon Sep 17 00:00:00 2001 From: zufuliu Date: Sat, 21 Dec 2024 08:38:42 +1100 Subject: [PATCH] #295 Fix asm style extending past end. Add test files for Pascal from HoTschir. --- doc/LexillaHistory.html | 13 ++++ lexers/LexPascal.cxx | 11 ++- test/examples/pascal/AllStyles.pas | 82 ++++++++++++++++++++ test/examples/pascal/AllStyles.pas.folded | 83 +++++++++++++++++++++ test/examples/pascal/AllStyles.pas.styled | 82 ++++++++++++++++++++ test/examples/pascal/CodeFolding.pas | 80 ++++++++++++++++++++ test/examples/pascal/CodeFolding.pas.folded | 81 ++++++++++++++++++++ test/examples/pascal/CodeFolding.pas.styled | 80 ++++++++++++++++++++ test/examples/pascal/SciTE.properties | 20 +++++ test/examples/pascal/SomeExample.pas | 41 ++++++++++ test/examples/pascal/SomeExample.pas.folded | 42 +++++++++++ test/examples/pascal/SomeExample.pas.styled | 41 ++++++++++ 12 files changed, 650 insertions(+), 6 deletions(-) create mode 100644 test/examples/pascal/AllStyles.pas create mode 100644 test/examples/pascal/AllStyles.pas.folded create mode 100644 test/examples/pascal/AllStyles.pas.styled create mode 100644 test/examples/pascal/CodeFolding.pas create mode 100644 test/examples/pascal/CodeFolding.pas.folded create mode 100644 test/examples/pascal/CodeFolding.pas.styled create mode 100644 test/examples/pascal/SciTE.properties create mode 100644 test/examples/pascal/SomeExample.pas create mode 100644 test/examples/pascal/SomeExample.pas.folded create mode 100644 test/examples/pascal/SomeExample.pas.styled diff --git a/doc/LexillaHistory.html b/doc/LexillaHistory.html index 25661247..49a3fce8 100644 --- a/doc/LexillaHistory.html +++ b/doc/LexillaHistory.html @@ -588,9 +588,22 @@

Contributors

Henrik S. Johansen Ekopalypse + HoTschir

Releases

+

+ Release 5.4.3 +

+

Release 5.4.2

diff --git a/lexers/LexPascal.cxx b/lexers/LexPascal.cxx index bd667876..1f102793 100644 --- a/lexers/LexPascal.cxx +++ b/lexers/LexPascal.cxx @@ -231,12 +231,6 @@ static void ColourisePascalDoc(Sci_PositionU startPos, Sci_Position length, int StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { - if (sc.atLineEnd) { - // Update the line state, so it can be seen by next line - curLine = styler.GetLine(sc.currentPos); - styler.SetLineState(curLine, curLineState); - } - // Determine if the current state should terminate. switch (sc.state) { case SCE_PAS_NUMBER: @@ -335,6 +329,11 @@ static void ColourisePascalDoc(Sci_PositionU startPos, Sci_Position length, int sc.SetState(SCE_PAS_ASM); } } + + if (sc.atLineEnd) { + // Update the line state, so it can be seen by next line + styler.SetLineState(sc.currentLine, curLineState); + } } if (sc.state == SCE_PAS_IDENTIFIER && setWord.Contains(sc.chPrev)) { diff --git a/test/examples/pascal/AllStyles.pas b/test/examples/pascal/AllStyles.pas new file mode 100644 index 00000000..d1115cac --- /dev/null +++ b/test/examples/pascal/AllStyles.pas @@ -0,0 +1,82 @@ +// Enumerate all primary styles: 0 to 14 + +{ + SCE_PAS_DEFAULT=0 + SCE_PAS_IDENTIFIER=1 + SCE_PAS_COMMENT=2 + SCE_PAS_COMMENT2=3 + SCE_PAS_COMMENTLINE=4 + SCE_PAS_PREPROCESSOR=5 + SCE_PAS_PREPROCESSOR2=6 + SCE_PAS_NUMBER=7 + SCE_PAS_HEXNUMBER=8 + SCE_PAS_WORD=9 + SCE_PAS_STRING=10 + SCE_PAS_STRINGEOL=11 + SCE_PAS_CHARACTER=12 + SCE_PAS_OPERATOR=13 + SCE_PAS_ASM=14 +} + +// default=0 + +// identifier=1 +function functionname(var paramerter1: type1):result1; +procedure procedurename(const parameter2: type2); + +// comment=2 +{comment text} + +// comment2=3 +(* comment text *) + +// commentline=4 +// example line + +// preprocessor=5 +{$DEFINE xyz} + +{$IFDEF xyz} + codeblock 1 +{$else} + codeblock 2 +{$endif} + +// preprocessor2=6 +(*$DEFINE xyz*) + +// number=7 +123 +1.23 +-123 +-12.3 ++123 +123 +1.23e2 +-1.23E2 + +// hexnumber=8 +$123 +$123ABCDEF +$ABCDEF123 + +// word=9 +absolute abstract and array as + +// string=10 +'string' + +// stringeol=11 +'string + +// character=12 +#65 + +// operator=13 +$ & * + / < = > ^ + +// asm +asm + this is + inside assembler +end diff --git a/test/examples/pascal/AllStyles.pas.folded b/test/examples/pascal/AllStyles.pas.folded new file mode 100644 index 00000000..c5d275a3 --- /dev/null +++ b/test/examples/pascal/AllStyles.pas.folded @@ -0,0 +1,83 @@ + 0 400 0 // Enumerate all primary styles: 0 to 14 + 1 400 0 + 2 400 0 + { + 0 401 0 | SCE_PAS_DEFAULT=0 + 0 401 0 | SCE_PAS_IDENTIFIER=1 + 0 401 0 | SCE_PAS_COMMENT=2 + 0 401 0 | SCE_PAS_COMMENT2=3 + 0 401 0 | SCE_PAS_COMMENTLINE=4 + 0 401 0 | SCE_PAS_PREPROCESSOR=5 + 0 401 0 | SCE_PAS_PREPROCESSOR2=6 + 0 401 0 | SCE_PAS_NUMBER=7 + 0 401 0 | SCE_PAS_HEXNUMBER=8 + 0 401 0 | SCE_PAS_WORD=9 + 0 401 0 | SCE_PAS_STRING=10 + 0 401 0 | SCE_PAS_STRINGEOL=11 + 0 401 0 | SCE_PAS_CHARACTER=12 + 0 401 0 | SCE_PAS_OPERATOR=13 + 0 401 0 | SCE_PAS_ASM=14 + 0 401 0 | } + 1 400 0 + 0 400 0 // default=0 + 1 400 0 + 0 400 0 // identifier=1 + 0 400 0 function functionname(var paramerter1: type1):result1; + 0 400 0 procedure procedurename(const parameter2: type2); + 1 400 0 + 0 400 0 // comment=2 + 0 400 0 {comment text} + 1 400 0 + 0 400 0 // comment2=3 + 0 400 0 (* comment text *) + 1 400 0 + 2 400 0 + // commentline=4 + 0 401 0 | // example line + 1 400 0 + 0 400 0 // preprocessor=5 + 0 400 0 {$DEFINE xyz} + 1 400 0 + 2 400 0 + {$IFDEF xyz} + 0 401 0 | codeblock 1 + 0 401 0 | {$else} + 0 401 0 | codeblock 2 + 0 401 0 | {$endif} + 1 400 0 + 0 400 0 // preprocessor2=6 + 0 400 0 (*$DEFINE xyz*) + 1 400 0 + 0 400 0 // number=7 + 0 400 0 123 + 0 400 0 1.23 + 0 400 0 -123 + 0 400 0 -12.3 + 0 400 0 +123 + 0 400 0 123 + 0 400 0 1.23e2 + 0 400 0 -1.23E2 + 1 400 0 + 0 400 0 // hexnumber=8 + 0 400 0 $123 + 0 400 0 $123ABCDEF + 0 400 0 $ABCDEF123 + 1 400 0 + 0 400 0 // word=9 + 0 400 0 absolute abstract and array as + 1 400 0 + 0 400 0 // string=10 + 0 400 0 'string' + 1 400 0 + 0 400 0 // stringeol=11 + 0 400 0 'string + 1 400 0 + 0 400 0 // character=12 + 0 400 0 #65 + 1 400 0 + 0 400 0 // operator=13 + 0 400 0 $ & * + / < = > ^ + 1 400 0 + 0 400 0 // asm + 2 400 0 + asm + 0 401 0 | this is + 0 401 0 | inside assembler + 0 401 0 | end + 1 400 0 \ No newline at end of file diff --git a/test/examples/pascal/AllStyles.pas.styled b/test/examples/pascal/AllStyles.pas.styled new file mode 100644 index 00000000..1907e6ba --- /dev/null +++ b/test/examples/pascal/AllStyles.pas.styled @@ -0,0 +1,82 @@ +{4}// Enumerate all primary styles: 0 to 14 +{0} +{2}{ + SCE_PAS_DEFAULT=0 + SCE_PAS_IDENTIFIER=1 + SCE_PAS_COMMENT=2 + SCE_PAS_COMMENT2=3 + SCE_PAS_COMMENTLINE=4 + SCE_PAS_PREPROCESSOR=5 + SCE_PAS_PREPROCESSOR2=6 + SCE_PAS_NUMBER=7 + SCE_PAS_HEXNUMBER=8 + SCE_PAS_WORD=9 + SCE_PAS_STRING=10 + SCE_PAS_STRINGEOL=11 + SCE_PAS_CHARACTER=12 + SCE_PAS_OPERATOR=13 + SCE_PAS_ASM=14 +}{0} + +{4}// default=0 +{0} +{4}// identifier=1 +{9}function{0} {1}functionname{13}({9}var{0} {1}paramerter1{13}:{0} {1}type1{13}):{1}result1{13};{0} +{9}procedure{0} {1}procedurename{13}({9}const{0} {1}parameter2{13}:{0} {1}type2{13});{0} + +{4}// comment=2 +{2}{comment text}{0} + +{4}// comment2=3 +{3}(* comment text *){0} + +{4}// commentline=4 +// example line +{0} +{4}// preprocessor=5 +{5}{$DEFINE xyz}{0} + +{5}{$IFDEF xyz}{0} + {1}codeblock{0} {7}1{0} +{5}{$else}{0} + {1}codeblock{0} {7}2{0} +{5}{$endif}{0} + +{4}// preprocessor2=6 +{6}(*$DEFINE xyz*){0} + +{4}// number=7 +{7}123{0} +{7}1.23{0} +{13}-{7}123{0} +{13}-{7}12.3{0} +{13}+{7}123{0} +{7}123{0} +{7}1.23e2{0} +{13}-{7}1.23E2{0} + +{4}// hexnumber=8 +{8}$123{0} +{8}$123ABCDEF{0} +{8}$ABCDEF123{0} + +{4}// word=9 +{9}absolute{0} {9}abstract{0} {9}and{0} {9}array{0} {9}as{0} + +{4}// string=10 +{10}'string'{0} + +{4}// stringeol=11 +{11}'string +{0} +{4}// character=12 +{12}#65{0} + +{4}// operator=13 +{8}${0} {13}&{0} {13}*{0} {13}+{0} {13}/{0} {13}<{0} {13}={0} {13}>{0} {13}^{0} + +{4}// asm +{9}asm{14} + this is + inside assembler +{9}end{0} diff --git a/test/examples/pascal/CodeFolding.pas b/test/examples/pascal/CodeFolding.pas new file mode 100644 index 00000000..55f3e358 --- /dev/null +++ b/test/examples/pascal/CodeFolding.pas @@ -0,0 +1,80 @@ +// tests for code folding + +// multi line comments +{ +line1 +line2 +} + +// begin .. end +begin +some commands +end; + +record test + var1: type1; + var2: type2; + end; //record + +//asm +asm + some statement + end; //asm + +//try (from https://wiki.freepascal.org/Try) +try + // code that might generate an exception +except + // will only be executed in case of an exception + on E: EDatabaseError do + ShowMessage( 'Database error: '+ E.ClassName + #13#10 + E.Message ); + on E: Exception do + ShowMessage( 'Error: '+ E.ClassName + #13#10 + E.Message ); +end; + +//try nested (from https://wiki.freepascal.org/Try) +try + try + // code dealing with database that might generate an exception + except + // will only be executed in case of an exception + on E: EDatabaseError do + ShowMessage( 'Database error: '+ E.ClassName + #13#10 + E.Message ); + on E: Exception do + ShowMessage( 'Error: '+ E.ClassName + #13#10 + E.Message ); + end; +finally + // clean up database-related resources +end; + +//case +case x of + 1: do something; + 2: do some other thing; +else + do default; + end; //case + +//if then else +if x=y then + do something; +else + do some other thing; + +//for loop +for i:=1 to 10 do + writeln(i) + +//do until +repeat + write(a); + i:=i+1; +until i>10; + +//preprocessor if, else, endif +{$DEFINE label} +{$IFDEF label} + command 1 +{$ELSE} + command 2 +{$ENDIF} diff --git a/test/examples/pascal/CodeFolding.pas.folded b/test/examples/pascal/CodeFolding.pas.folded new file mode 100644 index 00000000..bd785d07 --- /dev/null +++ b/test/examples/pascal/CodeFolding.pas.folded @@ -0,0 +1,81 @@ + 0 400 0 // tests for code folding + 1 400 0 + 0 400 0 // multi line comments + 2 400 0 + { + 0 401 0 | line1 + 0 401 0 | line2 + 0 401 0 | } + 1 400 0 + 0 400 0 // begin .. end + 2 400 0 + begin + 0 401 0 | some commands + 0 401 0 | end; + 1 400 0 + 2 400 0 + record test + 0 401 0 | var1: type1; + 0 401 0 | var2: type2; + 0 401 0 | end; //record + 1 400 0 + 0 400 0 //asm + 2 400 0 + asm + 0 401 0 | some statement + 0 401 0 | end; //asm + 1 400 0 + 0 400 0 //try (from https://wiki.freepascal.org/Try) + 2 400 0 + try + 0 401 0 | // code that might generate an exception + 0 401 0 | except + 0 401 0 | // will only be executed in case of an exception + 0 401 0 | on E: EDatabaseError do + 0 401 0 | ShowMessage( 'Database error: '+ E.ClassName + #13#10 + E.Message ); + 0 401 0 | on E: Exception do + 0 401 0 | ShowMessage( 'Error: '+ E.ClassName + #13#10 + E.Message ); + 0 401 0 | end; + 1 400 0 + 0 400 0 //try nested (from https://wiki.freepascal.org/Try) + 2 400 0 + try + 2 401 0 + try + 0 402 0 | // code dealing with database that might generate an exception + 0 402 0 | except + 0 402 0 | // will only be executed in case of an exception + 0 402 0 | on E: EDatabaseError do + 0 402 0 | ShowMessage( 'Database error: '+ E.ClassName + #13#10 + E.Message ); + 0 402 0 | on E: Exception do + 0 402 0 | ShowMessage( 'Error: '+ E.ClassName + #13#10 + E.Message ); + 0 402 0 | end; + 0 401 0 | finally + 0 401 0 | // clean up database-related resources + 0 401 0 | end; + 1 400 0 + 0 400 0 //case + 2 400 0 + case x of + 0 401 0 | 1: do something; + 0 401 0 | 2: do some other thing; + 0 401 0 | else + 0 401 0 | do default; + 0 401 0 | end; //case + 1 400 0 + 0 400 0 //if then else + 0 400 0 if x=y then + 0 400 0 do something; + 0 400 0 else + 0 400 0 do some other thing; + 1 400 0 + 0 400 0 //for loop + 0 400 0 for i:=1 to 10 do + 0 400 0 writeln(i) + 1 400 0 + 0 400 0 //do until + 0 400 0 repeat + 0 400 0 write(a); + 0 400 0 i:=i+1; + 0 400 0 until i>10; + 1 400 0 + 0 400 0 //preprocessor if, else, endif + 0 400 0 {$DEFINE label} + 2 400 0 + {$IFDEF label} + 0 401 0 | command 1 + 0 401 0 | {$ELSE} + 0 401 0 | command 2 + 0 401 0 | {$ENDIF} + 1 400 0 \ No newline at end of file diff --git a/test/examples/pascal/CodeFolding.pas.styled b/test/examples/pascal/CodeFolding.pas.styled new file mode 100644 index 00000000..99f9d892 --- /dev/null +++ b/test/examples/pascal/CodeFolding.pas.styled @@ -0,0 +1,80 @@ +{4}// tests for code folding +{0} +{4}// multi line comments +{2}{ +line1 +line2 +}{0} + +{4}// begin .. end +{9}begin{0} +{1}some{0} {1}commands{0} +{9}end{13};{0} + +{9}record{0} {1}test{0} + {1}var1{13}:{0} {1}type1{13};{0} + {1}var2{13}:{0} {1}type2{13};{0} + {9}end{13};{0} {4}//record +{0} +{4}//asm +{9}asm{14} + some statement + {9}end{13};{0} {4}//asm +{0} +{4}//try (from https://wiki.freepascal.org/Try) +{9}try{0} + {4}// code that might generate an exception +{9}except{0} + {4}// will only be executed in case of an exception +{0} {9}on{0} {1}E{13}:{0} {1}EDatabaseError{0} {9}do{0} + {1}ShowMessage{13}({0} {10}'Database error: '{13}+{0} {1}E{13}.{1}ClassName{0} {13}+{0} {12}#13#10{0} {13}+{0} {1}E{13}.{9}Message{0} {13});{0} + {9}on{0} {1}E{13}:{0} {1}Exception{0} {9}do{0} + {1}ShowMessage{13}({0} {10}'Error: '{13}+{0} {1}E{13}.{1}ClassName{0} {13}+{0} {12}#13#10{0} {13}+{0} {1}E{13}.{9}Message{0} {13});{0} +{9}end{13};{0} + +{4}//try nested (from https://wiki.freepascal.org/Try) +{9}try{0} + {9}try{0} + {4}// code dealing with database that might generate an exception +{0} {9}except{0} + {4}// will only be executed in case of an exception +{0} {9}on{0} {1}E{13}:{0} {1}EDatabaseError{0} {9}do{0} + {1}ShowMessage{13}({0} {10}'Database error: '{13}+{0} {1}E{13}.{1}ClassName{0} {13}+{0} {12}#13#10{0} {13}+{0} {1}E{13}.{9}Message{0} {13});{0} + {9}on{0} {1}E{13}:{0} {1}Exception{0} {9}do{0} + {1}ShowMessage{13}({0} {10}'Error: '{13}+{0} {1}E{13}.{1}ClassName{0} {13}+{0} {12}#13#10{0} {13}+{0} {1}E{13}.{9}Message{0} {13});{0} + {9}end{13};{0} +{9}finally{0} + {4}// clean up database-related resources +{9}end{13};{0} + +{4}//case +{9}case{0} {1}x{0} {9}of{0} + {7}1{13}:{0} {9}do{0} {1}something{13};{0} + {7}2{13}:{0} {9}do{0} {1}some{0} {1}other{0} {1}thing{13};{0} +{9}else{0} + {9}do{0} {1}default{13};{0} + {9}end{13};{0} {4}//case +{0} +{4}//if then else +{9}if{0} {1}x{13}={1}y{0} {9}then{0} + {9}do{0} {1}something{13};{0} +{9}else{0} + {9}do{0} {1}some{0} {1}other{0} {1}thing{13};{0} + +{4}//for loop +{9}for{0} {1}i{13}:={7}1{0} {9}to{0} {7}10{0} {9}do{0} + {1}writeln{13}({1}i{13}){0} + +{4}//do until +{9}repeat{0} + {1}write{13}({1}a{13});{0} + {1}i{13}:={1}i{13}+{7}1{13};{0} +{9}until{0} {1}i{13}>{7}10{13};{0} + +{4}//preprocessor if, else, endif +{5}{$DEFINE label}{0} +{5}{$IFDEF label}{0} + {1}command{0} {7}1{0} +{5}{$ELSE}{0} + {1}command{0} {7}2{0} +{5}{$ENDIF}{0} diff --git a/test/examples/pascal/SciTE.properties b/test/examples/pascal/SciTE.properties new file mode 100644 index 00000000..a302e23a --- /dev/null +++ b/test/examples/pascal/SciTE.properties @@ -0,0 +1,20 @@ +# coding: utf-8 +lexer.*.pas=pascal +keywords.*.pas=absolute abstract and array as asm assembler automated begin case \ +cdecl class const constructor delayed deprecated destructor dispid dispinterface \ +div do downto dynamic else end except experimental export exports external far \ +file final finalization finally for forward function goto helper if \ +implementation in inherited initialization inline interface is label library \ +message mod near nil not object of on operator or out overload override packed \ +pascal platform private procedure program property protected public published \ +raise record reference register reintroduce repeat resourcestring safecall \ +sealed set shl shr static stdcall strict string then threadvar to try type unit \ +unsafe until uses var varargs virtual while winapi with xor + + +lexer.pascal.smart.highlighting=1 + +fold=1 +fold.preprocessor=1 +fold.comment=1 +fold.compact=1 diff --git a/test/examples/pascal/SomeExample.pas b/test/examples/pascal/SomeExample.pas new file mode 100644 index 00000000..d59cdad7 --- /dev/null +++ b/test/examples/pascal/SomeExample.pas @@ -0,0 +1,41 @@ +// some example source code + +{ + SCE_PAS_DEFAULT=0 + SCE_PAS_IDENTIFIER=1 + SCE_PAS_COMMENT=2 + SCE_PAS_COMMENT2=3 + SCE_PAS_COMMENTLINE=4 + SCE_PAS_PREPROCESSOR=5 + SCE_PAS_PREPROCESSOR2=6 + SCE_PAS_NUMBER=7 + SCE_PAS_HEXNUMBER=8 + SCE_PAS_WORD=9 + SCE_PAS_STRING=10 + SCE_PAS_STRINGEOL=11 + SCE_PAS_CHARACTER=12 + SCE_PAS_OPERATOR=13 + SCE_PAS_ASM=14 +} + +{ --------------------------------------------------------------------------- } +function functionname(paramerter1: type1):result1; + var + i: LongInt; + begin + for i:=1 to 10 do + begin + writeln(i) + end; + result:=true; + end; +{ --------------------------------------------------------------------------- } +procedure procedurename(parameter2: type2); + var + i: LongInt; + begin + for i:=1 to 10 do + begin + writeln(i) + end; + end; diff --git a/test/examples/pascal/SomeExample.pas.folded b/test/examples/pascal/SomeExample.pas.folded new file mode 100644 index 00000000..9d78a588 --- /dev/null +++ b/test/examples/pascal/SomeExample.pas.folded @@ -0,0 +1,42 @@ + 0 400 0 // some example source code + 1 400 0 + 2 400 0 + { + 0 401 0 | SCE_PAS_DEFAULT=0 + 0 401 0 | SCE_PAS_IDENTIFIER=1 + 0 401 0 | SCE_PAS_COMMENT=2 + 0 401 0 | SCE_PAS_COMMENT2=3 + 0 401 0 | SCE_PAS_COMMENTLINE=4 + 0 401 0 | SCE_PAS_PREPROCESSOR=5 + 0 401 0 | SCE_PAS_PREPROCESSOR2=6 + 0 401 0 | SCE_PAS_NUMBER=7 + 0 401 0 | SCE_PAS_HEXNUMBER=8 + 0 401 0 | SCE_PAS_WORD=9 + 0 401 0 | SCE_PAS_STRING=10 + 0 401 0 | SCE_PAS_STRINGEOL=11 + 0 401 0 | SCE_PAS_CHARACTER=12 + 0 401 0 | SCE_PAS_OPERATOR=13 + 0 401 0 | SCE_PAS_ASM=14 + 0 401 0 | } + 1 400 0 + 0 400 0 { --------------------------------------------------------------------------- } + 0 400 0 function functionname(paramerter1: type1):result1; + 0 400 0 var + 0 400 0 i: LongInt; + 2 400 0 + begin + 0 401 0 | for i:=1 to 10 do + 2 401 0 + begin + 0 402 0 | writeln(i) + 0 402 0 | end; + 0 401 0 | result:=true; + 0 401 0 | end; + 0 400 0 { --------------------------------------------------------------------------- } + 0 400 0 procedure procedurename(parameter2: type2); + 0 400 0 var + 0 400 0 i: LongInt; + 2 400 0 + begin + 0 401 0 | for i:=1 to 10 do + 2 401 0 + begin + 0 402 0 | writeln(i) + 0 402 0 | end; + 0 401 0 | end; + 1 400 0 \ No newline at end of file diff --git a/test/examples/pascal/SomeExample.pas.styled b/test/examples/pascal/SomeExample.pas.styled new file mode 100644 index 00000000..d0476325 --- /dev/null +++ b/test/examples/pascal/SomeExample.pas.styled @@ -0,0 +1,41 @@ +{4}// some example source code +{0} +{2}{ + SCE_PAS_DEFAULT=0 + SCE_PAS_IDENTIFIER=1 + SCE_PAS_COMMENT=2 + SCE_PAS_COMMENT2=3 + SCE_PAS_COMMENTLINE=4 + SCE_PAS_PREPROCESSOR=5 + SCE_PAS_PREPROCESSOR2=6 + SCE_PAS_NUMBER=7 + SCE_PAS_HEXNUMBER=8 + SCE_PAS_WORD=9 + SCE_PAS_STRING=10 + SCE_PAS_STRINGEOL=11 + SCE_PAS_CHARACTER=12 + SCE_PAS_OPERATOR=13 + SCE_PAS_ASM=14 +}{0} + +{2}{ --------------------------------------------------------------------------- }{0} +{9}function{0} {1}functionname{13}({1}paramerter1{13}:{0} {1}type1{13}):{1}result1{13};{0} + {9}var{0} + {1}i{13}:{0} {1}LongInt{13};{0} + {9}begin{0} + {9}for{0} {1}i{13}:={7}1{0} {9}to{0} {7}10{0} {9}do{0} + {9}begin{0} + {1}writeln{13}({1}i{13}){0} + {9}end{13};{0} + {1}result{13}:={1}true{13};{0} + {9}end{13};{0} +{2}{ --------------------------------------------------------------------------- }{0} +{9}procedure{0} {1}procedurename{13}({1}parameter2{13}:{0} {1}type2{13});{0} + {9}var{0} + {1}i{13}:{0} {1}LongInt{13};{0} + {9}begin{0} + {9}for{0} {1}i{13}:={7}1{0} {9}to{0} {7}10{0} {9}do{0} + {9}begin{0} + {1}writeln{13}({1}i{13}){0} + {9}end{13};{0} + {9}end{13};{0}