godot
godot copied to clipboard
GDScript parser bug: Trying to advance past the end of stream
Godot version
Since Godot Engine v4.0.alpha12.official (Originally reported in Godot Engine v4.0.alpha13.official)
System information
Windows 10, 64-bit
Issue description
During parsing/autocomplete of the function name when typing func ..., the GDScript parser logs the following line:
GDScript parser bug: Trying to advance past the end of stream.
This line is logged once every time 300ms passes between consecutive characters typed while writing the function name in func ... at the end of the script. It is also logged when saving the script
This line is logged here: https://github.com/godotengine/godot/blob/44d3c8402ebc0d1e77936dbf909a1ddcb48ab193/modules/gdscript/gdscript_parser.cpp#L407
Steps to reproduce
Create a new script and write the following code, making sure to type the last line slowly (pace one letter every ≈500ms):
extends Node
func abcdefg
Then, save the script and notice additional lines of GDScript parser bug: Trying to advance past the end of stream. in the log.
Alternatively, open the attached project below, during which the parser reports additional errors like above.
Minimal reproduction project
Can you reproduce this in earlier 4.0 alphas?
Bisecting through the alpha releases:
- Godot 4.0 alpha 10 does not have this issue.
- Godot 4.0 alpha 11 does not have this issue.
- Godot 4.0 alpha 12 does have this issue.
Therefore, one of the (most likely GDScript related) changes between alpha 11 and alpha 12 is causing this issue.
Still happening on Godot 4.0 beta 2. Same reproduction steps.
Using git bisect, I was able to narrow introduction of this issue to 4f36b2df2ac1104243652d9d1d3f66a5cfc53d27 (https://github.com/godotengine/godot/pull/62900).
still seeing this error Godot 4.0 beta 8
this is still in Godot 4.0 beta 10
and i get those weird icons while reproducing
Still there in 4.0 beta 12.
In 4.0 beta 14 as well.
Still valid in v4.0.rc5.official [6296b4600]
Sill happening in 4.0 stable :

The error went away after I switched to another script and made some changes and came back to the original script. I'm also in the 4.0 stable build.