Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error for function isUndefined( ...) #14

Open
digarcia opened this issue Mar 13, 2020 · 1 comment
Open

Parsing error for function isUndefined( ...) #14

digarcia opened this issue Mar 13, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@digarcia
Copy link

When using the isUndefined function as defined in the cd++ manual

Signature: isUndefined : Real → Bool
Description: Returns True if the value is undefined, else returns False.

I get a parsing error for several cases. The only working one is for a concrete value (isUndefined(4))

I attached the ma file with the different cases (undefBugTest.ma). Each one can be tested individually by commenting the others.

The cases are:

  isUndefined(4)	 and 			% ok
  not isUndefined(4) 	 and			% ok
  isUndefined( $var1 )   and			% not ok: Parsing error syntax error, unexpected ')', expecting '!'
  isUndefined( $var2 )   and			% not ok: Parsing error syntax error, unexpected ')', expecting '!'
  isUndefined( $var2 ! 0) and			% ok: But dont know why. I Asume that takes $var2 as a tuple
  isUndefined( $var2 ! 4) and			% ok: But dont know why. I Asume that takes $var2 as a tuple
  isUndefined(?)	  and			% not ok: Parsing error syntax error, unexpected UNDEF
  isUndefined( [?]!0 )    and			% ok: I asume that what happens is that isUndefined expects a tuple. But don't work with plain undef value
  isUndefined( (0,0)~port1 )			% not ok: Parsing error syntax error, unexpected ')', expecting '!'

For the execution:
TIME=00:00:10:000
SIMU_ARGS="$SIMU_ARGS -t$TIME"

undefBugTest.ma.txt

@lukius lukius added the bug Something isn't working label Jun 5, 2020
@lukius
Copy link
Collaborator

lukius commented Jun 5, 2020

Bug can be reproduced in latest release using this sample model.

Suggested workaround: until this is addressed, please use the alternative syntax as shown in the model (i.e., (0,0)~value = ? instead of isUndefined((0,0)~value))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants