From 0a9bf9cd7b3fbc2b99ae7a4eaf78310bc7286ab5 Mon Sep 17 00:00:00 2001 From: Eric Fredricksen Date: Wed, 23 Jun 2010 16:54:42 -0700 Subject: [PATCH] A few improvements to conversions, I hope --- pas2js.sed | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pas2js.sed b/pas2js.sed index f4d793a..12e812a 100755 --- a/pas2js.sed +++ b/pas2js.sed @@ -7,12 +7,12 @@ s,},*/,g s/ = / == /g s/:=/=/g s/procedure/function/g -s/begin/{/g +s/begin/{/ s/end;/}/g s/end/}/g s/not/!/g -s/ and / && /g +s/ and / \&\& /g s/ or / || /g s/<>/!=/g s/ mod / % /g @@ -26,6 +26,13 @@ s/with /with (/g s/ do/)/ s/case /switch (/g -s/ of/) {/g +/\Wcase\W/ s/ of/) {/g s/Result =/return/g + +/^function / s/): [A-Za-z][A-Za-z]*;/)/ +/^function / s/: [A-Za-z][A-Za-z]*;/()/ +#/^function / s/: [A-Za-z][A-Za-z]*//g + +/\Wfor\W/ s/ to /; i <= / +/\Wfor\W/ s/)/; ++i)/