integrated-application-development / integrated-application-development/sonar-delphi

Attributes on visibility sections cause parsing failures

Open
#461 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
159
Forks
31
Avg merge
5d 4h
Merged PRs (30d)
4

Description

### Prerequisites

- [x] This bug is in SonarDelphi, not SonarQube or my Delphi code.
- [x] This bug has not already been reported.

### SonarDelphi version

1.20

### Delphi version

13

### SonarQube version

_No response_

### Issue description

The parsers only supports the attribute before the field name like this:
` private [MyAttribute] FMyField: String;

private var [MyAttribute] FMyField: String;`

but RAD supports those too:

` [MyAttribute]
private FMyField: String;

[MyAttribute]
private var FMyField: String;`

### Steps to reproduce

Create a class with attribute before visibility

` [MyAttribute]
private FMyField: String;

[MyAttribute]
private var FMyField: String;`

sonar-delphi is unable to parse the class.

### Minimal Delphi code exhibiting the issue

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the parser failure with the two Delphi examples where an attribute precedes a visibility section, then compare them with the currently supported attribute placement. No source file or test entry point is named in the issue, so locate the relevant class-member parsing code and existing parser tests. Done means both attribute-before-visibility forms parse successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.