From 02c06730c74eb01f036023e2527fb42c56571ad7 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 12 Mar 2008 14:38:20 +0000 Subject: [PATCH] codetools: implemented parsing c const git-svn-id: trunk@14502 - --- components/codetools/ccodeparsertool.pas | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/components/codetools/ccodeparsertool.pas b/components/codetools/ccodeparsertool.pas index 32f2ecd4a9..4bf2eae21f 100644 --- a/components/codetools/ccodeparsertool.pas +++ b/components/codetools/ccodeparsertool.pas @@ -570,7 +570,7 @@ var NeedEnd: Boolean; LastIsName: Boolean; begin - DebugLn(['TCCodeParserTool.ReadVariable ']); + DebugLn(['TCCodeParserTool.ReadVariable START ',GetAtom]); CreateChildNode(ccnVariable); IsFunction:=false; if AtomIs('struct') then begin @@ -591,6 +591,9 @@ begin RaiseExpectedButAtomFound('identifier'); end; end; + + if AtomIs('const') then ReadNextAtom; + CreateChildNode(ccnVariableName); // prefixes: signed, unsigned @@ -627,8 +630,8 @@ begin // example: int (*fp)(char*); // pointer to function taking a char* argument; returns an int ReadNextAtom; - while AtomIsChar('*') do begin - // pointer + while AtomIsChar('*') or AtomIs('const') do begin + // pointer or const ReadNextAtom; end; DebugLn(['TCCodeParserTool.ReadVariable name=',GetAtom]); @@ -638,8 +641,8 @@ begin if not AtomIsChar(')') then RaiseExpectedButAtomFound(')'); end else begin - while AtomIsChar('*') do begin - // pointer + while AtomIsChar('*') or AtomIs('const') do begin + // pointer or const ReadNextAtom; end;