Skip to content

Nested Types cause parse failures #8

@d-c-d

Description

@d-c-d

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 #2
Fix the wrong look-ahead for the TypeDecl rule #2
and it fixes the above issue ( Thanks tomalla5120x ! )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions