OpenRewrite language module for Pascal
Recursive descent parser with lossless round-trip fidelity for pure Pascal syntax (ISO 7185 / Turbo Pascal). Includes LST node definitions, visitor, printer, remote serialization support, and a standalone LST generator for Moderne CLI integration. 65 parser tests covering programs, units, control flow, expressions, types, and more.
This commit is contained in:
commit
8915c205cd
37 files changed
+12795
No files matched your search
@@ -0,0 +1,8 @@
|
||||
program Hello;
|
||||
|
||||
uses SysUtils;
|
||||
|
||||
begin
|
||||
WriteLn('Hello, World!');
|
||||
WriteLn('The date is: ', DateToStr(Now));
|
||||
end.
|
||||
@@ -0,0 +1,29 @@
|
||||
unit MyUnit;
|
||||
|
||||
interface
|
||||
|
||||
uses SysUtils;
|
||||
|
||||
type
|
||||
TPoint = record
|
||||
X: Integer;
|
||||
Y: Integer;
|
||||
end;
|
||||
|
||||
procedure PrintPoint(P: TPoint);
|
||||
function AddPoints(A, B: TPoint): TPoint;
|
||||
|
||||
implementation
|
||||
|
||||
procedure PrintPoint(P: TPoint);
|
||||
begin
|
||||
WriteLn('(', P.X, ', ', P.Y, ')');
|
||||
end;
|
||||
|
||||
function AddPoints(A, B: TPoint): TPoint;
|
||||
begin
|
||||
Result.X := A.X + B.X;
|
||||
Result.Y := A.Y + B.Y;
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in new issue
Block a user