Skip to content

Commit 0d1f3e1

Browse files
cirrasfourls
authored andcommitted
Allow Label keyword as an identifier
This apparently used to be allowed in Delphi.NET.
1 parent 5f4ed7e commit 0d1f3e1

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3232
- File pointer errors when an issue is raised on the first line of a file with a byte order mark.
3333
- Symbol table construction errors for program files omitting the `program` header.
3434
- Parsing errors on parenthesised anonymous methods.
35+
- Parsing errors on identifiers named `Label`, which was allowed in Delphi.NET.
3536
- Scan failures on invalid paths in dproj files.
3637
- Incorrect ordering of edits in the "Separate grouped parameters" quick fix for `GroupedParameterDeclaration`.
3738
- SonarLint registration of rules that don't support execution in a SonarLint context.

delphi-frontend/src/main/antlr3/au/com/integradev/delphi/antlr/Delphi.g

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ keywordsUsedAsNames : (ABSOLUTE | ABSTRACT | ALIGN | ASSEMBLER | ASSEMB
982982
| (PRIVATE | PROTECTED | PUBLIC | PUBLISHED | READ | READONLY | REFERENCE | REGISTER | REINTRODUCE)
983983
| (REQUIRES | RESIDENT | SAFECALL | SEALED | STATIC | STDCALL | STORED | STRICT | UNSAFE)
984984
| (VARARGS | VIRTUAL | WINAPI | WRITE | WRITEONLY)
985+
| (LABEL) // Used to be allowed in Delphi.NET.
985986
;
986987
keywords : (ABSOLUTE | ABSTRACT | AND | ALIGN | ARRAY | AS | ASM | ASSEMBLER | ASSEMBLY)
987988
| (AT | AUTOMATED | BEGIN | CASE | CDECL | CLASS | CONST | CONSTRUCTOR | CONTAINS| DEFAULT)

delphi-frontend/src/test/resources/au/com/integradev/delphi/grammar/KeyWordsAsIdentifier.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ implementation
3131
HELPER: Boolean;
3232
IMPLEMENTS: Boolean;
3333
INDEX: Boolean;
34+
LABEL: Boolean; // Allowed in Delphi.NET
3435
LOCAL: Boolean;
3536
MESSAGE: Boolean;
3637
NAME: Boolean;

0 commit comments

Comments
 (0)