SynEdit: SynHighlighterJava: basic parsing of Annotations by Flavio. Issue #0024706

git-svn-id: trunk@42488 -
This commit is contained in:
martin 2013-08-24 23:44:34 +00:00
parent acfad58d98
commit 00f34de6d3
19 changed files with 83 additions and 5 deletions

View File

@ -9,6 +9,10 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -11,6 +11,10 @@ msgstr ""
"Language: cs\n"
"X-Generator: Poedit 1.5.4\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr "Asp"

View File

@ -9,6 +9,10 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr "ASP"

View File

@ -9,6 +9,10 @@ msgstr ""
"POT-Creation-Date: \n"
"MIME-Version: 1.0\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr "Asp"

View File

@ -4,6 +4,10 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -9,6 +9,10 @@ msgstr ""
"Last-Translator: Beuselinck Vincent <vincent@beuselinck.fr>\n"
"Language-Team: \n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -9,6 +9,10 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -12,6 +12,10 @@ msgstr ""
"X-Poedit-Country: INDONESIA\n"
"X-Poedit-SourceCharset: iso-8859-1\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -11,6 +11,10 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Virtaal 0.5.1\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -11,6 +11,10 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Language: lt\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr "ASP"

View File

@ -9,6 +9,10 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -13,6 +13,10 @@ msgstr ""
"X-Poedit-Language: Polish\n"
"X-Poedit-Country: POLAND\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -1,6 +1,10 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -9,6 +9,10 @@ msgstr ""
"Last-Translator: Marcelo B Paula\n"
"Language-Team: \n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr "Asp"

View File

@ -9,6 +9,10 @@ msgstr ""
"Language-Team: \n"
"MIME-Version: 1.0\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr "ASP"

View File

@ -12,6 +12,10 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Virtaal 0.7.1\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr "Asp"

View File

@ -12,6 +12,10 @@ msgstr ""
"X-Poedit-Country: china\n"
"X-Poedit-SourceCharset: utf-8\n"
#: syneditstrconst.syns_attrannotation
msgid "Annotation"
msgstr ""
#: syneditstrconst.syns_attrasp
msgid "Asp"
msgstr ""

View File

@ -56,6 +56,7 @@ resourcestring
SYNS_AttrASP = 'Asp';
SYNS_AttrCDATA = 'CDATA';
SYNS_AttrDOCTYPE = 'DOCTYPE';
SYNS_AttrAnnotation = 'Annotation';
SYNS_AttrAssembler = 'Assembler';
SYNS_AttrAttributeName = 'Attribute Name';
SYNS_AttrAttributeValue = 'Attribute Value';
@ -170,6 +171,7 @@ const
SYNS_XML_AttrASP = 'Asp';
SYNS_XML_AttrCDATA = 'CDATA';
SYNS_XML_AttrDOCTYPE = 'DOCTYPE';
SYNS_XML_AttrAnnotation = 'Annotation';
SYNS_XML_AttrAssembler = 'Assembler';
SYNS_XML_AttrAttributeName = 'Attribute Name';
SYNS_XML_AttrAttributeValue = 'Attribute Value';

View File

@ -54,7 +54,7 @@ uses
type
TtkTokenKind = (tkComment, tkDocument, tkIdentifier, tkInvalid, tkKey,
tkNull, tkNumber, tkSpace, tkString, tkSymbol, tkUnknown);
tkNull, tkNumber, tkSpace, tkString, tkSymbol, tkUnknown, tkAnnotation);
TxtkTokenKind = (
xtkAdd, xtkAddAssign, xtkAnd, xtkAndAssign, xtkAssign, xtkBitComplement,
@ -99,6 +99,7 @@ type
fSpaceAttri: TSynHighlighterAttributes;
fStringAttri: TSynHighlighterAttributes;
fSymbolAttri: TSynHighlighterAttributes;
fAnnotationAttri: TSynHighlighterAttributes;
function KeyHash(ToHash: PChar): Integer;
function KeyComp(const aKey: String): Boolean;
function Func17: TtkTokenKind;
@ -149,7 +150,7 @@ type
procedure CommentProc;
procedure AndSymbolProc;
procedure AsciiCharProc;
procedure AtSymbolProc;
procedure AnnotationProc;
procedure BraceCloseProc;
procedure BraceOpenProc;
procedure CRProc;
@ -211,6 +212,8 @@ type
procedure ResetRange; override;
property ExtTokenID: TxtkTokenKind read GetExtTokenID;
published
property AnnotationAttri: TSynHighlighterAttributes read fAnnotationAttri
write fAnnotationAttri;
property CommentAttri: TSynHighlighterAttributes read fCommentAttri
write fCommentAttri;
property DocumentAttri: TSynHighlighterAttributes read fDocumentAttri
@ -605,7 +608,7 @@ begin
case I of
'&': fProcTable[I] := @AndSymbolProc;
#39: fProcTable[I] := @AsciiCharProc;
'@': fProcTable[I] := @AtSymbolProc;
'@': fProcTable[I] := @AnnotationProc;
'}': fProcTable[I] := @BraceCloseProc;
'{': fProcTable[I] := @BraceOpenProc;
#13: fProcTable[I] := @CRProc;
@ -650,6 +653,8 @@ end;
constructor TSynJavaSyn.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
fAnnotationAttri := TSynHighlighterAttributes.Create(@SYNS_AttrAnnotation, SYNS_XML_AttrAnnotation);
AddAttribute(fAnnotationAttri);
fCommentAttri := TSynHighlighterAttributes.Create(@SYNS_AttrComment, SYNS_XML_AttrComment);
fCommentAttri.Style := [fsItalic];
AddAttribute(fCommentAttri);
@ -768,10 +773,11 @@ begin
if FLine[Run] <> #0 then inc(Run);
end;
procedure TSynJavaSyn.AtSymbolProc;
procedure TSynJavaSyn.AnnotationProc;
begin
fTokenID := tkInvalid;
inc(Run);
fTokenID := tkAnnotation;
while Identifiers[fLine[Run]] do inc(Run);
end;
procedure TSynJavaSyn.BraceCloseProc;
@ -1252,6 +1258,7 @@ end;
procedure TSynJavaSyn.Next;
begin
fTokenPos := Run;
FExtTokenID := xtkNonSymbol;
Case fRange of
rsComment: CommentProc;
rsDocument: CommentProc;
@ -1327,6 +1334,7 @@ end;
function TSynJavaSyn.GetTokenAttribute: TSynHighlighterAttributes;
begin
case fTokenID of
tkAnnotation: Result := fAnnotationAttri;
tkComment: Result := fCommentAttri;
tkDocument: Result := fDocumentAttri;
tkIdentifier: Result := fIdentifierAttri;