Closed
Bug 554102
Opened 14 years ago
Closed 14 years ago
Cleanup: switch from global TokenStream functions to methods
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: cdleary, Assigned: cdleary)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 2 obsolete files)
72.31 KB,
patch
|
Details | Diff | Splinter Review |
Since getToken and friends have become methods of tokenstream, we should invoke them accordingly.
Assignee | ||
Comment 1•14 years ago
|
||
Preserves documentation from the removed functions on the methods.
Assignee: general → cdleary
Attachment #433977 -
Attachment is obsolete: true
Comment 2•14 years ago
|
||
Would some inline forwarding methods on JSCompiler (e.g. JSCompiler::getToken) to JSCompiler::tokenStream not be a good reduction in source noise/redundancy? /be
Assignee | ||
Comment 3•14 years ago
|
||
(In reply to comment #2) If you'd like -- I don't think it's too noisy to say |tokenStream.*|, but I'm pro-explicit-self, so I'm warped to begin with. By the by, the pump-primed token stream I'm layering on top of the current token stream has a slightly simplified API: |prime(flags)| Invoke at the end of productions for priming. |consume(assertFlags)| Consume the primed token and fetch the new one |look(checkFlags)| Look at the primed token without consuming it (like peek but without side-effects). |conumeOnMatch(TokenKind)| Like matchToken but without side-effects. Changing to the new set of methods lets me make sure I considered everything properly in converting it to the pump priming way of doing things.
Comment 4•14 years ago
|
||
Chris: your call on the inline forwarders -- subtle trade-offs here, not my call. The new method names start with the pump metaphor but then switch to consumption instead of pumping. More substantially, why have prime and consume? Typically you just .get() your way along (e.g., in javac, if memory serves), and inspect .token to see what was last got. Does the opportunity for assertions motivates the prime/consume split? /be
Assignee | ||
Comment 5•14 years ago
|
||
(In reply to comment #4) Yeah, I'm concerned that the flags that the token was primed with are not the ones expected at the get() site, so this interface helps me check that. |.token| is analogous to |look(assertFlags)| but with flag checking. There are only a few E4X tests in our test suite where we have more than one token of lookahead. In this case I'm guessing priming twice should be a suitable replacement for multiple |unget()|s.
Assignee | ||
Updated•14 years ago
|
Attachment #433980 -
Flags: review?(jim)
Comment 6•14 years ago
|
||
Comment on attachment 433980 [details] [diff] [review] Switch to TokenStream methods. Looks good --- just get a full test suite run on it.
Attachment #433980 -
Flags: review?(jim) → review+
Assignee | ||
Comment 7•14 years ago
|
||
Slightly stale. Passes full suite, worming its way through the try server now.
Attachment #433980 -
Attachment is obsolete: true
Attachment #434382 -
Flags: review?(jim)
Comment 8•14 years ago
|
||
This has been landed in TM --- isn't that so? http://hg.mozilla.org/tracemonkey/rev/732dbd2b2d46 If yes, then this can be marked "ASSIGNED" and have "fixed-in-tracemonkey" in the "whiteboard" field now.
Assignee | ||
Updated•14 years ago
|
Status: NEW → ASSIGNED
Whiteboard: fixed-in-tracemonkey
Assignee | ||
Updated•14 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•14 years ago
|
Attachment #434382 -
Flags: review?(jim)
You need to log in
before you can comment on or make changes to this bug.
Description
•