Closed Bug 563728 Opened 15 years ago Closed 15 years ago

Switch the imacro compiler over to Python

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Assigned: jorendorff)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Self-hosting imacro_asm.js.in has been cool, but there are some lame side effects: - we have a non-source file checked into hg - the edit/compile/debug cycle is a little weirder if you happen to be editing imacros.jsasm. - if you hack a printf into the engine and rebuild, make dies with an error (after having successfully built the shell you wanted). - cross-compiling is broken-- though I imagine it's broken in other ways too All fixable in various ways, but let's just do it in Python -- the program is really pretty much identical either way, and our build system already requires Python.
Attached patch v1Splinter Review
With much love for the original.
Assignee: general → jorendorff
Attachment #443404 - Flags: review?(brendan)
Comment on attachment 443404 [details] [diff] [review] v1 I'm not gonna kill my own creature. I still think we have better things to fix but you sunk the cost. Now it's your creature. Non-bogus-shell-hack command-line js may arrive some day, but we won't get back what is lost here. The vicious circle continues. /be
Attachment #443404 - Flags: review?(brendan) → review?(jwalden+bmo)
Comment on attachment 443404 [details] [diff] [review] v1 >diff --git a/js/src/imacro_asm.js.in b/js/src/imacro_asm.py >+ if hasattr(op, "target_index"): >+ if op.target_index <= i: >+ raise ValueError("Backward jump at " + imacro.filename + ":" + op.line) Doesn't this need to be % and all to avoid a type error of some sort? >+def assemble(filename, outfile): >+ # strip comments >+ line = re.sub(r'#.*', '', line) >+ line = line.rstrip() Chain harder: line = re.sub(r'#.*', '', line).rstrip() Nice to see this, fixing the problem of self-horking your own tree with a patch that misgenerates the .c.out file, requiring a refresh/pop to return to sanity...
Attachment #443404 - Flags: review?(jwalden+bmo) → review+
Whiteboard: fixed-in-tracemonkey
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: