diff --git a/jtlc b/jtlc index f88ace9..c6865e2 100755 --- a/jtlc +++ b/jtlc @@ -35,13 +35,23 @@ def main(argv): success = translate(args, s, tf) tf.close() if success: + suffix = '.c' if args.E else '.o' m = re.match('(.*)\.jtl', s) if m is not None: - ofname = m.group(1) + '.o' + ofname = m.group(1) + suffix else: - ofname = s + '.o' - success = do_compile(args, tfname, ofname) - ofiles.append(ofname) + ofname = s + suffix + if args.E: + f = open(tfname, 'r') + content = f.read() + f.close() + f = open(ofname, 'w') + f.write(content) + f.close() + return 0 + else: + success = do_compile(args, tfname, ofname) + ofiles.append(ofname) os.unlink(tfname) if success and not args.c: