diff --git a/src/code-gen-pool.rb b/src/code-gen-pool.rb index 87c9673..fac7fdd 100644 --- a/src/code-gen-pool.rb +++ b/src/code-gen-pool.rb @@ -37,6 +37,26 @@ class Execline < CodeGen Code = %q(%(echo "#{e[PREV]}")) end +class Modula2 < CodeGen + Name = "Modula-2" + File = "QR.mod" + Cmd = "gm2 -fiso QR.mod -o QR && ./QR > OUTFILE" + Apt = "gm2" + def code + <<-'END'.lines.map {|l| l.strip }.join + " + MODULE QR; + FROM StrIO IMPORT WriteString; + BEGIN #{ + (PREV).gsub(/()[#{i=94.chr}"]+|[#{i}']+/){ + ["WriteString(",$&,");"]*($1??":?') + } + }END QR. + " + END + end +end + class Pike < CodeGen File = "QR.pike" Cmd = "pike QR.pike > OUTFILE"