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

All Scripts Produce Error When Encountering $/ in Scripts #312

Closed
ghost opened this issue Jul 6, 2024 · 4 comments
Closed

All Scripts Produce Error When Encountering $/ in Scripts #312

ghost opened this issue Jul 6, 2024 · 4 comments
Labels
bug Something isn't working formatter parser

Comments

@ghost
Copy link

ghost commented Jul 6, 2024

When checking my scripts, I get a lot of these errors:

my_script.gd:

	player.reparent($/root/Level)
                         ^

Unexpected token Token('SLASH', '/') at line 13, column 19.
Expected one of: 
	* NAME
	* LONG_STRING
	* PERCENT
	* REGULAR_STRING
Previous tokens: [Token('DOLLAR', '$')]

I normally use this method similar to the one shown on the second line when I need to grab a node and want to find it from the root of the SceneTree, as detailed here except by using the $ shorthand instead of the get_node() method.

I was able to avoid triggering the error by putting the path in quotes after the dollar sign. i.e.: player.reparent($"/root/Level") I've never had any problems in game with not using quote marks in these kinds of paths although I have no idea if it's best practice. Either way the big error message seems unintentional but I apologise if I'm wrong.

@Scony
Copy link
Owner

Scony commented Jul 8, 2024

what version of gdtoolkit do you use?

@Scony Scony added the discussion Let's discuss label Jul 8, 2024
@ghost
Copy link
Author

ghost commented Jul 8, 2024

according to pip list it's version 4.2.2. I downloaded it the same day I posted the issue.

@Scony
Copy link
Owner

Scony commented Jul 8, 2024

according to pip list it's version 4.2.2. I downloaded it the same day I posted the issue.

Thanks, then it must be a bug.

@Scony Scony added bug Something isn't working formatter parser and removed discussion Let's discuss labels Jul 8, 2024
@Scony
Copy link
Owner

Scony commented Aug 29, 2024

I've confirmed it's a bug in gdtoolkit - I had no idea $/root/Level syntax is legal and therefore it was never implemented.

@Scony Scony closed this as completed in 236a9a8 Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter parser
Projects
None yet
Development

No branches or pull requests

1 participant