From 4e6ffac026e77a97c30517fa4114047b620079d7 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 3 Mar 2008 17:05:16 +0000 Subject: [PATCH] codetools: implemented parsing struct name git-svn-id: trunk@14387 - --- components/codetools/ccodeparsertool.pas | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/components/codetools/ccodeparsertool.pas b/components/codetools/ccodeparsertool.pas index ae9c58a4fd..32f2ecd4a9 100644 --- a/components/codetools/ccodeparsertool.pas +++ b/components/codetools/ccodeparsertool.pas @@ -375,7 +375,7 @@ begin CreateChildNode(ccnStruct); ReadNextAtom; - if CurNode.Parent.Desc=ccnVariable then begin + if CurNode.Parent.Desc<>ccnTypedef then begin // read variable name if not AtomIsIdentifier then RaiseExpectedButAtomFound('identifier'); @@ -431,11 +431,17 @@ begin ReadNextAtom; if AtomIs('typedef') then RaiseExpectedButAtomFound('declaration') - else if AtomIs('struct') then - ReadStruct - else if AtomIs('enum') then - ReadEnum - else if SrcPos>SrcLen then + else if AtomIs('struct') then begin + ReadStruct; + ReadNextAtom; + if not AtomIsIdentifier then + RaiseExpectedButAtomFound('identifier'); + end else if AtomIs('enum') then begin + ReadEnum; + ReadNextAtom; + if not AtomIsIdentifier then + RaiseExpectedButAtomFound('identifier'); + end else if SrcPos>SrcLen then RaiseException('missing declaration') else ReadVariable;