Reuse hash token instead of new primaryTopicToken
Set whether we're in a pipeline in order to determine how to parse the hash. The error message changes as a result, since the `hash` never enters the block.
This commit is contained in:
@@ -431,7 +431,7 @@ export default class Tokenizer extends LocationParser {
|
||||
)}'`,
|
||||
);
|
||||
} else {
|
||||
this.finishOp(tt.primaryTopicReference, 1);
|
||||
this.finishOp(tt.hash, 1);
|
||||
}
|
||||
} else {
|
||||
this.raise(
|
||||
|
||||
@@ -26,6 +26,7 @@ export default class State {
|
||||
this.maybeInArrowParameters = false;
|
||||
this.inGenerator = false;
|
||||
this.inAsync = false;
|
||||
this.inPipeline = false;
|
||||
this.inPropertyName = false;
|
||||
this.inType = false;
|
||||
this.inClassProperty = false;
|
||||
@@ -110,6 +111,7 @@ export default class State {
|
||||
inGenerator: boolean;
|
||||
inMethod: boolean | N.MethodKind;
|
||||
inAsync: boolean;
|
||||
inPipeline: boolean;
|
||||
inType: boolean;
|
||||
noAnonFunctionType: boolean;
|
||||
inPropertyName: boolean;
|
||||
|
||||
@@ -86,7 +86,6 @@ export const types: { [name: string]: TokenType } = {
|
||||
regexp: new TokenType("regexp", { startsExpr }),
|
||||
string: new TokenType("string", { startsExpr }),
|
||||
name: new TokenType("name", { startsExpr }),
|
||||
primaryTopicReference: new TokenType("#", { startsExpr }),
|
||||
eof: new TokenType("eof"),
|
||||
|
||||
// Punctuation token types.
|
||||
|
||||
Reference in New Issue
Block a user