From bfe27912a818dc7b1bd59f4d77504faf4b5c6e9c Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 12 Sep 2010 16:40:44 +0000 Subject: [PATCH] codetools: fixed parsing constant with round brackets git-svn-id: trunk@27336 - --- components/codetools/pascalparsertool.pas | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index a6283f86f8..76dbafe290 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -1854,12 +1854,12 @@ begin if (BracketType=cafRoundBracketOpen) and (CurPos.Flag<>cafRoundBracketClose) then if ExceptionOnError then - RaiseCharExpectedButAtomFound('(') + RaiseCharExpectedButAtomFound(')') else exit; if (BracketType=cafEdgedBracketOpen) and (CurPos.Flag<>cafEdgedBracketClose) then if ExceptionOnError then - RaiseCharExpectedButAtomFound('[') + RaiseCharExpectedButAtomFound(']') else exit; if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr); end; @@ -1871,9 +1871,10 @@ begin // open bracket + ? + close bracket if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr); if not ReadConstant(ExceptionOnError,Extract,Attr) then exit; - if ExceptionOnError then - RaiseCharExpectedButAtomFound(')') - else exit; + if (CurPos.Flag<>cafRoundBracketClose) then + if ExceptionOnError then + RaiseCharExpectedButAtomFound(')') + else exit; if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr); end else if CurPos.Flag=cafEdgedBracketOpen then begin // open bracket + ? + close bracket