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' },
|
||||
init: {
|
||||
type: 'PipeExpression',
|
||||
start: 15,
|
||||
start: 17,
|
||||
end: 145,
|
||||
body: [
|
||||
{
|
||||
@ -644,7 +644,7 @@ describe('testing pipe operator special', () => {
|
||||
},
|
||||
init: {
|
||||
type: 'PipeExpression',
|
||||
start: 12,
|
||||
start: 14,
|
||||
end: 36,
|
||||
body: [
|
||||
{
|
||||
|
@ -1283,7 +1283,11 @@ impl Parser {
|
||||
let end_token = self.get_token(pipe_body_result.last_index)?;
|
||||
Ok(PipeExpressionResult {
|
||||
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,
|
||||
body: pipe_body_result.body,
|
||||
non_code_meta: pipe_body_result.non_code_meta,
|
||||
|
Reference in New Issue
Block a user