-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
bugcategory:expressionsIssues about the expression parser, variable scoping etc.Issues about the expression parser, variable scoping etc.
Description
Hi, I'm really enjoying the implementation of multi line expressions, I feel it makes the code more readable for objects and other a bit more complex mathjs expressions like this
car = {
speed: 10 m/s,
mass: 1e3 kg,
lenth: 3 m
}A workaround without multiline expressions was to make an empty object first and then assigning the attributes one by one with the added benefit that it's possible to comment each one
car = {};
car.speed = 10 m/s # speed
car.mass = 1e3 kg # mass
car.length = 3 m # lengthOne small issue is that it multi line expressions do not work when they are commented in between
car = {
speed: 10 m/s, # speed
mass: 1e3 kg, # mass
lenth: 3 m # length
}Yielding
SyntaxError: Syntax error in part "
mass: 1e3 kg, # mass
lenth: 3 m # length
}" (char 40)
I understand that this could be fixed by the user by submitting lines without comments to math.parser but please consider the possibility of having comments in between multiline expressions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugcategory:expressionsIssues about the expression parser, variable scoping etc.Issues about the expression parser, variable scoping etc.