Tilde Key in Vex comments creates error. i.e. ~ten

   2741   2   0
User Avatar
Member
17 posts
Joined: May 2017
Offline
This took quit a bit of time to debug, There was nothing when searched tilde in the docs. Are there other characters like the ~ key that do not respect comments? Is this a bug or a feature?

Errors:
/*
~ten
*/

// ~ten

Not Error:
/~ten

… if you put a slash in front of it /~ten no error so its some sort of escape character???

* Note that the above looks like it has been commented out in the Vex editor window.

Here is an example of the error, note that the error does not report the line number correctly. Again making it hard to debug… wrong line… and two commenting out chunks of code does not help.
————
Error: Invalid source /obj/geo1/RebuildCorners/attribvop1
Error: Error in VOP ‘snippet1’.
Warning: Errors or warnings encountered during VEX compile:
/obj/geo1/RebuildCorners/attribvop1/snippet1: Syntax error, unexpected end of file. (169,15).
Error: Error in VOP ‘snippet1’.
Warning: Errors or warnings encountered during VEX compile:
/obj/geo1/RebuildCorners/attribvop1/snippet1: Syntax error, unexpected end of file. (169,15).
Error: Vex error: /obj/geo1/RebuildCorners/attribvop1/snippet1: Syntax error, unexpected end of file. (169,15)
Failed to resolve VEX code opobj/geo1/RebuildCorners/attribvop1
Unable to load shader ‘opobj/geo1/RebuildCorners/attribvop1’.
————
Windows, Houdini 16.5.323
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
At first I thought there might be something off with your file itself because I don't get any errors when I do either of the following in a wrangle:

// ~ten

or

/*
~ten
*/

even both in the same wrangle doesn't give errors:

// ~ten

/*
~ten
*/

but if I take away the space between the first tilde and the forward slashes I do get an error:

//~ten

/*
~ten
*/

Seems like the compiler may be a bit flakey in this regards, as I tried different combninations of spaces and no spaces - sometimes giving errors sometimes not.

As far as I know the tilde is used to get ones compliment.

Interesting that the tilde key and the backtick both share the same keyboard key. And since the backtick can be used in vex to access Hscript expressions;

Maybe the compiler in some cases is reading the tilde as a backtick which is creating problems?
Edited by BabaJ - April 27, 2018 16:33:20
User Avatar
Member
17 posts
Joined: May 2017
Offline
Weird, and feels like a bug.
  • Quick Links