dgrok
dgrok copied to clipboard
Nested Types cause parse failures
The examples that come with the Object Pascal Handbook yield the following parse error
Failing (1)
Expected EqualSign but found ProcedureKeyword (1)
.\NestedClass.pas:263
The Offending file is here on github? https://github.com/MarcoDelphiBooks/ObjectPascalHandbook/tree/master/07/NestedTypes
Stripping down the code to this:
unit NestedClass;
interface
type
TOne = class
public
type TInside = class
type TInsideInside = class
end;
public
procedure InsideHello;
end;
end;
end.
--- We still get the error
Failing (1)
Expected EqualSign but found ProcedureKeyword (1)
.\NestedClass.pas:145
Will need to study this some more
See: http://docwiki.embarcadero.com/RADStudio/Rio/en/Nested_Type_Declarations
I manually applied the pull request https://github.com/joewhite/dgrok/pull/2 Fix the wrong look-ahead for the TypeDecl rule #2 and it fixes the above issue ( Thanks tomalla5120x ! )