Skip to content

System.InvalidOperationException : Operation is not valid due to the current state of the object. #17

Description

@dreed-sd

A string format % on a continuation line causes System.InvalidOperationException : Operation is not valid due to the current state of the object.

Minimal GDScript to reproduce:

class_name T
extends RefCounted

func foo() -> void:
    print("hello %s %s"
            % ["world", "!"])

Stack trace:

         at GDShrapt.Reader.GDExpression.SwapRight(GDExpression expression)
         at GDShrapt.Reader.GDIndexerExpression.PriorityRebuildingPass()
         at GDShrapt.Reader.GDExpression.RebuildRootOfPriorityIfNeeded()
         at GDShrapt.Reader.GDExpressionResolver.CompleteExpression(GDReadingState state)
         at GDShrapt.Reader.GDExpressionResolver.HandleChar(Char c, GDReadingState state)
         at GDShrapt.Reader.GDReadingState.PassChar(Char c)
         at GDShrapt.Reader.GDReadingState.PopAndPass(Char c)
         at GDShrapt.Reader.GDIndexerExpression.HandleChar(Char c, GDReadingState state)
         at GDShrapt.Reader.GDReadingState.PassChar(Char c)
         at GDShrapt.Reader.GDResolvingHelper.ResolveSquareCloseBracket(ITokenOrSkipReceiver`1 receiver, Char c, GDReadingState state)
         at GDShrapt.Reader.GDIndexerExpression.HandleChar(Char c, GDReadingState state)
         at GDShrapt.Reader.GDReadingState.PassChar(Char c)
         at GDShrapt.Reader.GDExpressionResolver.HandleChar(Char c, GDReadingState state)
         at GDShrapt.Reader.GDReadingState.PassChar(Char c)
         at GDShrapt.Reader.GDReadingState.PopAndPass(Char c)
         at GDShrapt.Reader.GDStringExpression.HandleChar(Char c, GDReadingState state)
         at GDShrapt.Reader.GDReadingState.PassChar(Char c)
         at GDShrapt.Reader.GDReadingState.PopAndPass(Char c)
         at GDShrapt.Reader.GDDoubleQuotasStringNode.HandleChar(Char c, GDReadingState state)
         at GDShrapt.Reader.GDReadingState.PassChar(Char c)
         at GDShrapt.Reader.GDScriptReader.ParseBuffer(Char[] buffer, Int32 count, GDReadingState state)
         at GDShrapt.Reader.GDScriptReader.ParseFileContent(String content)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions