Fix pipe expression start (#746)
This commit is contained in:
@ -403,7 +403,7 @@ describe('testing pipe operator special', () => {
|
|||||||
id: { type: 'Identifier', start: 6, end: 14, name: 'mySketch' },
|
id: { type: 'Identifier', start: 6, end: 14, name: 'mySketch' },
|
||||||
init: {
|
init: {
|
||||||
type: 'PipeExpression',
|
type: 'PipeExpression',
|
||||||
start: 15,
|
start: 17,
|
||||||
end: 145,
|
end: 145,
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
@ -644,7 +644,7 @@ describe('testing pipe operator special', () => {
|
|||||||
},
|
},
|
||||||
init: {
|
init: {
|
||||||
type: 'PipeExpression',
|
type: 'PipeExpression',
|
||||||
start: 12,
|
start: 14,
|
||||||
end: 36,
|
end: 36,
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
|
@ -1283,7 +1283,11 @@ impl Parser {
|
|||||||
let end_token = self.get_token(pipe_body_result.last_index)?;
|
let end_token = self.get_token(pipe_body_result.last_index)?;
|
||||||
Ok(PipeExpressionResult {
|
Ok(PipeExpressionResult {
|
||||||
expression: PipeExpression {
|
expression: PipeExpression {
|
||||||
start: current_token.start,
|
start: pipe_body_result
|
||||||
|
.body
|
||||||
|
.first()
|
||||||
|
.map(|v| v.start())
|
||||||
|
.unwrap_or(current_token.start),
|
||||||
end: end_token.end,
|
end: end_token.end,
|
||||||
body: pipe_body_result.body,
|
body: pipe_body_result.body,
|
||||||
non_code_meta: pipe_body_result.non_code_meta,
|
non_code_meta: pipe_body_result.non_code_meta,
|
||||||
|
Reference in New Issue
Block a user