pp4d - PreProcessor for Delphi
[id:lethevert:20050915:p4]
「インデントによるブロック」と「セミコロンの省略」を実装してみました。
(こちらにアップしました。 -> http://www.geocities.jp/lethevert/softwares/pp4d/index.html)
こんなソースを用意すると
unit Sample interface uses SysUtils procedure Sample: string implementation procedure Sample: string var str: String begin str := "sample" for i := 0 to 10 do str := str + IntToStr(i) if i > 5 then str := str + #13#10 else str := str + '###' + #13#10 Result := str end end.
こんな風に変換されます。
unit Sample; interface uses SysUtils; procedure Sample: string; implementation procedure Sample: string; var str: String; begin str := "sample"; for i := 0 to 10 do begin str := str + IntToStr(i); if i > 5 then begin str := str + #13#10; end else begin str := str + '###' + #13#10; end; end; Result := str; end; end.