Remove CallExpression support (#6639)
Users MUST use keyword call syntax now. Closes https://github.com/KittyCAD/modeling-app/issues/4600
This commit is contained in:
@ -2,11 +2,11 @@ use sha2::{Digest as DigestTrait, Sha256};
|
||||
|
||||
use crate::parsing::ast::types::{
|
||||
Annotation, ArrayExpression, ArrayRangeExpression, AscribedExpression, BinaryExpression, BinaryPart, BodyItem,
|
||||
CallExpression, CallExpressionKw, DefaultParamVal, ElseIf, Expr, ExpressionStatement, FunctionExpression,
|
||||
Identifier, IfExpression, ImportItem, ImportSelector, ImportStatement, ItemVisibility, KclNone, LabelledExpression,
|
||||
Literal, LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, Name, ObjectExpression, ObjectProperty,
|
||||
Parameter, PipeExpression, PipeSubstitution, PrimitiveType, Program, ReturnStatement, TagDeclarator, Type,
|
||||
TypeDeclaration, UnaryExpression, VariableDeclaration, VariableDeclarator, VariableKind,
|
||||
CallExpressionKw, DefaultParamVal, ElseIf, Expr, ExpressionStatement, FunctionExpression, Identifier, IfExpression,
|
||||
ImportItem, ImportSelector, ImportStatement, ItemVisibility, KclNone, LabelledExpression, Literal,
|
||||
LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, Name, ObjectExpression, ObjectProperty, Parameter,
|
||||
PipeExpression, PipeSubstitution, PrimitiveType, Program, ReturnStatement, TagDeclarator, Type, TypeDeclaration,
|
||||
UnaryExpression, VariableDeclaration, VariableDeclarator, VariableKind,
|
||||
};
|
||||
|
||||
/// Position-independent digest of the AST node.
|
||||
@ -132,7 +132,6 @@ impl Expr {
|
||||
Expr::TagDeclarator(tag) => tag.compute_digest(),
|
||||
Expr::BinaryExpression(be) => be.compute_digest(),
|
||||
Expr::FunctionExpression(fe) => fe.compute_digest(),
|
||||
Expr::CallExpression(ce) => ce.compute_digest(),
|
||||
Expr::CallExpressionKw(ce) => ce.compute_digest(),
|
||||
Expr::PipeExpression(pe) => pe.compute_digest(),
|
||||
Expr::PipeSubstitution(ps) => ps.compute_digest(),
|
||||
@ -159,7 +158,6 @@ impl BinaryPart {
|
||||
BinaryPart::Literal(lit) => lit.compute_digest(),
|
||||
BinaryPart::Name(id) => id.compute_digest(),
|
||||
BinaryPart::BinaryExpression(be) => be.compute_digest(),
|
||||
BinaryPart::CallExpression(ce) => ce.compute_digest(),
|
||||
BinaryPart::CallExpressionKw(ce) => ce.compute_digest(),
|
||||
BinaryPart::UnaryExpression(ue) => ue.compute_digest(),
|
||||
BinaryPart::MemberExpression(me) => me.compute_digest(),
|
||||
@ -480,16 +478,6 @@ impl PipeExpression {
|
||||
});
|
||||
}
|
||||
|
||||
impl CallExpression {
|
||||
compute_digest!(|slf, hasher| {
|
||||
hasher.update(slf.callee.compute_digest());
|
||||
hasher.update(slf.arguments.len().to_ne_bytes());
|
||||
for argument in slf.arguments.iter_mut() {
|
||||
hasher.update(argument.compute_digest());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
impl CallExpressionKw {
|
||||
compute_digest!(|slf, hasher| {
|
||||
hasher.update(slf.callee.compute_digest());
|
||||
|
@ -26,7 +26,6 @@ impl Expr {
|
||||
Expr::TagDeclarator(tag) => tag.module_id,
|
||||
Expr::BinaryExpression(binary_expression) => binary_expression.module_id,
|
||||
Expr::FunctionExpression(function_expression) => function_expression.module_id,
|
||||
Expr::CallExpression(call_expression) => call_expression.module_id,
|
||||
Expr::CallExpressionKw(call_expression) => call_expression.module_id,
|
||||
Expr::PipeExpression(pipe_expression) => pipe_expression.module_id,
|
||||
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.module_id,
|
||||
@ -49,7 +48,6 @@ impl BinaryPart {
|
||||
BinaryPart::Literal(literal) => literal.module_id,
|
||||
BinaryPart::Name(identifier) => identifier.module_id,
|
||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.module_id,
|
||||
BinaryPart::CallExpression(call_expression) => call_expression.module_id,
|
||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.module_id,
|
||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.module_id,
|
||||
BinaryPart::MemberExpression(member_expression) => member_expression.module_id,
|
||||
|
@ -932,7 +932,6 @@ pub enum Expr {
|
||||
TagDeclarator(BoxNode<TagDeclarator>),
|
||||
BinaryExpression(BoxNode<BinaryExpression>),
|
||||
FunctionExpression(BoxNode<FunctionExpression>),
|
||||
CallExpression(BoxNode<CallExpression>),
|
||||
CallExpressionKw(BoxNode<CallExpressionKw>),
|
||||
PipeExpression(BoxNode<PipeExpression>),
|
||||
PipeSubstitution(BoxNode<PipeSubstitution>),
|
||||
@ -978,7 +977,6 @@ impl Expr {
|
||||
Expr::MemberExpression(_mem_exp) => None,
|
||||
Expr::Literal(_literal) => None,
|
||||
Expr::FunctionExpression(_func_exp) => None,
|
||||
Expr::CallExpression(_call_exp) => None,
|
||||
Expr::CallExpressionKw(_call_exp) => None,
|
||||
Expr::Name(_ident) => None,
|
||||
Expr::TagDeclarator(_tag) => None,
|
||||
@ -1006,7 +1004,6 @@ impl Expr {
|
||||
Expr::MemberExpression(_) => {}
|
||||
Expr::Literal(_) => {}
|
||||
Expr::FunctionExpression(ref mut func_exp) => func_exp.replace_value(source_range, new_value),
|
||||
Expr::CallExpression(ref mut call_exp) => call_exp.replace_value(source_range, new_value),
|
||||
Expr::CallExpressionKw(ref mut call_exp) => call_exp.replace_value(source_range, new_value),
|
||||
Expr::Name(_) => {}
|
||||
Expr::TagDeclarator(_) => {}
|
||||
@ -1027,7 +1024,6 @@ impl Expr {
|
||||
Expr::TagDeclarator(tag) => tag.start,
|
||||
Expr::BinaryExpression(binary_expression) => binary_expression.start,
|
||||
Expr::FunctionExpression(function_expression) => function_expression.start,
|
||||
Expr::CallExpression(call_expression) => call_expression.start,
|
||||
Expr::CallExpressionKw(call_expression) => call_expression.start,
|
||||
Expr::PipeExpression(pipe_expression) => pipe_expression.start,
|
||||
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.start,
|
||||
@ -1050,7 +1046,6 @@ impl Expr {
|
||||
Expr::TagDeclarator(tag) => tag.end,
|
||||
Expr::BinaryExpression(binary_expression) => binary_expression.end,
|
||||
Expr::FunctionExpression(function_expression) => function_expression.end,
|
||||
Expr::CallExpression(call_expression) => call_expression.end,
|
||||
Expr::CallExpressionKw(call_expression) => call_expression.end,
|
||||
Expr::PipeExpression(pipe_expression) => pipe_expression.end,
|
||||
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.end,
|
||||
@ -1081,7 +1076,6 @@ impl Expr {
|
||||
binary_expression.rename_identifiers(old_name, new_name)
|
||||
}
|
||||
Expr::FunctionExpression(_function_identifier) => {}
|
||||
Expr::CallExpression(ref mut call_expression) => call_expression.rename_identifiers(old_name, new_name),
|
||||
Expr::CallExpressionKw(ref mut call_expression) => call_expression.rename_identifiers(old_name, new_name),
|
||||
Expr::PipeExpression(ref mut pipe_expression) => pipe_expression.rename_identifiers(old_name, new_name),
|
||||
Expr::PipeSubstitution(_) => {}
|
||||
@ -1110,7 +1104,6 @@ impl Expr {
|
||||
Expr::BinaryExpression(binary_expression) => binary_expression.get_constraint_level(),
|
||||
|
||||
Expr::FunctionExpression(function_identifier) => function_identifier.get_constraint_level(),
|
||||
Expr::CallExpression(call_expression) => call_expression.get_constraint_level(),
|
||||
Expr::CallExpressionKw(call_expression) => call_expression.get_constraint_level(),
|
||||
Expr::PipeExpression(pipe_expression) => pipe_expression.get_constraint_level(),
|
||||
Expr::PipeSubstitution(pipe_substitution) => ConstraintLevel::Ignore {
|
||||
@ -1128,16 +1121,6 @@ impl Expr {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn has_substitution_arg(&self) -> bool {
|
||||
match self {
|
||||
Expr::CallExpression(call_expression) => call_expression.has_substitution_arg(),
|
||||
Expr::CallExpressionKw(call_expression) => call_expression.has_substitution_arg(),
|
||||
Expr::LabelledExpression(expr) => expr.expr.has_substitution_arg(),
|
||||
Expr::AscribedExpression(expr) => expr.expr.has_substitution_arg(),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn literal_bool(&self) -> Option<bool> {
|
||||
match self {
|
||||
Expr::Literal(lit) => match lit.value {
|
||||
@ -1194,7 +1177,6 @@ impl From<&BinaryPart> for Expr {
|
||||
BinaryPart::Literal(literal) => Expr::Literal(literal.clone()),
|
||||
BinaryPart::Name(name) => Expr::Name(name.clone()),
|
||||
BinaryPart::BinaryExpression(binary_expression) => Expr::BinaryExpression(binary_expression.clone()),
|
||||
BinaryPart::CallExpression(call_expression) => Expr::CallExpression(call_expression.clone()),
|
||||
BinaryPart::CallExpressionKw(call_expression) => Expr::CallExpressionKw(call_expression.clone()),
|
||||
BinaryPart::UnaryExpression(unary_expression) => Expr::UnaryExpression(unary_expression.clone()),
|
||||
BinaryPart::MemberExpression(member_expression) => Expr::MemberExpression(member_expression.clone()),
|
||||
@ -1261,7 +1243,6 @@ pub enum BinaryPart {
|
||||
Literal(BoxNode<Literal>),
|
||||
Name(BoxNode<Name>),
|
||||
BinaryExpression(BoxNode<BinaryExpression>),
|
||||
CallExpression(BoxNode<CallExpression>),
|
||||
CallExpressionKw(BoxNode<CallExpressionKw>),
|
||||
UnaryExpression(BoxNode<UnaryExpression>),
|
||||
MemberExpression(BoxNode<MemberExpression>),
|
||||
@ -1287,7 +1268,6 @@ impl BinaryPart {
|
||||
BinaryPart::Literal(literal) => literal.get_constraint_level(),
|
||||
BinaryPart::Name(identifier) => identifier.get_constraint_level(),
|
||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.get_constraint_level(),
|
||||
BinaryPart::CallExpression(call_expression) => call_expression.get_constraint_level(),
|
||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.get_constraint_level(),
|
||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.get_constraint_level(),
|
||||
BinaryPart::MemberExpression(member_expression) => member_expression.get_constraint_level(),
|
||||
@ -1302,9 +1282,6 @@ impl BinaryPart {
|
||||
BinaryPart::BinaryExpression(ref mut binary_expression) => {
|
||||
binary_expression.replace_value(source_range, new_value)
|
||||
}
|
||||
BinaryPart::CallExpression(ref mut call_expression) => {
|
||||
call_expression.replace_value(source_range, new_value)
|
||||
}
|
||||
BinaryPart::CallExpressionKw(ref mut call_expression) => {
|
||||
call_expression.replace_value(source_range, new_value)
|
||||
}
|
||||
@ -1321,7 +1298,6 @@ impl BinaryPart {
|
||||
BinaryPart::Literal(literal) => literal.start,
|
||||
BinaryPart::Name(identifier) => identifier.start,
|
||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.start,
|
||||
BinaryPart::CallExpression(call_expression) => call_expression.start,
|
||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.start,
|
||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.start,
|
||||
BinaryPart::MemberExpression(member_expression) => member_expression.start,
|
||||
@ -1334,7 +1310,6 @@ impl BinaryPart {
|
||||
BinaryPart::Literal(literal) => literal.end,
|
||||
BinaryPart::Name(identifier) => identifier.end,
|
||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.end,
|
||||
BinaryPart::CallExpression(call_expression) => call_expression.end,
|
||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.end,
|
||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.end,
|
||||
BinaryPart::MemberExpression(member_expression) => member_expression.end,
|
||||
@ -1350,9 +1325,6 @@ impl BinaryPart {
|
||||
BinaryPart::BinaryExpression(ref mut binary_expression) => {
|
||||
binary_expression.rename_identifiers(old_name, new_name)
|
||||
}
|
||||
BinaryPart::CallExpression(ref mut call_expression) => {
|
||||
call_expression.rename_identifiers(old_name, new_name)
|
||||
}
|
||||
BinaryPart::CallExpressionKw(ref mut call_expression) => {
|
||||
call_expression.rename_identifiers(old_name, new_name)
|
||||
}
|
||||
@ -1844,18 +1816,6 @@ pub struct ExpressionStatement {
|
||||
pub digest: Option<Digest>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct CallExpression {
|
||||
pub callee: Node<Name>,
|
||||
pub arguments: Vec<Expr>,
|
||||
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub digest: Option<Digest>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase", tag = "type")]
|
||||
@ -1881,37 +1841,12 @@ pub struct LabeledArg {
|
||||
pub arg: Expr,
|
||||
}
|
||||
|
||||
impl From<Node<CallExpression>> for Expr {
|
||||
fn from(call_expression: Node<CallExpression>) -> Self {
|
||||
Expr::CallExpression(Box::new(call_expression))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Node<CallExpressionKw>> for Expr {
|
||||
fn from(call_expression: Node<CallExpressionKw>) -> Self {
|
||||
Expr::CallExpressionKw(Box::new(call_expression))
|
||||
}
|
||||
}
|
||||
|
||||
impl Node<CallExpression> {
|
||||
/// Return the constraint level for this call expression.
|
||||
pub fn get_constraint_level(&self) -> ConstraintLevel {
|
||||
if self.arguments.is_empty() {
|
||||
return ConstraintLevel::Ignore {
|
||||
source_ranges: vec![self.into()],
|
||||
};
|
||||
}
|
||||
|
||||
// Iterate over the arguments and get the constraint level for each one.
|
||||
let mut constraint_levels = ConstraintLevels::new();
|
||||
for arg in &self.arguments {
|
||||
constraint_levels.push(arg.get_constraint_level());
|
||||
}
|
||||
|
||||
constraint_levels.get_constraint_level(self.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl Node<CallExpressionKw> {
|
||||
/// Return the constraint level for this call expression.
|
||||
pub fn get_constraint_level(&self) -> ConstraintLevel {
|
||||
@ -1931,38 +1866,6 @@ impl Node<CallExpressionKw> {
|
||||
}
|
||||
}
|
||||
|
||||
impl CallExpression {
|
||||
pub fn new(name: &str, arguments: Vec<Expr>) -> Result<Node<Self>, KclError> {
|
||||
Ok(Node::no_src(Self {
|
||||
callee: Name::new(name),
|
||||
arguments,
|
||||
digest: None,
|
||||
}))
|
||||
}
|
||||
|
||||
/// Is at least one argument the '%' i.e. the substitution operator?
|
||||
pub fn has_substitution_arg(&self) -> bool {
|
||||
self.arguments
|
||||
.iter()
|
||||
.any(|arg| matches!(arg, Expr::PipeSubstitution(_)))
|
||||
}
|
||||
|
||||
pub fn replace_value(&mut self, source_range: SourceRange, new_value: Expr) {
|
||||
for arg in &mut self.arguments {
|
||||
arg.replace_value(source_range, new_value.clone());
|
||||
}
|
||||
}
|
||||
|
||||
/// Rename all identifiers that have the old name to the new given name.
|
||||
fn rename_identifiers(&mut self, old_name: &str, new_name: &str) {
|
||||
self.callee.rename(old_name, new_name);
|
||||
|
||||
for arg in &mut self.arguments {
|
||||
arg.rename_identifiers(old_name, new_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl CallExpressionKw {
|
||||
pub fn new(name: &str, unlabeled: Option<Expr>, arguments: Vec<LabeledArg>) -> Result<Node<Self>, KclError> {
|
||||
Ok(Node::no_src(Self {
|
||||
@ -1982,13 +1885,6 @@ impl CallExpressionKw {
|
||||
.chain(self.arguments.iter().map(|arg| (Some(&arg.label), &arg.arg)))
|
||||
}
|
||||
|
||||
/// Is at least one argument the '%' i.e. the substitution operator?
|
||||
pub fn has_substitution_arg(&self) -> bool {
|
||||
self.arguments
|
||||
.iter()
|
||||
.any(|arg| matches!(arg.arg, Expr::PipeSubstitution(_)))
|
||||
}
|
||||
|
||||
pub fn replace_value(&mut self, source_range: SourceRange, new_value: Expr) {
|
||||
for arg in &mut self.arguments {
|
||||
arg.arg.replace_value(source_range, new_value.clone());
|
||||
@ -4188,13 +4084,8 @@ cylinder = startSketchOn(-XZ)
|
||||
};
|
||||
oe
|
||||
}
|
||||
Expr::CallExpression(ce) => {
|
||||
let Expr::ObjectExpression(ref oe) = (ce.arguments).first().unwrap() else {
|
||||
panic!("expected an object!");
|
||||
};
|
||||
oe
|
||||
}
|
||||
other => panic!("expected a Call or CallKw, found {other:?}"),
|
||||
|
||||
other => panic!("expected a CallKw, found {other:?}"),
|
||||
};
|
||||
|
||||
assert_eq!(oe.properties.len(), 2);
|
||||
|
@ -177,18 +177,6 @@ impl NodePath {
|
||||
}
|
||||
}
|
||||
}
|
||||
Expr::CallExpression(node) => {
|
||||
if node.callee.contains_range(&range) {
|
||||
path.push(Step::CallCallee);
|
||||
return Some(path);
|
||||
}
|
||||
for (i, arg) in node.arguments.iter().enumerate() {
|
||||
if arg.contains_range(&range) {
|
||||
path.push(Step::CallArg { index: i });
|
||||
return Self::from_expr(arg, range, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
Expr::CallExpressionKw(node) => {
|
||||
if node.callee.contains_range(&range) {
|
||||
path.push(Step::CallKwCallee);
|
||||
|
@ -14,7 +14,7 @@ use winnow::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
ast::types::{AscribedExpression, CallExpression, ImportPath, LabelledExpression},
|
||||
ast::types::{AscribedExpression, ImportPath, LabelledExpression},
|
||||
token::{NumericSuffix, RESERVED_WORDS},
|
||||
DeprecationKind,
|
||||
};
|
||||
@ -630,7 +630,6 @@ fn operand(i: &mut TokenSlice) -> PResult<BinaryPart> {
|
||||
Expr::Literal(x) => BinaryPart::Literal(x),
|
||||
Expr::Name(x) => BinaryPart::Name(x),
|
||||
Expr::BinaryExpression(x) => BinaryPart::BinaryExpression(x),
|
||||
Expr::CallExpression(x) => BinaryPart::CallExpression(x),
|
||||
Expr::CallExpressionKw(x) => BinaryPart::CallExpressionKw(x),
|
||||
Expr::MemberExpression(x) => BinaryPart::MemberExpression(x),
|
||||
Expr::IfExpression(x) => BinaryPart::IfExpression(x),
|
||||
@ -2030,7 +2029,6 @@ fn expr_allowed_in_pipe_expr(i: &mut TokenSlice) -> PResult<Expr> {
|
||||
bool_value.map(Expr::Literal),
|
||||
tag.map(Box::new).map(Expr::TagDeclarator),
|
||||
literal.map(Expr::Literal),
|
||||
fn_call.map(Box::new).map(Expr::CallExpression),
|
||||
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
|
||||
name.map(Box::new).map(Expr::Name),
|
||||
array,
|
||||
@ -2050,7 +2048,6 @@ fn possible_operands(i: &mut TokenSlice) -> PResult<Expr> {
|
||||
bool_value.map(Expr::Literal),
|
||||
member_expression.map(Box::new).map(Expr::MemberExpression),
|
||||
literal.map(Expr::Literal),
|
||||
fn_call.map(Box::new).map(Expr::CallExpression),
|
||||
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
|
||||
name.map(Box::new).map(Expr::Name),
|
||||
binary_expr_in_parens.map(Box::new).map(Expr::BinaryExpression),
|
||||
@ -2711,13 +2708,6 @@ fn pipe_sep(i: &mut TokenSlice) -> PResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Arguments are passed into a function.
|
||||
fn arguments(i: &mut TokenSlice) -> PResult<Vec<Expr>> {
|
||||
separated(0.., expression, comma_sep)
|
||||
.context(expected("function arguments"))
|
||||
.parse_next(i)
|
||||
}
|
||||
|
||||
fn labeled_argument(i: &mut TokenSlice) -> PResult<LabeledArg> {
|
||||
separated_pair(
|
||||
terminated(nameable_identifier, opt(whitespace)),
|
||||
@ -2986,11 +2976,7 @@ fn binding_name(i: &mut TokenSlice) -> PResult<Node<Identifier>> {
|
||||
|
||||
/// Either a positional or keyword function call.
|
||||
fn fn_call_pos_or_kw(i: &mut TokenSlice) -> PResult<Expr> {
|
||||
alt((
|
||||
fn_call.map(Box::new).map(Expr::CallExpression),
|
||||
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
|
||||
))
|
||||
.parse_next(i)
|
||||
alt((fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),)).parse_next(i)
|
||||
}
|
||||
|
||||
fn labelled_fn_call(i: &mut TokenSlice) -> PResult<Expr> {
|
||||
@ -3003,43 +2989,6 @@ fn labelled_fn_call(i: &mut TokenSlice) -> PResult<Expr> {
|
||||
}
|
||||
}
|
||||
|
||||
fn fn_call(i: &mut TokenSlice) -> PResult<Node<CallExpression>> {
|
||||
let fn_name = name(i)?;
|
||||
opt(whitespace).parse_next(i)?;
|
||||
let _ = terminated(open_paren, opt(whitespace)).parse_next(i)?;
|
||||
let args = arguments(i)?;
|
||||
let end = preceded(opt(whitespace), close_paren).parse_next(i)?.end;
|
||||
|
||||
let result = Node::new_node(
|
||||
fn_name.start,
|
||||
end,
|
||||
fn_name.module_id,
|
||||
CallExpression {
|
||||
callee: fn_name,
|
||||
arguments: args,
|
||||
digest: None,
|
||||
},
|
||||
);
|
||||
|
||||
let callee_str = result.callee.name.name.to_string();
|
||||
if let Some(suggestion) = super::deprecation(&callee_str, DeprecationKind::Function) {
|
||||
ParseContext::warn(
|
||||
CompilationError::err(
|
||||
result.as_source_range(),
|
||||
format!("Calling `{}` is deprecated, prefer using `{}`.", callee_str, suggestion),
|
||||
)
|
||||
.with_suggestion(
|
||||
format!("Replace `{}` with `{}`", callee_str, suggestion),
|
||||
suggestion,
|
||||
None,
|
||||
Tag::Deprecated,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> {
|
||||
let fn_name = name(i)?;
|
||||
opt(whitespace).parse_next(i)?;
|
||||
@ -3231,18 +3180,6 @@ mod tests {
|
||||
assert_reserved("import");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_args() {
|
||||
for (i, (test, expected_len)) in [("someVar", 1), ("5, 3", 2), (r#""a""#, 1)].into_iter().enumerate() {
|
||||
let tokens = crate::parsing::token::lex(test, ModuleId::default()).unwrap();
|
||||
let actual = match arguments.parse(tokens.as_slice()) {
|
||||
Ok(x) => x,
|
||||
Err(e) => panic!("Failed test {i}, could not parse function arguments from \"{test}\": {e:?}"),
|
||||
};
|
||||
assert_eq!(actual.len(), expected_len, "failed test {i}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_names() {
|
||||
for (test, expected_len) in [("someVar", 0), ("::foo", 0), ("foo::bar::baz", 2)] {
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 26,
|
||||
"end": 28,
|
||||
"name": {
|
||||
"commentStart": 26,
|
||||
"end": 28,
|
||||
"name": "XY",
|
||||
"start": 26,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 26,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 12,
|
||||
@ -55,8 +37,24 @@ expression: actual
|
||||
"commentStart": 12,
|
||||
"end": 29,
|
||||
"start": 12,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 26,
|
||||
"end": 28,
|
||||
"name": {
|
||||
"commentStart": 26,
|
||||
"end": 28,
|
||||
"name": "XY",
|
||||
"start": 26,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 26,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
|
@ -63,7 +63,6 @@ expression: actual
|
||||
"commentStart": 56,
|
||||
"end": 74,
|
||||
"expression": {
|
||||
"arguments": [],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 56,
|
||||
@ -82,8 +81,9 @@ expression: actual
|
||||
"commentStart": 56,
|
||||
"end": 74,
|
||||
"start": 56,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
"start": 56,
|
||||
"type": "ExpressionStatement",
|
||||
|
@ -71,17 +71,6 @@ expression: actual
|
||||
"commentStart": 48,
|
||||
"end": 60,
|
||||
"expression": {
|
||||
"arguments": [
|
||||
{
|
||||
"commentStart": 54,
|
||||
"end": 59,
|
||||
"raw": "false",
|
||||
"start": 54,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 48,
|
||||
@ -100,8 +89,17 @@ expression: actual
|
||||
"commentStart": 48,
|
||||
"end": 60,
|
||||
"start": 48,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"commentStart": 54,
|
||||
"end": 59,
|
||||
"raw": "false",
|
||||
"start": 54,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": false
|
||||
}
|
||||
},
|
||||
"start": 48,
|
||||
"type": "ExpressionStatement",
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": {
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": "XY",
|
||||
"start": 25,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 25,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 11,
|
||||
@ -55,8 +37,24 @@ expression: actual
|
||||
"commentStart": 11,
|
||||
"end": 28,
|
||||
"start": 11,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": {
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": "XY",
|
||||
"start": 25,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 25,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
@ -367,7 +365,6 @@ expression: actual
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 223,
|
||||
@ -386,8 +383,9 @@ expression: actual
|
||||
"commentStart": 223,
|
||||
"end": 230,
|
||||
"start": 223,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
}
|
||||
],
|
||||
"commentStart": 11,
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": {
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": "XY",
|
||||
"start": 25,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 25,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 11,
|
||||
@ -55,8 +37,24 @@ expression: actual
|
||||
"commentStart": 11,
|
||||
"end": 28,
|
||||
"start": 11,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": {
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": "XY",
|
||||
"start": 25,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 25,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
@ -195,7 +193,6 @@ expression: actual
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 90,
|
||||
@ -214,8 +211,9 @@ expression: actual
|
||||
"commentStart": 90,
|
||||
"end": 97,
|
||||
"start": 90,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
}
|
||||
],
|
||||
"commentStart": 11,
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 22,
|
||||
"end": 24,
|
||||
"name": {
|
||||
"commentStart": 22,
|
||||
"end": 24,
|
||||
"name": "XY",
|
||||
"start": 22,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 22,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 8,
|
||||
@ -55,8 +37,24 @@ expression: actual
|
||||
"commentStart": 8,
|
||||
"end": 25,
|
||||
"start": 8,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 22,
|
||||
"end": 24,
|
||||
"name": {
|
||||
"commentStart": 22,
|
||||
"end": 24,
|
||||
"name": "XY",
|
||||
"start": 22,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 22,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
|
@ -19,20 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"commentStart": 10,
|
||||
"end": 11,
|
||||
"raw": "1",
|
||||
"start": 10,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 1.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 8,
|
||||
@ -51,24 +37,22 @@ expression: actual
|
||||
"commentStart": 8,
|
||||
"end": 12,
|
||||
"start": 8,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"commentStart": 10,
|
||||
"end": 11,
|
||||
"raw": "1",
|
||||
"start": 10,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 1.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"commentStart": 18,
|
||||
"end": 19,
|
||||
"raw": "2",
|
||||
"start": 18,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 2.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 16,
|
||||
@ -87,8 +71,20 @@ expression: actual
|
||||
"commentStart": 16,
|
||||
"end": 20,
|
||||
"start": 16,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"commentStart": 18,
|
||||
"end": 19,
|
||||
"raw": "2",
|
||||
"start": 18,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 2.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"commentStart": 8,
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 22,
|
||||
"end": 24,
|
||||
"name": {
|
||||
"commentStart": 22,
|
||||
"end": 24,
|
||||
"name": "XY",
|
||||
"start": 22,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 22,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 8,
|
||||
@ -55,8 +37,24 @@ expression: actual
|
||||
"commentStart": 8,
|
||||
"end": 25,
|
||||
"start": 8,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 22,
|
||||
"end": 24,
|
||||
"name": {
|
||||
"commentStart": 22,
|
||||
"end": 24,
|
||||
"name": "XY",
|
||||
"start": 22,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 22,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": {
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": "XY",
|
||||
"start": 25,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 25,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 11,
|
||||
@ -55,8 +37,24 @@ expression: actual
|
||||
"commentStart": 11,
|
||||
"end": 28,
|
||||
"start": 11,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": {
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": "XY",
|
||||
"start": 25,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 25,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
|
@ -8,45 +8,6 @@ expression: actual
|
||||
"commentStart": 0,
|
||||
"end": 12,
|
||||
"expression": {
|
||||
"arguments": [
|
||||
{
|
||||
"commentStart": 5,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 6,
|
||||
"end": 7,
|
||||
"raw": "0",
|
||||
"start": 6,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 0.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 9,
|
||||
"end": 10,
|
||||
"name": {
|
||||
"commentStart": 9,
|
||||
"end": 10,
|
||||
"name": "l",
|
||||
"start": 9,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 9,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"end": 11,
|
||||
"start": 5,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
@ -65,8 +26,45 @@ expression: actual
|
||||
"commentStart": 0,
|
||||
"end": 12,
|
||||
"start": 0,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"commentStart": 5,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 6,
|
||||
"end": 7,
|
||||
"raw": "0",
|
||||
"start": 6,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 0.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 9,
|
||||
"end": 10,
|
||||
"name": {
|
||||
"commentStart": 9,
|
||||
"end": 10,
|
||||
"name": "l",
|
||||
"start": 9,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 9,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"end": 11,
|
||||
"start": 5,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
},
|
||||
"start": 0,
|
||||
"type": "ExpressionStatement",
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": {
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": "XY",
|
||||
"start": 25,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 25,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 11,
|
||||
@ -55,8 +37,24 @@ expression: actual
|
||||
"commentStart": 11,
|
||||
"end": 28,
|
||||
"start": 11,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": {
|
||||
"commentStart": 25,
|
||||
"end": 27,
|
||||
"name": "XY",
|
||||
"start": 25,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 25,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
|
@ -32,24 +32,6 @@ expression: actual
|
||||
{
|
||||
"commentStart": 38,
|
||||
"cond": {
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 51,
|
||||
"end": 57,
|
||||
"name": {
|
||||
"commentStart": 51,
|
||||
"end": 57,
|
||||
"name": "radius",
|
||||
"start": 51,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 51,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 46,
|
||||
@ -68,8 +50,24 @@ expression: actual
|
||||
"commentStart": 46,
|
||||
"end": 58,
|
||||
"start": 46,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 51,
|
||||
"end": 57,
|
||||
"name": {
|
||||
"commentStart": 51,
|
||||
"end": 57,
|
||||
"name": "radius",
|
||||
"start": 51,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 51,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
"digest": null,
|
||||
"end": 84,
|
||||
|
@ -51,20 +51,6 @@ expression: actual
|
||||
"type": "BinaryExpression"
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"commentStart": 24,
|
||||
"end": 26,
|
||||
"raw": "45",
|
||||
"start": 24,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 45.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 17,
|
||||
@ -83,8 +69,20 @@ expression: actual
|
||||
"commentStart": 17,
|
||||
"end": 27,
|
||||
"start": 17,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"commentStart": 24,
|
||||
"end": 26,
|
||||
"raw": "45",
|
||||
"start": 24,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 45.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"commentStart": 8,
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 19,
|
||||
"end": 21,
|
||||
"name": {
|
||||
"commentStart": 19,
|
||||
"end": 21,
|
||||
"name": "XY",
|
||||
"start": 19,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 19,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 5,
|
||||
@ -55,28 +37,26 @@ expression: actual
|
||||
"commentStart": 5,
|
||||
"end": 22,
|
||||
"start": 5,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 19,
|
||||
"end": 21,
|
||||
"name": {
|
||||
"commentStart": 19,
|
||||
"end": 21,
|
||||
"name": "XY",
|
||||
"start": 19,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 19,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 39,
|
||||
"end": 42,
|
||||
"name": {
|
||||
"commentStart": 39,
|
||||
"end": 42,
|
||||
"name": "pos",
|
||||
"start": 39,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 39,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 26,
|
||||
@ -95,8 +75,24 @@ expression: actual
|
||||
"commentStart": 26,
|
||||
"end": 43,
|
||||
"start": 26,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 39,
|
||||
"end": 42,
|
||||
"name": {
|
||||
"commentStart": 39,
|
||||
"end": 42,
|
||||
"name": "pos",
|
||||
"start": 39,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 39,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
}
|
||||
],
|
||||
"commentStart": 5,
|
||||
|
@ -19,24 +19,6 @@ expression: actual
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 19,
|
||||
"end": 21,
|
||||
"name": {
|
||||
"commentStart": 19,
|
||||
"end": 21,
|
||||
"name": "XY",
|
||||
"start": 19,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 19,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 5,
|
||||
@ -55,28 +37,26 @@ expression: actual
|
||||
"commentStart": 5,
|
||||
"end": 22,
|
||||
"start": 5,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 19,
|
||||
"end": 21,
|
||||
"name": {
|
||||
"commentStart": 19,
|
||||
"end": 21,
|
||||
"name": "XY",
|
||||
"start": 19,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 19,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 43,
|
||||
"end": 46,
|
||||
"name": {
|
||||
"commentStart": 43,
|
||||
"end": 46,
|
||||
"name": "pos",
|
||||
"start": 43,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 43,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 30,
|
||||
@ -95,57 +75,26 @@ expression: actual
|
||||
"commentStart": 30,
|
||||
"end": 47,
|
||||
"start": 30,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 43,
|
||||
"end": 46,
|
||||
"name": {
|
||||
"commentStart": 43,
|
||||
"end": 46,
|
||||
"name": "pos",
|
||||
"start": 43,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 43,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"commentStart": 56,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 57,
|
||||
"end": 58,
|
||||
"raw": "0",
|
||||
"start": 57,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 0.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"argument": {
|
||||
"abs_path": false,
|
||||
"commentStart": 61,
|
||||
"end": 66,
|
||||
"name": {
|
||||
"commentStart": 61,
|
||||
"end": 66,
|
||||
"name": "scale",
|
||||
"start": 61,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 61,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 60,
|
||||
"end": 66,
|
||||
"operator": "-",
|
||||
"start": 60,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
}
|
||||
],
|
||||
"end": 67,
|
||||
"start": 56,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 51,
|
||||
@ -164,8 +113,53 @@ expression: actual
|
||||
"commentStart": 51,
|
||||
"end": 68,
|
||||
"start": 51,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"commentStart": 56,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 57,
|
||||
"end": 58,
|
||||
"raw": "0",
|
||||
"start": 57,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 0.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"argument": {
|
||||
"abs_path": false,
|
||||
"commentStart": 61,
|
||||
"end": 66,
|
||||
"name": {
|
||||
"commentStart": 61,
|
||||
"end": 66,
|
||||
"name": "scale",
|
||||
"start": 61,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 61,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 60,
|
||||
"end": 66,
|
||||
"operator": "-",
|
||||
"start": 60,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
}
|
||||
],
|
||||
"end": 67,
|
||||
"start": 56,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"commentStart": 5,
|
||||
|
Reference in New Issue
Block a user