diff --git a/components/codetools/codetoolsstrconsts.pas b/components/codetools/codetoolsstrconsts.pas index 84ea3c7d24..a11ac91a2d 100644 --- a/components/codetools/codetoolsstrconsts.pas +++ b/components/codetools/codetoolsstrconsts.pas @@ -101,6 +101,10 @@ ResourceString ctsPointHintProcStartAt = '. Hint: proc start at '; ctsMissingPointAfterEnd = 'missing . after end'; ctsEndForClassNotFound = '"end" for class/object not found'; + ctsVarIsOnlyAllowedInGenericsEndOfClassNotFound = 'var is only allowed in ' + +'generics, end of class not found'; + ctsTypeIsOnlyAllowedInGenericsEndOfClassNotFound = 'type is only allowed in ' + +'generics, end of class not found'; ctsUnexpectedSubRangeOperatorFound = 'unexpected subrange operator ''..'' found'; ctsInvalidSubrange = 'invalid subrange'; ctsExportsClauseOnlyAllowedInLibraries = 'exports clause only allowed in libraries'; diff --git a/components/codetools/languages/codetoolsstrconsts.ca.po b/components/codetools/languages/codetoolsstrconsts.ca.po index 9a54f2e05c..3909ddccf7 100644 --- a/components/codetools/languages/codetoolsstrconsts.ca.po +++ b/components/codetools/languages/codetoolsstrconsts.ca.po @@ -735,6 +735,10 @@ msgstr "" msgid "type identifier" msgstr "identificador del tipus" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "no s'ha trobat la secció del tipus de la classe" @@ -811,6 +815,10 @@ msgstr "la unitat utilitzada no és una unitat Pascal" msgid "Utils directories" msgstr "Directoris de les utilitats" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Directori dels ginys" diff --git a/components/codetools/languages/codetoolsstrconsts.de.po b/components/codetools/languages/codetoolsstrconsts.de.po index bd501c1cb7..996827e049 100644 --- a/components/codetools/languages/codetoolsstrconsts.de.po +++ b/components/codetools/languages/codetoolsstrconsts.de.po @@ -738,6 +738,10 @@ msgstr "" msgid "type identifier" msgstr "Typbezeichner" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "Typabschnitt der Klasse nicht gefunden" @@ -814,6 +818,10 @@ msgstr "die verwendete Unit ist keine Pascal-Unit" msgid "Utils directories" msgstr "Utils-Verzeichnis" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Widget-Verzeichnis" diff --git a/components/codetools/languages/codetoolsstrconsts.es.po b/components/codetools/languages/codetoolsstrconsts.es.po index 018907d26b..1839095ef3 100644 --- a/components/codetools/languages/codetoolsstrconsts.es.po +++ b/components/codetools/languages/codetoolsstrconsts.es.po @@ -735,6 +735,10 @@ msgstr "" msgid "type identifier" msgstr "identificador de tipo" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "sección type de clase no encontrada" @@ -811,6 +815,10 @@ msgstr "la unidad usada no es una unidad Pascal" msgid "Utils directories" msgstr "Directorios de utilidades" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Directorio de Widget" diff --git a/components/codetools/languages/codetoolsstrconsts.esutf.po b/components/codetools/languages/codetoolsstrconsts.esutf.po index 2d416ed1c5..fc056159b3 100644 --- a/components/codetools/languages/codetoolsstrconsts.esutf.po +++ b/components/codetools/languages/codetoolsstrconsts.esutf.po @@ -734,6 +734,10 @@ msgstr "" msgid "type identifier" msgstr "tipo de identificador" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "sección type de class no encontrado" @@ -810,6 +814,10 @@ msgstr "unidad usada no es una unidad Pascal" msgid "Utils directories" msgstr "Directorios de utilidades" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Directorio de Widget" diff --git a/components/codetools/languages/codetoolsstrconsts.fi.po b/components/codetools/languages/codetoolsstrconsts.fi.po index 4cf7f32211..7848a40a4c 100644 --- a/components/codetools/languages/codetoolsstrconsts.fi.po +++ b/components/codetools/languages/codetoolsstrconsts.fi.po @@ -730,6 +730,10 @@ msgstr "" msgid "type identifier" msgstr "" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "" @@ -806,6 +810,10 @@ msgstr "" msgid "Utils directories" msgstr "" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "" diff --git a/components/codetools/languages/codetoolsstrconsts.fr.po b/components/codetools/languages/codetoolsstrconsts.fr.po index 5a968625cf..8450fb4df4 100644 --- a/components/codetools/languages/codetoolsstrconsts.fr.po +++ b/components/codetools/languages/codetoolsstrconsts.fr.po @@ -736,6 +736,10 @@ msgstr "" msgid "type identifier" msgstr "type d'identificateur" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "type de section de la classe non trouvé" @@ -812,6 +816,10 @@ msgstr "l'unité utilisée n'est pas une unité Pascal" msgid "Utils directories" msgstr "Répertoires des utilitaires" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Répertoire des éléments graphiques (Widgets)" diff --git a/components/codetools/languages/codetoolsstrconsts.id.po b/components/codetools/languages/codetoolsstrconsts.id.po index cf7e49c58c..8094a31485 100644 --- a/components/codetools/languages/codetoolsstrconsts.id.po +++ b/components/codetools/languages/codetoolsstrconsts.id.po @@ -736,6 +736,10 @@ msgstr "" msgid "type identifier" msgstr "pengenal type" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "bagian type dari class tidak ditemukan" @@ -812,6 +816,10 @@ msgstr "unit yang digunakan bukan unit pascal" msgid "Utils directories" msgstr "Direktori Utils" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Direktori Widget" diff --git a/components/codetools/languages/codetoolsstrconsts.it.po b/components/codetools/languages/codetoolsstrconsts.it.po index 0ff369e790..1848200895 100644 --- a/components/codetools/languages/codetoolsstrconsts.it.po +++ b/components/codetools/languages/codetoolsstrconsts.it.po @@ -734,6 +734,10 @@ msgstr "" msgid "type identifier" msgstr "identificatore di tipo" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "tipo si selezione di classe non trovata" @@ -810,6 +814,10 @@ msgstr "la unit utilizzata non è una unit pascal" msgid "Utils directories" msgstr "Directory delle utility" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Directory widget" diff --git a/components/codetools/languages/codetoolsstrconsts.lt.po b/components/codetools/languages/codetoolsstrconsts.lt.po index 4149a3532b..3b9747a2d6 100644 --- a/components/codetools/languages/codetoolsstrconsts.lt.po +++ b/components/codetools/languages/codetoolsstrconsts.lt.po @@ -738,6 +738,10 @@ msgstr "" msgid "type identifier" msgstr "tipo identifikatorius" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "klasėje nerasta tipo sekcija" @@ -814,6 +818,10 @@ msgstr "naudojamas modulis n4ra paskalio modulis" msgid "Utils directories" msgstr "Paslaugų programų aplankai" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Valdiklių aplankas" diff --git a/components/codetools/languages/codetoolsstrconsts.nl.po b/components/codetools/languages/codetoolsstrconsts.nl.po index cdb73c188f..6a1d20f0c1 100644 --- a/components/codetools/languages/codetoolsstrconsts.nl.po +++ b/components/codetools/languages/codetoolsstrconsts.nl.po @@ -735,6 +735,10 @@ msgstr "" msgid "type identifier" msgstr "" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "type sectie van klasse niet gevonden" @@ -811,6 +815,10 @@ msgstr "gebruikte unit is geen pascal unit" msgid "Utils directories" msgstr "" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "" diff --git a/components/codetools/languages/codetoolsstrconsts.pb.po b/components/codetools/languages/codetoolsstrconsts.pb.po index 9aeaa73a8f..19efb5ed14 100644 --- a/components/codetools/languages/codetoolsstrconsts.pb.po +++ b/components/codetools/languages/codetoolsstrconsts.pb.po @@ -735,6 +735,10 @@ msgstr "tipo" msgid "type identifier" msgstr "tipo identificador" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "seção de tipo da classe não encontrada" @@ -811,6 +815,10 @@ msgstr "unidade usada não é unidade Pascal" msgid "Utils directories" msgstr "Diretório de Utilitários" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Diretório \"Widget\"" diff --git a/components/codetools/languages/codetoolsstrconsts.pl.po b/components/codetools/languages/codetoolsstrconsts.pl.po index ecbb174099..c6052add7d 100644 --- a/components/codetools/languages/codetoolsstrconsts.pl.po +++ b/components/codetools/languages/codetoolsstrconsts.pl.po @@ -739,6 +739,10 @@ msgstr "" msgid "type identifier" msgstr "identyfikator typu" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "brakuje sekcji typu klasy " @@ -815,6 +819,10 @@ msgstr "użyty moduł nie jest modułem pascalowym" msgid "Utils directories" msgstr "Katalogi narzedzi" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Katalog widgetów" diff --git a/components/codetools/languages/codetoolsstrconsts.po b/components/codetools/languages/codetoolsstrconsts.po index 38a196c230..e11a15cdcd 100644 --- a/components/codetools/languages/codetoolsstrconsts.po +++ b/components/codetools/languages/codetoolsstrconsts.po @@ -730,6 +730,10 @@ msgstr "" msgid "type identifier" msgstr "" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "" @@ -806,6 +810,10 @@ msgstr "" msgid "Utils directories" msgstr "" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "" diff --git a/components/codetools/languages/codetoolsstrconsts.ru.po b/components/codetools/languages/codetoolsstrconsts.ru.po index e8c6c8a47d..52e4e39bbd 100644 --- a/components/codetools/languages/codetoolsstrconsts.ru.po +++ b/components/codetools/languages/codetoolsstrconsts.ru.po @@ -735,6 +735,10 @@ msgstr "тип" msgid "type identifier" msgstr "идентификатор типа" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "секция type класса не найдена" @@ -811,6 +815,10 @@ msgstr "используемый модуль не является модуле msgid "Utils directories" msgstr "Каталоги утилит" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Каталог виджетов" diff --git a/components/codetools/languages/codetoolsstrconsts.sk.po b/components/codetools/languages/codetoolsstrconsts.sk.po index 177267fc6d..972b7fe9c5 100644 --- a/components/codetools/languages/codetoolsstrconsts.sk.po +++ b/components/codetools/languages/codetoolsstrconsts.sk.po @@ -736,6 +736,10 @@ msgstr "" msgid "type identifier" msgstr "" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "" @@ -812,6 +816,10 @@ msgstr "" msgid "Utils directories" msgstr "" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "" diff --git a/components/codetools/languages/codetoolsstrconsts.ua.po b/components/codetools/languages/codetoolsstrconsts.ua.po index 3905055747..a84b3fb555 100644 --- a/components/codetools/languages/codetoolsstrconsts.ua.po +++ b/components/codetools/languages/codetoolsstrconsts.ua.po @@ -730,6 +730,10 @@ msgstr "" msgid "type identifier" msgstr "ідентифікатор типу" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "не знайдена секція типу класу" @@ -806,6 +810,10 @@ msgstr "цей модуль не є паскалівським" msgid "Utils directories" msgstr "Теки інструментів" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "Тека елементів інтерфейсу" diff --git a/components/codetools/languages/codetoolsstrconsts.zh_CN.po b/components/codetools/languages/codetoolsstrconsts.zh_CN.po index 56c3e5c1d8..5aef1071a3 100644 --- a/components/codetools/languages/codetoolsstrconsts.zh_CN.po +++ b/components/codetools/languages/codetoolsstrconsts.zh_CN.po @@ -738,6 +738,10 @@ msgstr "" msgid "type identifier" msgstr "类型标识符" +#: codetoolsstrconsts.ctstypeisonlyallowedingenericsendofclassnotfound +msgid "type is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctstypesectionofclassnotfound msgid "type section of class not found" msgstr "未找到类的类型块" @@ -814,6 +818,10 @@ msgstr "use的单元不是一个pascal单元" msgid "Utils directories" msgstr "单元目录" +#: codetoolsstrconsts.ctsvarisonlyallowedingenericsendofclassnotfound +msgid "var is only allowed in generics, end of class not found" +msgstr "" + #: codetoolsstrconsts.ctswidgetdirectory msgid "Widget Directory" msgstr "窗口部件目录" diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 70a32bf2fa..f24ffbf3b6 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -1068,6 +1068,7 @@ begin EndChildNode; // start new section CreateChildNode; + if UpAtomIs('CLASS') then ReadNextAtom; ReadNextAtom; if UpAtomIs('PUBLIC') then CurNode.Desc:=ctnClassTypePublic @@ -1094,6 +1095,13 @@ begin end; function TPascalParserTool.KeyWordFuncClassVarSection: boolean; +{ + var private + var protected + var public + var published + class var private +} begin // end last section CurNode.EndPos:=CurPos.StartPos; @@ -1101,6 +1109,7 @@ begin // start new section CreateChildNode; CurNode.Desc:=ctnClassVarPublic; + if UpAtomIs('CLASS') then ReadNextAtom; ReadNextAtom; if UpAtomIs('PUBLIC') then CurNode.Desc:=ctnClassVarPublic @@ -1119,9 +1128,9 @@ function TPascalParserTool.KeyWordFuncClassClass: boolean; { parse class procedure class property + class var + class type } -var - p: PChar; begin ReadNextAtom; if UpAtomIs('PROCEDURE') or UpAtomIs('FUNCTION') then begin @@ -1130,6 +1139,9 @@ begin end else if UpAtomIs('PROPERTY') then begin UndoReadNextAtom; Result:=KeyWordFuncClassProperty; + end else if UpAtomIs('VAR') then begin + UndoReadNextAtom; + Result:=KeyWordFuncClassVarSection; end else RaiseStringExpectedButAtomFound('procedure'); end; @@ -3489,12 +3501,14 @@ begin 'T': if CompareSrcIdentifiers(p,'TYPE') and (not CurNode.HasParentOfType(ctnGenericType)) then - SaveRaiseException(ctsEndForClassNotFound); + SaveRaiseException( + ctsTypeIsOnlyAllowedInGenericsEndOfClassNotFound); 'V': if CompareSrcIdentifiers(p,'VAR') and (BracketLvl=0) and (not CurNode.HasParentOfType(ctnGenericType)) then - SaveRaiseException(ctsEndForClassNotFound); + SaveRaiseException(ctsVarIsOnlyAllowedInGenericsEndOfClassNotFound + ); end; end; end;