Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Syntax Recovery #34

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Requirements Status](https://img.shields.io/requires/github/jdpage/jeff65.svg?branch=master&style=flat-square)](https://requires.io/github/jdpage/jeff65/requirements/?branch=master)

*jeff65* is a compiler for the Commodore 64 (and perhaps in the future, other
6502-based computers). It is implemented in Python 3 and produces .prg files
6502-based computers). It is implemented in Python 3.6 (or newer) and produces .prg files
which can be loaded directly in VICE, or combined into .d64 disk images, written
to a floppy disk, and run on real hardware.

Expand Down
8 changes: 7 additions & 1 deletion jeff65/gold/passes/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def collapse_stmt_let(self, storage, name, ty, rhs):
@pattern.match(
ast.AstNode('stmt_assign', children=[
P('lhs'),
require_token(T.OPERATOR_ASSIGN),
token(T.OPERATOR_ASSIGN),
P('rhs'),
]))
def collapse_stmt_assign(self, lhs, rhs):
Expand Down Expand Up @@ -220,6 +220,12 @@ def drop_expr_parens(self, inner):
name_sub = binop(T.OPERATOR_MINUS, 'sub')
name_mul = binop(T.OPERATOR_TIMES, 'mul')
name_div = binop(T.OPERATOR_DIVIDE, 'div')
name_cmp_ne = binop(T.OPERATOR_NE, 'cmp_ne')
name_cmp_eq = binop(T.OPERATOR_EQ, 'cmp_eq')
name_cmp_lt = binop(T.OPERATOR_LT, 'cmp_lt')
name_cmp_gt = binop(T.OPERATOR_GT, 'cmp_gt')
name_cmp_le = binop(T.OPERATOR_LE, 'cmp_le')
name_cmp_ge = binop(T.OPERATOR_GE, 'cmp_ge')

@pattern.match(
ast.AstNode('expr', children=[
Expand Down
Loading