Skip to content

Commit

Permalink
asm+comment target 살리고 '-' output 처리 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Apr 5, 2024
1 parent cc0c44a commit c98fbbb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions aheui/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
\t1: Quickly resolve deadcode by rough stacksize emulation and merge constant operations.
\t2: Perfectly resolve deadcode by stacksize emulation, reserialize code chunks and merge constant operations.
""")
parser.add_argument('--source', '-S', default='auto', choices='auto,bytecode,asm,asm+comment,text', description='Set source filetype.', full_description="""\t- `auto`: Guess the source type. `bytecode` if `.aheuic` or `End of bytecode` pattern in source. `asm` is `.aheuis`. `text` if `.aheui`. `text` is default.
parser.add_argument('--source', '-S', default='auto', choices='auto,bytecode,asm,text', description='Set source filetype.', full_description="""\t- `auto`: Guess the source type. `bytecode` if `.aheuic` or `End of bytecode` pattern in source. `asm` is `.aheuis`. `text` if `.aheui`. `text` is default.
\t- `bytecode`: Aheui bytecode. (Bytecode representation of `ahsembly`.
\t- `asm`: See `ahsembly`.
\t- `asm+comment`: Same as `asm` with comments.
\t- usage: `--source=asm`, `-Sbytecode` or `-S text`
""")
parser.add_argument('--target', '-T', default='run', choices='run,bytecode,asm', description='Set target filetype.', full_description="""\t- `run`: Run given code.
parser.add_argument('--target', '-T', default='run', choices='run,bytecode,asm,asm+comment', description='Set target filetype.', full_description="""\t- `run`: Run given code.
\t- `bytecode`: Aheui bytecode. (Bytecode representation of `ahsembly`.
\t- `asm`: See `ahsembly`.
\t- usage: `--target=asm`, `-Tbytecode` or `-T run`
Expand Down Expand Up @@ -131,10 +131,11 @@ def open_r(filename):
output += '.aheuic'
elif target in ['asm', 'asm+comment']:
output = filename
if output.endswith('.aheui'):
output += 's'
else:
output += '.aheuis'
if output != '-':
if output.endswith('.aheui'):
output += 's'
else:
output += '.aheuis'
comment_aheuis = target == 'asm+comment'
elif target == 'run':
output = '-'
Expand Down

0 comments on commit c98fbbb

Please sign in to comment.