Skip to content

Commit 9528e14

Browse files
Update align keyword support implementation
1 parent 9f2f681 commit 9528e14

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Source/SimpleParser/SimpleParser.Lexer.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ function TmwBasePasLex.Func43: TptTokenKind;
758758
Result := ptIdentifier;
759759
if KeyComp('Int64') then FExID := ptInt64
760760
else if KeyComp('local') then FExID := ptLocal
761-
else if KeyComp('align') then Result := ptAlign;
761+
else if KeyComp('align') then FExID := ptAlign;
762762
end;
763763

764764
function TmwBasePasLex.Func44: TptTokenKind;

Source/SimpleParser/SimpleParser.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4316,9 +4316,9 @@ procedure TmwSimplePasPar.SimpleType;
43164316

43174317
procedure TmwSimplePasPar.RecordAlign;
43184318
begin
4319-
if TokenID = ptAlign then
4319+
if ExID = ptAlign then
43204320
begin
4321-
Expected(ptAlign);
4321+
NextToken;
43224322
RecordAlignValue;
43234323
end;
43244324
end;

Test/Snippets/alignedrecords.pas

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
unit managedrecords;
1+
unit alignedrecords;
22

33
interface
44

55
type
66
TMyRecord = record
77
Value: Integer;
8+
Align: string;
89
class operator Initialize (out Dest: TMyRecord);
910
class operator Finalize(var Dest: TMyRecord);
1011
end align 8;
@@ -22,4 +23,4 @@ implementation
2223
Log('destroyed' + IntToHex (Integer(Pointer(@Dest))));
2324
end;
2425

25-
end.
26+
end.

0 commit comments

Comments
 (0)