Commit Graph

7 Commits

Author SHA1 Message Date
Michael Martin
41bf01d035 Convert Ophis to Python 3.
Most of the work is handled by 2to3, but there's a few extra tricks
needed to finish the job, mostly about picking the right bits to be
Unicode and the right bits to be bytes.
2019-01-09 20:45:01 -08:00
Michael Martin
42f01f7cd6 Bump minor version number and copyright dates 2014-03-22 22:09:11 -07:00
Michael C. Martin
14a37ca879 Massive code modernization spree.
Full PEP8 compliance. Also, booleans have been inserted where
they make sense (introduced in 2.3!) and I haven't knowingly
added anything that will break 2.3 compatibility.

At this point the code really doesn't look like it was written
ten years ago. Hooray!
2012-06-02 00:04:15 -07:00
Michael C. Martin
d955fe00a1 Switch to "new-style" classes, because come on.
Ophis was originally written for Python 2.1, and it kind of shows.
Python 2.3 introduced booleans and optparse, so there's no reason
to not use new-style classes.
2012-06-01 00:24:51 -07:00
Michael C. Martin
f8bc917601 A new 'correctness optimization': ExtendBranches.
This pass actually isn't an optimizer in that it produces larger
binaries when it triggers. However, the larger binaries created
will actually assemble properly.

The ExtendBranches pass detects Relative instructions (that is,
branches) that extend past the signed-8-bit range Relative instructions
permit, and replaces them with a branch-jump combination with identical
semantics.

Since this may be evidence of a program bug, Ophis will warn when
the optimization is triggered.

Due to similarities between this pass and UpdateLabels, both passes
have been refactored in passing.
2012-05-27 15:57:23 -07:00
Michael C. Martin
1df8ad465d Major formatting fixes:
* No more tabs
 * Fix copyright notices to point at right files and name the license right
2012-05-06 20:06:28 -07:00
Michael C. Martin
2c8dba2450 Initial import of the Ophis 1.0 distribution and supplemental material 2011-08-20 16:33:25 -07:00