mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 08:44:00 -06:00
Porting script moved to my project "port", which makes more sense
This commit is contained in:
committed by
Eric Fredricksen
parent
de00df3c7d
commit
60c8a9fa3f
-38
@@ -1,38 +0,0 @@
|
|||||||
#!/usr/bin/sed -f
|
|
||||||
|
|
||||||
# Convert Pascal syntax to Javascript
|
|
||||||
|
|
||||||
s,{,/*,g
|
|
||||||
s,},*/,g
|
|
||||||
s/ = / == /g
|
|
||||||
s/:=/=/g
|
|
||||||
s/procedure/function/g
|
|
||||||
s/begin/{/
|
|
||||||
s/end;/}/g
|
|
||||||
s/end/}/g
|
|
||||||
|
|
||||||
s/not/!/g
|
|
||||||
s/ and / \&\& /g
|
|
||||||
s/ or / || /g
|
|
||||||
s/<>/!=/g
|
|
||||||
s/ mod / % /g
|
|
||||||
|
|
||||||
s/if /if (/g
|
|
||||||
s/ then/)/g
|
|
||||||
|
|
||||||
s/while /while (/g
|
|
||||||
s/for /for (/g
|
|
||||||
s/with /with (/g
|
|
||||||
s/ do/)/
|
|
||||||
|
|
||||||
s/case /switch (/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)/
|
|
||||||
Reference in New Issue
Block a user