alanmmckay / KLEINcompiler

A compiler written in Python to translate KLEIN programs into TM assembly language. A group project for the Translation of Programming Languages class at University of Northern Iowa.
1 stars 0 forks source link

TM output file names. #68

Closed alanmmckay closed 4 years ago

alanmmckay commented 4 years ago

Looks like if the file ends with an 'n' before the extension, the n gets omitted when the strip method is called.

ex: print("on.kln".strip(".kln")) outputs 'o'

Might be an easy fix might be something stupidly difficult to fix.

alanmmckay commented 4 years ago

Weird. print("kfklo.kln".strip(".kln")) outputs fklo. Perhaps .strip() isn't the best method to use here. We could simply negate the last four characters and make use of python's string indexing operations.