diff --git a/components/extrasyn/Images/TDBSYNEDIT.png b/components/extrasyn/Images/TDBSYNEDIT.png deleted file mode 100644 index 5aced1d4f..000000000 Binary files a/components/extrasyn/Images/TDBSYNEDIT.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYN8051SYN.png b/components/extrasyn/Images/TSYN8051SYN.png deleted file mode 100644 index d43be8d21..000000000 Binary files a/components/extrasyn/Images/TSYN8051SYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNADSP21XXSYN.png b/components/extrasyn/Images/TSYNADSP21XXSYN.png deleted file mode 100644 index a70169787..000000000 Binary files a/components/extrasyn/Images/TSYNADSP21XXSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNASMSYN.png b/components/extrasyn/Images/TSYNASMSYN.png deleted file mode 100644 index 4d32a2867..000000000 Binary files a/components/extrasyn/Images/TSYNASMSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNAUTOCOMPLETE.png b/components/extrasyn/Images/TSYNAUTOCOMPLETE.png deleted file mode 100644 index 20b9005d6..000000000 Binary files a/components/extrasyn/Images/TSYNAUTOCOMPLETE.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNAUTOCORRECT.png b/components/extrasyn/Images/TSYNAUTOCORRECT.png deleted file mode 100644 index 9f9077722..000000000 Binary files a/components/extrasyn/Images/TSYNAUTOCORRECT.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNAWKSYN.png b/components/extrasyn/Images/TSYNAWKSYN.png deleted file mode 100644 index 9f764829e..000000000 Binary files a/components/extrasyn/Images/TSYNAWKSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNBAANSYN.png b/components/extrasyn/Images/TSYNBAANSYN.png deleted file mode 100644 index d988c6ad4..000000000 Binary files a/components/extrasyn/Images/TSYNBAANSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNBATSYN.png b/components/extrasyn/Images/TSYNBATSYN.png deleted file mode 100644 index 321830846..000000000 Binary files a/components/extrasyn/Images/TSYNBATSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNCACHESYN.png b/components/extrasyn/Images/TSYNCACHESYN.png deleted file mode 100644 index ef04e00d9..000000000 Binary files a/components/extrasyn/Images/TSYNCACHESYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNCACSYN.png b/components/extrasyn/Images/TSYNCACSYN.png deleted file mode 100644 index 8011530ba..000000000 Binary files a/components/extrasyn/Images/TSYNCACSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNCOBOLSYN.png b/components/extrasyn/Images/TSYNCOBOLSYN.png deleted file mode 100644 index b129684cc..000000000 Binary files a/components/extrasyn/Images/TSYNCOBOLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNCOMPLETIONPROPOSAL.png b/components/extrasyn/Images/TSYNCOMPLETIONPROPOSAL.png deleted file mode 100644 index 1e82f15ef..000000000 Binary files a/components/extrasyn/Images/TSYNCOMPLETIONPROPOSAL.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNCPMSYN.png b/components/extrasyn/Images/TSYNCPMSYN.png deleted file mode 100644 index 264b7b01b..000000000 Binary files a/components/extrasyn/Images/TSYNCPMSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNCPPSYN.png b/components/extrasyn/Images/TSYNCPPSYN.png deleted file mode 100644 index e20054254..000000000 Binary files a/components/extrasyn/Images/TSYNCPPSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNCSSSYN.png b/components/extrasyn/Images/TSYNCSSSYN.png deleted file mode 100644 index 250ee4337..000000000 Binary files a/components/extrasyn/Images/TSYNCSSSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNCSSYN.png b/components/extrasyn/Images/TSYNCSSYN.png deleted file mode 100644 index 86a467310..000000000 Binary files a/components/extrasyn/Images/TSYNCSSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNDFMSYN.png b/components/extrasyn/Images/TSYNDFMSYN.png deleted file mode 100644 index 6da5e93c5..000000000 Binary files a/components/extrasyn/Images/TSYNDFMSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNDMLSYN.png b/components/extrasyn/Images/TSYNDMLSYN.png deleted file mode 100644 index 31f7c78e1..000000000 Binary files a/components/extrasyn/Images/TSYNDMLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNDOTSYN.png b/components/extrasyn/Images/TSYNDOTSYN.png deleted file mode 100644 index 9e53e9789..000000000 Binary files a/components/extrasyn/Images/TSYNDOTSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEDIT.png b/components/extrasyn/Images/TSYNEDIT.png deleted file mode 100644 index 0d5b2ef69..000000000 Binary files a/components/extrasyn/Images/TSYNEDIT.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEDITOPTIONSDIALOG.png b/components/extrasyn/Images/TSYNEDITOPTIONSDIALOG.png deleted file mode 100644 index ae412f957..000000000 Binary files a/components/extrasyn/Images/TSYNEDITOPTIONSDIALOG.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEDITPRINT.png b/components/extrasyn/Images/TSYNEDITPRINT.png deleted file mode 100644 index 079740b38..000000000 Binary files a/components/extrasyn/Images/TSYNEDITPRINT.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEDITPRINTPREVIEW.png b/components/extrasyn/Images/TSYNEDITPRINTPREVIEW.png deleted file mode 100644 index 9beb083f3..000000000 Binary files a/components/extrasyn/Images/TSYNEDITPRINTPREVIEW.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEDITPYTHONBEHAVIOUR.png b/components/extrasyn/Images/TSYNEDITPYTHONBEHAVIOUR.png deleted file mode 100644 index c8db14d39..000000000 Binary files a/components/extrasyn/Images/TSYNEDITPYTHONBEHAVIOUR.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEDITREGEXSEARCH.png b/components/extrasyn/Images/TSYNEDITREGEXSEARCH.png deleted file mode 100644 index 41aa67ce8..000000000 Binary files a/components/extrasyn/Images/TSYNEDITREGEXSEARCH.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEDITSEARCH.png b/components/extrasyn/Images/TSYNEDITSEARCH.png deleted file mode 100644 index a79bbeb16..000000000 Binary files a/components/extrasyn/Images/TSYNEDITSEARCH.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEXPORTERHTML.png b/components/extrasyn/Images/TSYNEXPORTERHTML.png deleted file mode 100644 index 48cfadb66..000000000 Binary files a/components/extrasyn/Images/TSYNEXPORTERHTML.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEXPORTERRTF.png b/components/extrasyn/Images/TSYNEXPORTERRTF.png deleted file mode 100644 index 2f9126473..000000000 Binary files a/components/extrasyn/Images/TSYNEXPORTERRTF.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNEXPORTERTEX.png b/components/extrasyn/Images/TSYNEXPORTERTEX.png deleted file mode 100644 index 39981af40..000000000 Binary files a/components/extrasyn/Images/TSYNEXPORTERTEX.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNFORTRANSYN.png b/components/extrasyn/Images/TSYNFORTRANSYN.png deleted file mode 100644 index c5896338f..000000000 Binary files a/components/extrasyn/Images/TSYNFORTRANSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNFOXPROSYN.png b/components/extrasyn/Images/TSYNFOXPROSYN.png deleted file mode 100644 index 23820ec91..000000000 Binary files a/components/extrasyn/Images/TSYNFOXPROSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNGALAXYSYN.png b/components/extrasyn/Images/TSYNGALAXYSYN.png deleted file mode 100644 index 0d85da481..000000000 Binary files a/components/extrasyn/Images/TSYNGALAXYSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNGENERALSYN.png b/components/extrasyn/Images/TSYNGENERALSYN.png deleted file mode 100644 index 8ef392a22..000000000 Binary files a/components/extrasyn/Images/TSYNGENERALSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNGWSCRIPTSYN.png b/components/extrasyn/Images/TSYNGWSCRIPTSYN.png deleted file mode 100644 index 6242b3512..000000000 Binary files a/components/extrasyn/Images/TSYNGWSCRIPTSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNHASKELLSYN.png b/components/extrasyn/Images/TSYNHASKELLSYN.png deleted file mode 100644 index e843a9913..000000000 Binary files a/components/extrasyn/Images/TSYNHASKELLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNHC11SYN.png b/components/extrasyn/Images/TSYNHC11SYN.png deleted file mode 100644 index 252e991f1..000000000 Binary files a/components/extrasyn/Images/TSYNHC11SYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNHIGHLIGHTERMANAGER.png b/components/extrasyn/Images/TSYNHIGHLIGHTERMANAGER.png deleted file mode 100644 index a323bf745..000000000 Binary files a/components/extrasyn/Images/TSYNHIGHLIGHTERMANAGER.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNHP48SYN.png b/components/extrasyn/Images/TSYNHP48SYN.png deleted file mode 100644 index 0058b315e..000000000 Binary files a/components/extrasyn/Images/TSYNHP48SYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNHTMLSYN.png b/components/extrasyn/Images/TSYNHTMLSYN.png deleted file mode 100644 index a0e859baa..000000000 Binary files a/components/extrasyn/Images/TSYNHTMLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNIDLSYN.png b/components/extrasyn/Images/TSYNIDLSYN.png deleted file mode 100644 index 7844da0fc..000000000 Binary files a/components/extrasyn/Images/TSYNIDLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNINISYN.png b/components/extrasyn/Images/TSYNINISYN.png deleted file mode 100644 index da52bb260..000000000 Binary files a/components/extrasyn/Images/TSYNINISYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNINNOSYN.png b/components/extrasyn/Images/TSYNINNOSYN.png deleted file mode 100644 index a4cd1c4c8..000000000 Binary files a/components/extrasyn/Images/TSYNINNOSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNJAVASYN.png b/components/extrasyn/Images/TSYNJAVASYN.png deleted file mode 100644 index 970bd7c8b..000000000 Binary files a/components/extrasyn/Images/TSYNJAVASYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNJSCRIPTSYN.png b/components/extrasyn/Images/TSYNJSCRIPTSYN.png deleted file mode 100644 index 96c2038d3..000000000 Binary files a/components/extrasyn/Images/TSYNJSCRIPTSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNKIXSYN.png b/components/extrasyn/Images/TSYNKIXSYN.png deleted file mode 100644 index 889d21a9f..000000000 Binary files a/components/extrasyn/Images/TSYNKIXSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNLDRSYN.png b/components/extrasyn/Images/TSYNLDRSYN.png deleted file mode 100644 index 6f8c11ad8..000000000 Binary files a/components/extrasyn/Images/TSYNLDRSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNLUASYN.png b/components/extrasyn/Images/TSYNLUASYN.png deleted file mode 100644 index 1d2c0f85f..000000000 Binary files a/components/extrasyn/Images/TSYNLUASYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNM3SYN.png b/components/extrasyn/Images/TSYNM3SYN.png deleted file mode 100644 index 3b28c0bcc..000000000 Binary files a/components/extrasyn/Images/TSYNM3SYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNMACRORECORDER.png b/components/extrasyn/Images/TSYNMACRORECORDER.png deleted file mode 100644 index 0038e48fe..000000000 Binary files a/components/extrasyn/Images/TSYNMACRORECORDER.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNMEMO.png b/components/extrasyn/Images/TSYNMEMO.png deleted file mode 100644 index 28cb960ad..000000000 Binary files a/components/extrasyn/Images/TSYNMEMO.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNMODELICASYN.png b/components/extrasyn/Images/TSYNMODELICASYN.png deleted file mode 100644 index e0c3a7287..000000000 Binary files a/components/extrasyn/Images/TSYNMODELICASYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNMSGSYN.png b/components/extrasyn/Images/TSYNMSGSYN.png deleted file mode 100644 index 3ee16bad4..000000000 Binary files a/components/extrasyn/Images/TSYNMSGSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNMULTISYN.png b/components/extrasyn/Images/TSYNMULTISYN.png deleted file mode 100644 index e0406ce7a..000000000 Binary files a/components/extrasyn/Images/TSYNMULTISYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNPASSYN.png b/components/extrasyn/Images/TSYNPASSYN.png deleted file mode 100644 index c38e501af..000000000 Binary files a/components/extrasyn/Images/TSYNPASSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNPERLSYN.png b/components/extrasyn/Images/TSYNPERLSYN.png deleted file mode 100644 index 66c27fdb4..000000000 Binary files a/components/extrasyn/Images/TSYNPERLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNPHPSYN.png b/components/extrasyn/Images/TSYNPHPSYN.png deleted file mode 100644 index 51848392f..000000000 Binary files a/components/extrasyn/Images/TSYNPHPSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNPROGRESSSYN.png b/components/extrasyn/Images/TSYNPROGRESSSYN.png deleted file mode 100644 index 15b03089d..000000000 Binary files a/components/extrasyn/Images/TSYNPROGRESSSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNPROLOGSYN.png b/components/extrasyn/Images/TSYNPROLOGSYN.png deleted file mode 100644 index e2c11f4f2..000000000 Binary files a/components/extrasyn/Images/TSYNPROLOGSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNPYTHONSYN.png b/components/extrasyn/Images/TSYNPYTHONSYN.png deleted file mode 100644 index ca9a8ef81..000000000 Binary files a/components/extrasyn/Images/TSYNPYTHONSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNRCSYN.png b/components/extrasyn/Images/TSYNRCSYN.png deleted file mode 100644 index 4ab120324..000000000 Binary files a/components/extrasyn/Images/TSYNRCSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNRUBYSYN.png b/components/extrasyn/Images/TSYNRUBYSYN.png deleted file mode 100644 index 61c4aa8c7..000000000 Binary files a/components/extrasyn/Images/TSYNRUBYSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNSDDSYN.png b/components/extrasyn/Images/TSYNSDDSYN.png deleted file mode 100644 index d3b39bd06..000000000 Binary files a/components/extrasyn/Images/TSYNSDDSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNSMLSYN.png b/components/extrasyn/Images/TSYNSMLSYN.png deleted file mode 100644 index 1c3c5cf13..000000000 Binary files a/components/extrasyn/Images/TSYNSMLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNSQLSYN.png b/components/extrasyn/Images/TSYNSQLSYN.png deleted file mode 100644 index 1c41eacff..000000000 Binary files a/components/extrasyn/Images/TSYNSQLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNSTSYN.png b/components/extrasyn/Images/TSYNSTSYN.png deleted file mode 100644 index 61c5d6ced..000000000 Binary files a/components/extrasyn/Images/TSYNSTSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNTCLTKSYN.png b/components/extrasyn/Images/TSYNTCLTKSYN.png deleted file mode 100644 index 82d2ac0d9..000000000 Binary files a/components/extrasyn/Images/TSYNTCLTKSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNTEXSYN.png b/components/extrasyn/Images/TSYNTEXSYN.png deleted file mode 100644 index 0cb5c0c0e..000000000 Binary files a/components/extrasyn/Images/TSYNTEXSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNUNIXSHELLSCRIPTSYN.png b/components/extrasyn/Images/TSYNUNIXSHELLSCRIPTSYN.png deleted file mode 100644 index 1b37d3a9e..000000000 Binary files a/components/extrasyn/Images/TSYNUNIXSHELLSCRIPTSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNUNREALSYN.png b/components/extrasyn/Images/TSYNUNREALSYN.png deleted file mode 100644 index 3e7238dea..000000000 Binary files a/components/extrasyn/Images/TSYNUNREALSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNURIOPENER.png b/components/extrasyn/Images/TSYNURIOPENER.png deleted file mode 100644 index 12c87a735..000000000 Binary files a/components/extrasyn/Images/TSYNURIOPENER.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNURISYN.png b/components/extrasyn/Images/TSYNURISYN.png deleted file mode 100644 index 509f88ce3..000000000 Binary files a/components/extrasyn/Images/TSYNURISYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNVBSCRIPTSYN.png b/components/extrasyn/Images/TSYNVBSCRIPTSYN.png deleted file mode 100644 index 6bf8d8b4d..000000000 Binary files a/components/extrasyn/Images/TSYNVBSCRIPTSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNVBSYN.png b/components/extrasyn/Images/TSYNVBSYN.png deleted file mode 100644 index a68c2b0ef..000000000 Binary files a/components/extrasyn/Images/TSYNVBSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNVRML97SYN.png b/components/extrasyn/Images/TSYNVRML97SYN.png deleted file mode 100644 index 7d8bf2ad3..000000000 Binary files a/components/extrasyn/Images/TSYNVRML97SYN.png and /dev/null differ diff --git a/components/extrasyn/Images/TSYNXMLSYN.png b/components/extrasyn/Images/TSYNXMLSYN.png deleted file mode 100644 index 90f215833..000000000 Binary files a/components/extrasyn/Images/TSYNXMLSYN.png and /dev/null differ diff --git a/components/extrasyn/Images/tsynEIFFELsyn.png b/components/extrasyn/Images/tsynEIFFELsyn.png deleted file mode 100644 index c6398a741..000000000 Binary files a/components/extrasyn/Images/tsynEIFFELsyn.png and /dev/null differ diff --git a/components/extrasyn/SyneditHighlighters/synhighlighterasm.pas b/components/extrasyn/SyneditHighlighters/synhighlighterasm.pas index 1b2708923..0c1c696f4 100644 --- a/components/extrasyn/SyneditHighlighters/synhighlighterasm.pas +++ b/components/extrasyn/SyneditHighlighters/synhighlighterasm.pas @@ -540,22 +540,22 @@ end; function TSynAsmSyn.GetSampleSource: string; begin - Result := '; x86 assembly sample source'#13#10 + - ' CODE SEGMENT BYTE PUBLIC'#13#10 + - ' ASSUME CS:CODE'#13#10 + - #13#10 + - ' PUSH SS'#13#10 + - ' POP DS'#13#10 + - ' MOV AX, AABBh'#13#10 + - ' MOV BYTE PTR ES:[DI], 255'#13#10 + - ' JMP SHORT AsmEnd'#13#10 + - #13#10 + - ' welcomeMsg DB ''Hello World'', 0'#13#10 + - #13#10 + - ' AsmEnd:'#13#10 + - ' MOV AX, 0'#13#10 + - #13#10 + - ' CODE ENDS'#13#10 + + Result := '; x86 assembly sample source' + LineEnding + + ' CODE SEGMENT BYTE PUBLIC' + LineEnding + + ' ASSUME CS:CODE' + LineEnding + + LinEending + + ' PUSH SS' + LineEnding + + ' POP DS' + LineEnding + + ' MOV AX, AABBh' + LineEnding + + ' MOV BYTE PTR ES:[DI], 255' + LineEnding + + ' JMP SHORT AsmEnd' + LineEnding + + LineEnding + + ' welcomeMsg DB ''Hello World'', 0' + LineEnding + + LineEnding + + ' AsmEnd:' + LineEnding + + ' MOV AX, 0' + LineEnding + + LineEnding + + ' CODE ENDS' + LineEnding + 'END'; end; diff --git a/components/extrasyn/SyneditHighlighters/synhighlighterawk.pas b/components/extrasyn/SyneditHighlighters/synhighlighterawk.pas index aa5d98649..34fbae449 100644 --- a/components/extrasyn/SyneditHighlighters/synhighlighterawk.pas +++ b/components/extrasyn/SyneditHighlighters/synhighlighterawk.pas @@ -595,6 +595,14 @@ begin Result := ['0'..'9', 'a'..'z', 'A'..'Z'] + TSynSpecialChars; end; +function TSynAWKSyn.GetSampleSource :string; +begin + Result := + 'BEGIN { FS='':''; print "This is the first line\n" }' + LineEnding + + '{ print "LINE",NR,$1 }' + LineEnding + + 'END { print "This is the last line\n" }'; +end; + function TSynAWKSyn.IsFilterStored: Boolean; begin Result := fDefaultFilter <> SYNS_FilterAWK; @@ -605,14 +613,6 @@ begin Result := SYNS_LangAWK; end; -function TSynAWKSyn.GetSampleSource :string; -begin - Result := - 'BEGIN { FS='':''; print "This is the first line\n" }' + LineEnding + - '{ print "LINE",NR,$1 }' + LineEnding + - 'END { print "This is the last line\n" }'; -end; - initialization RegisterPlaceableHighlighter(TSynAWKSyn); diff --git a/components/extrasyn/SyneditHighlighters/synhighlightercobol.pas b/components/extrasyn/SyneditHighlighters/synhighlightercobol.pas index bfe28da78..b191855a9 100644 --- a/components/extrasyn/SyneditHighlighters/synhighlightercobol.pas +++ b/components/extrasyn/SyneditHighlighters/synhighlightercobol.pas @@ -2198,86 +2198,86 @@ end; function TSynCobolSyn.GetSampleSource: string; begin - Result := '000100* This is a sample file to be used to show all TSynCobolSyn''s'#13#10 + - '000200* features.'#13#10 + - '000300* This isn''t a valid COBOL program.'#13#10 + - '000400'#13#10 + - '000500* 1. Supported COBOL features.'#13#10 + - '000600'#13#10 + - '000700* 1.1 Sequence area.'#13#10 + - '000800* First six columns in COBOL are reserved for enumeration'#13#10 + - '000900* of source lines.'#13#10 + - '001000* 1.2 Indicator area.'#13#10 + - '001100* 7th column in COBOL is reserved for special markers like ''*'''#13#10 + - '001200* or ''D''.'#13#10 + - '001300* 1.3 Comment lines.'#13#10 + - '001400* Any line started from ''*'' in 7th column is a comment.'#13#10 + - '001500* No separate word highlighting will be done by the editor.'#13#10 + - '001600* 1.4 Debug lines.'#13#10 + - '001700D Any line started from ''D'' will be treated as containing debug'#13#10 + - '001800D commands. No separate word highlighting will be done'#13#10 + - '001900D by the editor.'#13#10 + - '002000* 1.5 Tag area.'#13#10 + - '002100* Only columns from 8th till 72th can be used for COBOL TAG_AREA'#13#10 + - '002200* program. Columns beyond the 72th one may be used by some TAG_AREA'#13#10 + - '002300* COBOL compilers to tag the code in some internal way. TAG_AREA'#13#10 + - '002400* 1.6 Area A identifiers.'#13#10 + - '002500* In area A (from 8th column till'#13#10 + - '002600* 11th one) you should type only sections''/paragraphs'' names.'#13#10 + - '002700* For example "SOME" is a section name:'#13#10 + - '002800 SOME SECTION.'#13#10 + - '002900* 1.7 Preprocessor directives.'#13#10 + - '003000* For example "COPY" is a preprocessor directive:'#13#10 + - '003100 COPY "PRD-DATA.SEL".'#13#10 + - '003200* 1.8 Key words.'#13#10 + - '003300* For example "ACCEPT" and "AT" are COBOL key words:'#13#10 + - '003400 ACCEPT WS-ENTRY AT 2030.'#13#10 + - '003500* 1.9 Boolean constants.'#13#10 + - '003600* These are "TRUE" and "FALSE" constants. For example:'#13#10 + - '003700 EVALUATE TRUE.'#13#10 + - '003800* 1.10 Numbers.'#13#10 + - '003900* Here are the examples of numbers:'#13#10 + - '004000 01 WSV-TEST-REC.'#13#10 + - '004100 03 WSV-INT-T PIC 9(5) VALUE 12345.'#13#10 + - '004200 03 WSV-PRICES PIC 9(4)V99 COMP-3 VALUE 0000.33. '#13#10 + - '004300 03 WSV-Z-PRICES PIC Z(5)9.99- VALUE -2.12. '#13#10 + - '004400 03 WSV-STORE-DATE PIC 9(4)V99E99 VALUE 0001.33E02.'#13#10 + - '004500* 1.11 Strings.'#13#10 + - '004600* The following types of strings are supported:'#13#10 + - '004700* 1.11.1 Quoted strings.'#13#10 + - '004800 MOVE "The name of field is ""PRODUCT""" TO WS-ERR-MESS.'#13#10 + - '004900 MOVE ''The name of field is ''''PRODUCT'''''' TO WS-ERR-MESS.'#13#10 + - '005000* 1.11.2 Pseudo-text.'#13#10 + - '005100 COPY'#13#10 + - '005200 REPLACING ==+00001== BY +2'#13#10 + - '005300 == 1 == BY -3.'#13#10 + - '005400* 1.11.3 Figurative constants.'#13#10 + - '005500* For example "SPACES" is figurative constant:'#13#10 + - '005600 DISPLAY SPACES UPON CRT.'#13#10 + - '005700* 1.12 Continued lines.'#13#10 + - '005800* Only continued strings are supported. For example:'#13#10 + - '005900 MOVE "The name of figurative constant field is'#13#10 + - '006000-"SPACES" TO WS-ERR-MESS.'#13#10 + - '006100* Or (a single quotation mark in 72th column):'#13#10 + - '005900 MOVE "The name of figurative constant field is ""SPACES"'#13#10 + - '006000-""" TO WS-ERR-MESS.'#13#10 + - '006100'#13#10 + - '006200* 2. Unsupported COBOL features.'#13#10 + - '006300'#13#10 + - '006400* 2.1 Continued lines.'#13#10 + - '006500* Continuation of key words is not supported. For example,'#13#10 + - '006600* the following COBOL code is valid but TSynCobolSyn won''t'#13#10 + - '006700* highlight "VALUE" keyword properly:'#13#10 + - '006800 03 WSV-STORE-DATE PIC 9(4)V99E99 VAL'#13#10 + - '006900-UE 0001.33E02.'#13#10 + - '007000* 2.2 Identifiers started from digits.'#13#10 + - '007100* They are valid in COBOL but won''t be highlighted properly'#13#10 + - '007200* by TSynCobolSyn. For example, "000-main" is a paragraph'#13#10 + - '007300* name and should be highlighted as Area A identifier:'#13#10 + - '007400 000-main.'#13#10 + - '007500* 2.3 Comment entries in optional paragraphs'#13#10 + - '007600* The so called comment-entries in the optional paragraphs'#13#10 + - '007700* of the Identification Division are not supported and won''t'#13#10 + + Result := '000100* This is a sample file to be used to show all TSynCobolSyn''s' + LineEnding + + '000200* features.' + LineEnding + + '000300* This isn''t a valid COBOL program.' + LineEnding + + '000400' + LineEnding + + '000500* 1. Supported COBOL features.' + LineEnding + + '000600' + LineEnding + + '000700* 1.1 Sequence area.' + LineEnding + + '000800* First six columns in COBOL are reserved for enumeration' + LineEnding + + '000900* of source lines.' + LineEnding + + '001000* 1.2 Indicator area.' + LineEnding + + '001100* 7th column in COBOL is reserved for special markers like ''*''' + LineEnding + + '001200* or ''D''.' + LineEnding + + '001300* 1.3 Comment lines.' + LineEnding + + '001400* Any line started from ''*'' in 7th column is a comment.' + LineEnding + + '001500* No separate word highlighting will be done by the editor.' + LineEnding + + '001600* 1.4 Debug lines.' + LineEnding + + '001700D Any line started from ''D'' will be treated as containing debug' + LineEnding + + '001800D commands. No separate word highlighting will be done' + LineEnding + + '001900D by the editor.' + LineEnding + + '002000* 1.5 Tag area.' + LineEnding + + '002100* Only columns from 8th till 72th can be used for COBOL TAG_AREA' + LineEnding + + '002200* program. Columns beyond the 72th one may be used by some TAG_AREA' + LineEnding + + '002300* COBOL compilers to tag the code in some internal way. TAG_AREA' + LineEnding + + '002400* 1.6 Area A identifiers.' + LineEnding + + '002500* In area A (from 8th column till' + LineEnding + + '002600* 11th one) you should type only sections''/paragraphs'' names.' + LineEnding + + '002700* For example "SOME" is a section name:' + LineEnding + + '002800 SOME SECTION.' + LineEnding + + '002900* 1.7 Preprocessor directives.' + LineEnding + + '003000* For example "COPY" is a preprocessor directive:' + LineEnding + + '003100 COPY "PRD-DATA.SEL".' + LineEnding + + '003200* 1.8 Key words.' + LineEnding + + '003300* For example "ACCEPT" and "AT" are COBOL key words:' + LineEnding + + '003400 ACCEPT WS-ENTRY AT 2030.' + LineEnding + + '003500* 1.9 Boolean constants.' + LineEnding + + '003600* These are "TRUE" and "FALSE" constants. For example:' + LineEnding + + '003700 EVALUATE TRUE.' + LineEnding + + '003800* 1.10 Numbers.' + LineEnding + + '003900* Here are the examples of numbers:' + LineEnding + + '004000 01 WSV-TEST-REC.' + LineEnding + + '004100 03 WSV-INT-T PIC 9(5) VALUE 12345.' + LineEnding + + '004200 03 WSV-PRICES PIC 9(4)V99 COMP-3 VALUE 0000.33. ' + LineEnding + + '004300 03 WSV-Z-PRICES PIC Z(5)9.99- VALUE -2.12. ' + LineEnding + + '004400 03 WSV-STORE-DATE PIC 9(4)V99E99 VALUE 0001.33E02.' + LineEnding + + '004500* 1.11 Strings.' + LineEnding + + '004600* The following types of strings are supported:' + LineEnding + + '004700* 1.11.1 Quoted strings.' + LineEnding + + '004800 MOVE "The name of field is ""PRODUCT""" TO WS-ERR-MESS.' + LineEnding + + '004900 MOVE ''The name of field is ''''PRODUCT'''''' TO WS-ERR-MESS.' + LineEnding + + '005000* 1.11.2 Pseudo-text.' + LineEnding + + '005100 COPY' + LineEnding + + '005200 REPLACING ==+00001== BY +2' + LineEnding + + '005300 == 1 == BY -3.' + LineEnding + + '005400* 1.11.3 Figurative constants.' + LineEnding + + '005500* For example "SPACES" is figurative constant:' + LineEnding + + '005600 DISPLAY SPACES UPON CRT.' + LineEnding + + '005700* 1.12 Continued lines.' + LineEnding + + '005800* Only continued strings are supported. For example:' + LineEnding + + '005900 MOVE "The name of figurative constant field is' + LineEnding + + '006000-"SPACES" TO WS-ERR-MESS.' + LineEnding + + '006100* Or (a single quotation mark in 72th column):' + LineEnding + + '005900 MOVE "The name of figurative constant field is ""SPACES"' + LineEnding + + '006000-""" TO WS-ERR-MESS.' + LineEnding + + '006100' + LineEnding + + '006200* 2. Unsupported COBOL features.' + LineEnding + + '006300' + LineEnding + + '006400* 2.1 Continued lines.' + LineEnding + + '006500* Continuation of key words is not supported. For example,' + LineEnding + + '006600* the following COBOL code is valid but TSynCobolSyn won''t' + LineEnding + + '006700* highlight "VALUE" keyword properly:' + LineEnding + + '006800 03 WSV-STORE-DATE PIC 9(4)V99E99 VAL' + LineEnding + + '006900-UE 0001.33E02.' + LineEnding + + '007000* 2.2 Identifiers started from digits.' + LineEnding + + '007100* They are valid in COBOL but won''t be highlighted properly' + LineEnding + + '007200* by TSynCobolSyn. For example, "000-main" is a paragraph' + LineEnding + + '007300* name and should be highlighted as Area A identifier:' + LineEnding + + '007400 000-main.' + LineEnding + + '007500* 2.3 Comment entries in optional paragraphs' + LineEnding + + '007600* The so called comment-entries in the optional paragraphs' + LineEnding + + '007700* of the Identification Division are not supported and won''t' + LineEnding + '007800* be highlighted properly.'; end; diff --git a/components/extrasyn/SyneditHighlighters/synhighlighterfortran.pas b/components/extrasyn/SyneditHighlighters/synhighlighterfortran.pas index 03cdce0cc..082ea8ea5 100644 --- a/components/extrasyn/SyneditHighlighters/synhighlighterfortran.pas +++ b/components/extrasyn/SyneditHighlighters/synhighlighterfortran.pas @@ -155,6 +155,7 @@ type procedure CommentProc; protected function GetIdentChars: TSynIdentChars; override; + function GetSampleSource: String; override; function IsFilterStored: Boolean; override; public class function GetLanguageName: string; override; @@ -962,6 +963,43 @@ begin Result := TSynValidStringChars; end; +function TSynFortranSyn.GetSampleSource: String; +begin + Result := + '* euclid.f (FORTRAN 77)' + LineEnding + + '* Find greatest common divisor using the Euclidean algorithm' + LineEnding + + LineEnding + + ' PROGRAM EUCLID' + LineEnding + + ' PRINT *, ''A?''' + LineEnding + + ' READ *, NA' + LineEnding + + ' IF (NA.LE.0) THEN' + LineEnding + + ' PRINT *, ''A must be a positive integer.''' + LineEnding + + ' STOP' + LineEnding + + ' END IF' + LineEnding + + ' PRINT *, ''B?''' + LineEnding + + ' READ *, NB' + LineEnding + + ' IF (NB.LE.0) THEN' + LineEnding + + ' PRINT *, ''B must be a positive integer.''' + LineEnding + + ' STOP' + LineEnding + + ' END IF' + LineEnding + + ' PRINT *, ''The GCD of'', NA, '' and'', NB, '' is'', NGCD(NA, NB), ''.''' + LineEnding + + ' STOP' + LineEnding + + ' END' + LineEnding + + LineEnding + + ' FUNCTION NGCD(NA, NB)' + LineEnding + + ' IA = NA' + LineEnding + + ' IB = NB' + LineEnding + + ' 1 IF (IB.NE.0) THEN' + LineEnding + + ' ITEMP = IA' + LineEnding + + ' IA = IB' + LineEnding + + ' IB = MOD(ITEMP, IB)' + LineEnding + + ' GOTO 1' + LineEnding + + ' END IF' + LineEnding + + ' NGCD = IA' + LineEnding + + ' RETURN' + LineEnding + + ' END'; +end; + function TSynFortranSyn.IsFilterStored: Boolean; begin Result := fDefaultFilter <> SYNS_FilterFortran; diff --git a/components/extrasyn/TestHighlighters/TestSynHighlighter.lpi b/components/extrasyn/TestHighlighters/TestSynHighlighter.lpi index 37e2d353f..dad2a87a2 100644 --- a/components/extrasyn/TestHighlighters/TestSynHighlighter.lpi +++ b/components/extrasyn/TestHighlighters/TestSynHighlighter.lpi @@ -39,13 +39,12 @@ - + - - + @@ -56,11 +55,12 @@ - - - + + + + - + @@ -69,141 +69,141 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -211,7 +211,7 @@ - + @@ -219,48 +219,44 @@ - + - + - + - - - + - + - + - - - + - + @@ -268,15 +264,15 @@ - + - - - - + + + + @@ -285,7 +281,7 @@ - + @@ -293,35 +289,37 @@ - + - - + + + + - + - + - + @@ -329,11 +327,11 @@ - + - + @@ -341,27 +339,29 @@ - + - + - + - + - + + + @@ -370,28 +370,28 @@ - + - + - + - + @@ -399,70 +399,74 @@ - + - + - + - - - - + + + + - - - - - + + + + + - - - + + + + + - - - + + + + - + - - - + + + + - + @@ -470,7 +474,7 @@ - + @@ -478,41 +482,43 @@ - + - + - + - - + + + + - + - + @@ -520,7 +526,7 @@ - + @@ -528,7 +534,7 @@ - + @@ -536,19 +542,19 @@ - + - + - + @@ -556,118 +562,118 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + @@ -675,200 +681,250 @@ - + - + - + - - - - - + + + + - + - + - + - + - - + - + - + - - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + - - + + - - + + diff --git a/components/extrasyn/TestHighlighters/unit1.lfm b/components/extrasyn/TestHighlighters/unit1.lfm index b3ac3f0a0..da0665f2e 100644 --- a/components/extrasyn/TestHighlighters/unit1.lfm +++ b/components/extrasyn/TestHighlighters/unit1.lfm @@ -8,11 +8,12 @@ object Form1: TForm1 ClientWidth = 742 Menu = MainMenu1 OnCreate = FormCreate + OnDestroy = FormDestroy LCLVersion = '1.9.0.0' inline SynEdit1: TSynEdit Left = 0 - Height = 410 - Top = 19 + Height = 429 + Top = 0 Width = 742 Align = alClient Font.Height = -13 @@ -647,18 +648,6 @@ object Form1: TForm1 end end end - object Label1: TLabel - Left = 0 - Height = 15 - Top = 2 - Width = 742 - Align = alTop - Alignment = taCenter - BorderSpacing.Top = 2 - BorderSpacing.Bottom = 2 - Caption = 'Label1' - ParentColor = False - end object MainMenu1: TMainMenu left = 152 top = 40 diff --git a/components/extrasyn/TestHighlighters/unit1.pas b/components/extrasyn/TestHighlighters/unit1.pas index ad4122a96..192860535 100644 --- a/components/extrasyn/TestHighlighters/unit1.pas +++ b/components/extrasyn/TestHighlighters/unit1.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, - SynEdit, Menus, StdCtrls, SynEditHighlighter, + SynEdit, Menus, StdCtrls, ComCtrls, SynEditHighlighter, SynHighlighterADSP21xx, SynHighlighterFortran, SynHighlighterFoxpro, SynHighlighterGalaxy, SynHighlighterBaan, SynHighlighterHaskell, SynHighlighterCache, {SynHighlighterDfm,} SynHighlighterModelica, SynHighlighterCobol, @@ -18,22 +18,23 @@ uses SynHighlighterST, SynHighlighter8051, SynHighlighterLua, SynHighlighterProlog, SynHighlighterCAC, SynHighlighterAWK; +// SynHighlighterGeneral; + type { TForm1 } - TForm1 = class(TForm) - Label1: TLabel; MainMenu1: TMainMenu; MenuItem1: TMenuItem; SynEdit1: TSynEdit; - procedure MenuClick(Sender: TObject); procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure MenuClick(Sender: TObject); private - { private declarations } - FHighlighters: Array of TSynCustomHighlighter; + FHighlighters: TFPList; + procedure SelectHighlighter(AIndex: Integer); public - { public declarations } + end; var @@ -46,6 +47,27 @@ uses {$R *.lfm} +const + FORM_CAPTION = 'SyntaxHighlighter Test'; + +function GetHighlighterCaption(hl: TSynCustomHighlighter): String; +begin + if (hl is TSynUniSyn) and (TSynUniSyn(hl).Info.General.Name <> '') then + Result := TSynUniSyn(hl).Info.General.Name + else + Result := hl.LanguageName; +end; + +function CompareHighlighters(p1, p2: Pointer): Integer; +var + s1, s2: String; +begin + s1 := GetHighlighterCaption(TSynCustomHighlighter(p1)); + s2 := GetHighlighterCaption(TSynCustomHighlighter(p2)); + Result := AnsiCompareText(s1, s2); +end; + + { TForm1 } procedure TForm1.FormCreate(Sender: TObject); @@ -62,95 +84,107 @@ procedure TForm1.FormCreate(Sender: TObject); end; var - i, c :Integer; - item :TMenuItem; + i, c: Integer; + item: TMenuItem; + hl: TSynCustomHighlighter; begin - SetLength(FHighlighters, 35); + Caption := FORM_CAPTION; - for i:= low(FHighlighters) to high(FHighlighters) do - FHighlighters[i] := Nil; + FHighlighters := TFPList.Create; - FHighlighters[00] := TSynADSP21xxSyn.Create(self); - FHighlighters[01] := TSynFortranSyn.Create(self); - FHighlighters[02] := TSynFoxproSyn.Create(self); - FHighlighters[03] := TSynGalaxySyn.Create(self); - FHighlighters[04] := TSynBaanSyn.Create(self); - FHighlighters[05] := TSynAWKSyn.Create(self); - FHighlighters[06] := TSynHaskellSyn.Create(self); - FHighlighters[07] := TSynCacheSyn.Create(self); - FHighlighters[08] := TSynModelicaSyn.Create(self); - FHighlighters[09] := TSynCobolSyn.Create(self); - FHighlighters[10] := TSynCSSyn.Create(self); - FHighlighters[11] := TSynDmlSyn.Create(self); - FHighlighters[12] := TSynProgressSyn.Create(self); - FHighlighters[13] := TSynEiffelSyn.Create(self); - FHighlighters[14] := TSynGWScriptSyn.Create(self); - FHighlighters[15] := TSynHP48Syn.Create(self); - FHighlighters[16] := TSynVBScriptSyn.Create(self); - FHighlighters[17] := TSynUnrealSyn.Create(self); - FHighlighters[18] := TSynVrml97Syn.Create(self); - FHighlighters[19] := TSynTclTkSyn.Create(self); - FHighlighters[20] := TSynLDRSyn.Create(self); - FHighlighters[21] := TSynRubySyn.Create(self); - FHighlighters[22] := TSynInnoSyn.Create(self); - FHighlighters[23] := TSynAsmSyn.Create(self); - FHighlighters[24] := TSynDOTSyn.Create(self); - FHighlighters[25] := TSynIdlSyn.Create(self); - FHighlighters[26] := TSynKixSyn.Create(self); - FHighlighters[27] := TSynSDDSyn.Create(self); - FHighlighters[28] := TSynSMLSyn.Create(self); - FHighlighters[29] := TSynURISyn.Create(self); - FHighlighters[30] := TSynM3Syn.Create(self); - FHighlighters[31] := TSynRCSyn.Create(self); - FHighlighters[32] := TSynPrologSyn.Create(Self); - FHighlighters[33] := TSynLuaSyn.Create(Self); - FHighlighters[34] := TSyn8051Syn.Create(Self); - FHighlighters[35] := TSynCACSyn.Create(Self); + // extra highlighters + FHighlighters.Add(TSynADSP21xxSyn.Create(self)); + FHighlighters.Add(TSynFortranSyn.Create(self)); + FHighlighters.Add(TSynFoxproSyn.Create(self)); + FHighlighters.Add(TSynGalaxySyn.Create(self)); + FHighlighters.Add(TSynBaanSyn.Create(self)); + FHighlighters.Add(TSynAWKSyn.Create(self)); + FHighlighters.Add(TSynHaskellSyn.Create(self)); + FHighlighters.Add(TSynCacheSyn.Create(self)); + FHighlighters.Add(TSynModelicaSyn.Create(self)); + FHighlighters.Add(TSynCobolSyn.Create(self)); + FHighlighters.Add(TSynCSSyn.Create(self)); + FHighlighters.Add(TSynDmlSyn.Create(self)); + FHighlighters.Add(TSynProgressSyn.Create(self)); + FHighlighters.Add(TSynEiffelSyn.Create(self)); + FHighlighters.Add(TSynGWScriptSyn.Create(self)); + FHighlighters.Add(TSynHP48Syn.Create(self)); + FHighlighters.Add(TSynVBScriptSyn.Create(self)); + FHighlighters.Add(TSynUnrealSyn.Create(self)); + FHighlighters.Add(TSynVrml97Syn.Create(self)); + FHighlighters.Add(TSynTclTkSyn.Create(self)); + FHighlighters.Add(TSynLDRSyn.Create(self)); + FHighlighters.Add(TSynRubySyn.Create(self)); + FHighlighters.Add(TSynInnoSyn.Create(self)); + FHighlighters.Add(TSynAsmSyn.Create(self)); + FHighlighters.Add(TSynDOTSyn.Create(self)); + FHighlighters.Add(TSynIdlSyn.Create(self)); + FHighlighters.Add(TSynKixSyn.Create(self)); + FHighlighters.Add(TSynSDDSyn.Create(self)); + FHighlighters.Add(TSynSMLSyn.Create(self)); + FHighlighters.Add(TSynURISyn.Create(self)); + FHighlighters.Add(TSynM3Syn.Create(self)); + FHighlighters.Add(TSynRCSyn.Create(self)); + FHighlighters.Add(TSynPrologSyn.Create(Self)); + FHighlighters.Add(TSynLuaSyn.Create(Self)); + FHighlighters.Add(TSyn8051Syn.Create(Self)); + FHighlighters.Add(TSynCACSyn.Create(Self)); + FHighlighters.Add(TSynSTSyn.Create(self)); - // FHighlighters[06] := TSynGeneralSyn.Create(self); - // FHighlighters[09] := TSynDfmSyn.Create(self); - // FHighlighters[12] := TSynUniSyn.Create(self); - // FHighlighters[12] := TSynCPMSyn.Create(self); - // FHighlighters[30] := TSynMsgSyn.Create(self); - // FHighlighters[36] := TSynSTSyn.Create(self); +// FHighlighters.Add(TSynCPMSyn.Create(self)); +// FHighlighters.Add(TSynGeneralSyn.Create(self)); +// FHighlighters.Add(TSynDfmSyn.Create(self)); +// FHighlighters.Add/TSynUniSyn.Create(self)); +// FHighlighters.Add(TSynMsgSyn.Create(self)); - for i:= low(FHighlighters) to high(FHighlighters) do - if Assigned(FHighlighters[i]) then begin - SetDefaultColors(FHighlighters[i]); - item := TMenuItem.Create(self); - item.Tag := i+1; //0 = unknown highlighter + FHighlighters.Sort(@CompareHighlighters); + + for i:=0 to FHighlighters.Count-1 do begin + hl := TSynCustomHighlighter(FHighlighters[i]); + if Assigned(hl) then begin + SetDefaultColors(hl); + item := TMenuItem.Create(self); + item.Tag := i+1; //0 = unknown highlighter try - if (FHighlighters[i] is TSynUniSyn) and (TSynUniSyn(FHighlighters[i]).Info.General.Name <> '') then - item.Caption := IntToStr(i) + ' - ' + TSynUniSyn(FHighlighters[i]).Info.General.Name - else - item.Caption := IntToStr(i) + ' - ' + TSynCustomHighlighter(FHighlighters[i]).LanguageName; + item.Caption := Format('%d - %s', [i, GetHighlighterCaption(hl)]); except on E : Exception do ShowMessage(E.Message+LineEnding+' at index '+inttostr(i)); end; - item.Name := FHighlighters[i].ClassName; +// item.Hint := hl.ClassName; item.OnClick := @MenuClick; - if i > 27 then - WriteLn(I, ' : ',Item.Name,' : ', item.Caption); MenuItem1.Add(item); end; + end; - SynEdit1.Highlighter := FHighlighters[12]; - Label1.Caption := FHighlighters[12].ClassName; + SelectHighlighter(12); +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + FHighlighters.Free; end; procedure TForm1.MenuClick(Sender: TObject); -var i,c:Integer; +var + i, idx, c:Integer; begin - c:= ComponentCount-1; + c := ComponentCount-1; if (Sender is TMenuItem) and (TMenuItem(Sender).Tag > 0) then begin - SynEdit1.Highlighter := FHighlighters[TMenuItem(Sender).Tag-1]; - Caption := SynEdit1.Highlighter.LanguageName; - SynEdit1.Text := SynEdit1.Highlighter.SampleSource; - Label1.Caption := Caption; + idx := TMenuItem(Sender).Tag - 1; + SelectHighlighter(idx); end; end; +procedure TForm1.SelectHighlighter(AIndex: Integer); +begin + SynEdit1.Highlighter := TSynCustomHighlighter(FHighlighters[AIndex]); + SynEdit1.Text := SynEdit1.Highlighter.SampleSource; + Caption := Format('%s - %s [%s]', [ + FORM_CAPTION, SynEdit1.Highlighter.LanguageName, SynEdit1.Highlighter.ClassName + ]); +end; + end. diff --git a/components/extrasyn/extrahighlighters.lpk b/components/extrasyn/extrahighlighters.lpk index 5f4399412..54daa8e46 100644 --- a/components/extrasyn/extrahighlighters.lpk +++ b/components/extrasyn/extrahighlighters.lpk @@ -15,7 +15,7 @@ - + @@ -161,6 +161,18 @@ + + + + + + + + + + + + diff --git a/components/extrasyn/extrahighlighters.pas b/components/extrasyn/extrahighlighters.pas index 1ed411b2b..65532bd8c 100644 --- a/components/extrasyn/extrahighlighters.pas +++ b/components/extrasyn/extrahighlighters.pas @@ -19,7 +19,8 @@ uses SynHighlighterModelica, SynHighlighterProgress, SynHighlighterProlog, SynHighlighterRC, SynHighlighterRuby, SynHighlighterSDD, SynHighlighterSml, SynHighlighterTclTk, SynHighlighterUnreal, SynHighlighterVBScript, - SynHighlighterVrml97, SynHighlighter8051; + SynHighlighterVrml97, SynHighlighter8051, SynHighlighterURI, + SynHighlighterST, SynHighlighterGeneral; implementation diff --git a/components/extrasyn/uhighlighterreg.pas b/components/extrasyn/uhighlighterreg.pas index 3c7950386..ab1656e81 100644 --- a/components/extrasyn/uhighlighterreg.pas +++ b/components/extrasyn/uhighlighterreg.pas @@ -6,41 +6,93 @@ interface uses Classes, SysUtils, + SynHighlighter8051, + SynHighlighterADSP21xx, + SynHighlighterAsm, + SynHighlighterAWK, + SynHighlighterBaan, + SynHighlighterCAC, + SynHighlighterCache, + SynHighlighterCobol, +// SynHighlighterCPM, + SynHighlighterCS, + SynHighlighterDml, + SynHighlighterDOT, + SynHighlighterEiffel, + SynHighlighterFortran, + SynHighlighterFoxpro, + SynHighlighterGalaxy, + SynHighlighterGWS, + SynHighlighterHaskell, + SynHighlighterHP48, + SynHighlighterIDL, + SynHighlighterInno, + SynHighlighterKix, + SynHighlighterLDraw, + SynHighlighterLua, + SynHighlighterM3, + SynHighlighterModelica, + SynHighlighterProgress, + SynHighlighterProlog, + SynHighlighterRC, + SynHighlighterRuby, + SynHighlighterSDD, + SynHighlighterSml, + SynHighlighterTclTk, + SynHighlighterUnreal, + SynHighlighterVBScript, + SynHighlighterVrml97; - SynHighlighterADSP21xx, SynHighlighterFortran, SynHighlighterFoxpro, SynHighlighterGalaxy, SynHighlighterBaan, - SynHighlighterHaskell, SynHighlighterCache, SynHighlighterCS, SynHighlighterDml, SynHighlighterCAC, - SynHighlighterModelica, SynHighlighterCobol, SynHighlighterTclTk, SynHighlighterHP48, SynHighlighterAWK, - SynHighlighterProgress, SynHighlighterEiffel, SynHighlighterGWS, SynHighlighterDOT, SynHighlighterLDraw, - SynHighlighterVBScript, SynHighlighterUnreal, SynHighlighterVrml97, SynHighlighterSml, SynHighlighterIDL, - SynHighlighterRuby, SynHighlighterInno, SynHighlighterAsm, SynHighlighter8051, SynHighlighterLua, - SynHighlighterKix, SynHighlighterSDD, SynHighlighterProlog, SynHighlighterRC, SynHighlighterM3; - -{.$R ImagesPNG.Res} -{.$R ImagesPNG.Res} -{.$R ImagesPNG.Res} - -{.$R *.rc} -{.$R Images.rc} -//failed miserably to use rc files they are not linked in lazarus for some reason although if I delete the res file -//from the disk the compiler complains about the missing file. procedure Register; implementation -uses LResources; +uses + LResources; +{$R images.res} procedure Register; begin - RegisterComponents('SynEdit Highlighters',[TSynADSP21xxSyn, TSynTclTkSyn, TSynRubySyn, TSynDOTSyn, TSynCSSyn, - TSynHaskellSyn, TSynFoxproSyn, TSynInnoSyn, TSynDmlSyn, TSynCACSyn, - TSynModelicaSyn, TSynVrml97Syn, TSynHP48Syn, TSynKixSyn, TSynAWKSyn, - TSynProgressSyn, TSynEiffelSyn, TSynBaanSyn, TSynM3Syn, TSynLDRSyn, - TSynVBScriptSyn, TSynUnrealSyn, TSynSMLSyn, TSynIdlSyn, TSynCobolSyn, - TSynGWScriptSyn, TSynGalaxySyn, TSyn8051Syn, TSynAsmSyn, TSynLuaSyn, - TSynFortranSyn, TSynPrologSyn, TSynSDDSyn, TSynRCSyn, TSynCacheSyn]); + RegisterComponents('SynEdit Highlighters',[ + TSyn8051Syn, + TSynADSP21xxSyn, + TSynAsmSyn, + TSynAWKSyn, + TSynBaanSyn, + TSynCacheSyn, + TSynCACSyn, + TSynCobolSyn, +// TSynCPMSyn, + TSynCSSyn, + TSynDmlSyn, + TSynDOTSyn, + TSynEiffelSyn, + TSynFortranSyn, + TSynFoxproSyn, + TSynGalaxySyn, + TSynGWScriptSyn, + TSynHaskellSyn, + TSynHP48Syn, + TSynIdlSyn, + TSynInnoSyn, + TSynKixSyn, + TSynLDRSyn, + TSynLuaSyn, + TSynM3Syn, + TSynModelicaSyn, + TSynProgressSyn, + TSynPrologSyn, + TSynRCSyn, + TSynRubySyn, + TSynSMLSyn, + TSynSDDSyn, + TSynTclTkSyn, + TSynUnrealSyn, + TSynVBScriptSyn, + TSynVrml97Syn + ]); end; -initialization - {$I Images.lrs} + end.