jcf: sync with r723 (fix error found in graphics.pp - "absolute" with a dotted name was not handled, fixes for lazarus source, and tests on it)

git-svn-id: trunk@17828 -
This commit is contained in:
paul 2008-12-13 17:04:34 +00:00
parent ae23e74714
commit 7409df351c
4 changed files with 17 additions and 6 deletions

View File

@ -700,7 +700,7 @@ begin
end;
{ elements ina dotted name are usually just identifiers
{ elements in a dotted name are usually just identifiers
but occasionally are reserved words - e.g. "object" and "type"
as in "var MyType: System.Type; " or "var pElement: System.Object; "
}
@ -2269,7 +2269,17 @@ begin
Recognise(ttAbsolute);
if (fcTokenList.FirstSolidWordType in IdentifierTypes) then
RecogniseIdentifier(False, idAllowDirectives)
begin
// can be a dotted name
RecogniseIdentifier(True, idAllowDirectives);
while fcTokenList.FirstSolidTokenType = ttDot do
begin
Recognise(ttDot);
RecogniseIdentifier(false, idAllowDirectives);
end;
end
else
RecogniseConstantExpression;

View File

@ -55,7 +55,7 @@ type
function CurrentChars(const piCount: integer): WideString;
function ForwardChar(const piOffset: integer): WideChar;
function ForwardChars(const piOffset, piCount: integer): WideString;
function Consume(const piCount: integer = 1): WideString;
procedure Consume(const piCount: integer = 1);
function EndOfFile: boolean;
function EndOfFileAfter(const piChars: integer): boolean;
@ -779,7 +779,7 @@ begin
end;
function TBuildTokenList.Consume(const piCount: integer): WideString;
procedure TBuildTokenList.Consume(const piCount: integer);
begin
inc(fiCurrentIndex, piCount);
end;

View File

@ -76,7 +76,7 @@ const
const
SOURCE_FILE_FILTERS =
'Delphi source (*.pas, *.dpr, *.dpk)|*.pas; *.dpr; *.dpk|' +
'Lazarus source (*.pas, *.pp, *.lpr, *.lpk)|*.pas, *.pp, *.lpr, *.lpk|' +
'Lazarus source (*.pas, *.pp, *.lpr, *.lpk)|*.pas; *.pp; *.lpr; *.lpk|' +
'Pascal Source (*.pas, *.pp)|*.pas; *.pp|' +
'Text files (*.txt)|*.txt|' +
'All files (*.*)|*.*';

View File

@ -141,7 +141,8 @@ function WideCharIsHexDigitDot(const wc: WideChar): Boolean;
const
HexDigits: set of AnsiChar = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'];
'A', 'B', 'C', 'D', 'E', 'F',
'a', 'b', 'c', 'd', 'e', 'f'];
var
ch: AnsiChar;
begin