Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **API:** `RaiseStatementNode::getRaiseLocation` method.
- **API:** `VariableNameDeclaration::isExceptItem` method.

### Fixed

- Parsing errors on attributes preceding visibility sections.
- Parsing errors on attributes preceding `var` sections in type bodies.

## [1.21.0] - 2026-09-04

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ visibilitySectionItem : fieldSection
| property
| constSection
| innerTypeSection
| attributeList
;
fieldSectionKey : VAR
| THREADVAR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ void testAttributesUnit() {
assertParsed("AttributesUnit.pas");
}

@Test
void testAttributesOnVisibilitySections() {
assertParsed("AttributesOnVisibilitySections.pas");
}

@Test
void testAttributesProgram() {
assertParsed("AttributesProgram.dpr");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
unit AttributesOnVisibilitySections;

interface

type
TFoo = class(TObject)
[xyz]
private FBar: String;

[xyz]
private var FBaz: String;

[xyz]
[assembly: xyz]
private
[xyz]
var
[xyz]
FFlarp: String;
FFlimflam: String;
end;

TBar = class(TObject)
[xyz]
private
[xyz]
var
[xyz]

public
var
FBar: String;
end;

implementation

end.
Loading