From 046df2da25a76b20f2d6adbc0fa065c484d1b74b Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 30 Sep 2011 01:33:04 +0000 Subject: [PATCH] codetools: support 'section' variable/constant modifier git-svn-id: trunk@32561 - --- components/codetools/pascalparsertool.pas | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 0af99c4884..9e0cac44ea 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -3088,7 +3088,7 @@ procedure TPascalParserTool.ReadVariableType; interface var a:b; a:b; cvar; - a:b; public name 'string constant'; + a:b; public name 'string constant' section 'string constant'; a:b; public name ; a:b; external name 'string constant'; a:b; cvar; external; @@ -3162,6 +3162,14 @@ begin and (not AtomIsIdentifier(false)) then RaiseStringExpectedButAtomFound(ctsStringConstant); ReadConstant(true,false,[]); + if UpAtomIs('SECTION') then begin + // for example FreePascal_TLS_callback : pointer = @Exec_Tls_callback; public name '__FPC_tls_callbacks' section '.CRT$XLFPC' + ReadNextAtom; + if (not AtomIsStringConstant) + and (not AtomIsIdentifier(false)) then + RaiseStringExpectedButAtomFound(ctsStringConstant); + ReadConstant(true,false,[]); + end; end; if CurPos.Flag<>cafSemicolon then RaiseCharExpectedButAtomFound(';'); @@ -3612,6 +3620,12 @@ begin if not AtomIsStringConstant then RaiseStringExpectedButAtomFound(ctsStringConstant); ReadNextAtom; + if UpAtomIs('SECTION') then begin + ReadNextAtom; + if not AtomIsStringConstant then + RaiseStringExpectedButAtomFound(ctsStringConstant); + ReadNextAtom; + end; end; if CurPos.Flag<>cafSemicolon then RaiseStringExpectedButAtomFound(';');