-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#295 Fix asm style extending past end.
Add test files for Pascal from HoTschir.
- Loading branch information
1 parent
8846098
commit 870a8ca
Showing
12 changed files
with
650 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
Oops, something went wrong.