Fix tagged template start to include tag (#714)

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
This commit is contained in:
David Sherret 2020-03-09 23:35:42 -04:00 committed by GitHub
parent 6f4e534c88
commit 2f47d41f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "swc_ecma_parser" name = "swc_ecma_parser"
version = "0.21.1" version = "0.21.2"
authors = ["강동윤 <kdy1997.dev@gmail.com>"] authors = ["강동윤 <kdy1997.dev@gmail.com>"]
license = "Apache-2.0/MIT" license = "Apache-2.0/MIT"
repository = "https://github.com/swc-project/swc.git" repository = "https://github.com/swc-project/swc.git"

View File

@ -776,9 +776,8 @@ impl<'a, I: Tokens> Parser<'a, I> {
tag: Box<Expr>, tag: Box<Expr>,
type_params: Option<TsTypeParamInstantiation>, type_params: Option<TsTypeParamInstantiation>,
) -> PResult<'a, TaggedTpl> { ) -> PResult<'a, TaggedTpl> {
let start = tag.span().lo(); let tagged_tpl_start = tag.span().lo();
trace_cur!(parse_tagged_tpl); trace_cur!(parse_tagged_tpl);
let start = cur_pos!();
assert_and_bump!('`'); assert_and_bump!('`');
@ -786,7 +785,7 @@ impl<'a, I: Tokens> Parser<'a, I> {
expect!('`'); expect!('`');
let span = span!(start); let span = span!(tagged_tpl_start);
Ok(TaggedTpl { Ok(TaggedTpl {
span, span,
tag, tag,

View File

@ -23,7 +23,7 @@
"callee": { "callee": {
"type": "TaggedTemplateExpression", "type": "TaggedTemplateExpression",
"span": { "span": {
"start": 9, "start": 4,
"end": 11, "end": 11,
"ctxt": 0 "ctxt": 0
}, },

View File

@ -16,7 +16,7 @@
"expression": { "expression": {
"type": "TaggedTemplateExpression", "type": "TaggedTemplateExpression",
"span": { "span": {
"start": 4, "start": 0,
"end": 6, "end": 6,
"ctxt": 0 "ctxt": 0
}, },