godot icon indicating copy to clipboard operation
godot copied to clipboard

GDScript parser bug: Trying to advance past the end of stream

Open James103 opened this issue 3 years ago • 12 comments

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

test.zip

James103 avatar Aug 05 '22 09:08 James103

Can you reproduce this in earlier 4.0 alphas?

Calinou avatar Aug 05 '22 09:08 Calinou

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.

James103 avatar Aug 05 '22 09:08 James103

Still happening on Godot 4.0 beta 2. Same reproduction steps.

CassianoBelniak avatar Oct 12 '22 22:10 CassianoBelniak

Using git bisect, I was able to narrow introduction of this issue to 4f36b2df2ac1104243652d9d1d3f66a5cfc53d27 (https://github.com/godotengine/godot/pull/62900).

CalebJohn avatar Nov 07 '22 18:11 CalebJohn

still seeing this error Godot 4.0 beta 8

ngotoandev avatar Dec 14 '22 18:12 ngotoandev

this is still in Godot 4.0 beta 10

MeBadDev avatar Jan 05 '23 12:01 MeBadDev

image and i get those weird icons while reproducing

MeBadDev avatar Jan 05 '23 12:01 MeBadDev

Still there in 4.0 beta 12.

laingawbl avatar Jan 22 '23 02:01 laingawbl

In 4.0 beta 14 as well.

titusio avatar Jan 23 '23 04:01 titusio

Still valid in v4.0.rc5.official [6296b4600]

AnidemDex avatar Feb 26 '23 14:02 AnidemDex

Sill happening in 4.0 stable : image

pacomesoual avatar Mar 07 '23 09:03 pacomesoual

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.

chandujr avatar Mar 07 '23 10:03 chandujr