Le 31/10/2019 à 00:15, Samuel Gougeon a écrit :
.../...

It would be /v//ery/ hard (and easily prone to errors, due to many specific cases, using parentheses, etc) to parse the input to detect all possible cases (1-char symbols, multiple-char symbols, literal numbers with or without exponential notations, real or complex, etc) and adapt the multiplication symbol accordingly.


Actually, the detection of multiple cases is doable. There are not so many.
Example:



Here is the list of tested cases, with an arbitrary number of spaces before and after *:

1.23* 3.32    x
1.23* -3.32 x var* -1.23 x )* -1.23 x var * 1.23 cdot
var* var       cdot
)* 1.23        cdot
All other cases => small space \, , noticeably:
1.23* (-3.32    \,
1.23* var      \,
var* (...      \,
)* var         \,
)*(           \,

When a literal number ends with a point, like "3.", it still works, as with "3".

Unless there are some final remarks, i will push this on review on the forge for the
CLR, DLR, EXPRESSION and scifunc_block_m blocks interfaces.

Regards

Samuel

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to