Giter VIP home page Giter VIP logo

Comments (6)

JBenda avatar JBenda commented on July 28, 2024 1

Heureka? It seems like it was a confusion between return and break in the step function. I will open the PR in the next days (just to verify that the change is right)

from inkcpp.

JBenda avatar JBenda commented on July 28, 2024

Good to know, thank you for providing a test case ^^ let take a look in these mysteries.

from inkcpp.

LilithSilver avatar LilithSilver commented on July 28, 2024

I found a related bug. It seems that the same issue appears with functions:

Function Line

~ funcTest()

-> DONE


=== function funcTest()
Function Result

This will output:

> Function Line\nFunction Result\n

Instead of:

> Function Line\n
> Function Result\n

I have attached a modified NewLines.cpp and LinesStory.ink for test purposes. I also added a tunnel test just in case, although tunnels seem to be working fine.

EDIT: tests.zip

Stepping through the code, I've identified that it's not a regression from #45; it was broken even when change_type::no_change was return false instead of break. However, I think the prior line as forget() is the issue. The function pointer is a no_change operation, but should still be restore()'d. The reason the function causes the failure is that value_type::func_start is a no-change operation that isn't a newline, so the code forgets the old save state, and then never even saves a new save-state in the following if-statement. Thus the next line is appended as usual, and restore() is called after that second line.

If I remove that forget() statement, all the tests pass, including my new ones; i.e. the save state properly restores to the correct location. Thus, the new lookahead determination code becomes:

bool runner_impl::line_step()
{
    ...
    case change_type::no_change:
	    break;
    ...
}

@JBenda does that seem correct? If so, let me know; I can create a PR for that change. That said, I might be totally off the mark; I'm still new to the codebase!

from inkcpp.

JBenda avatar JBenda commented on July 28, 2024

Thanks for the digging, it seems like a miss placement of some forget/save thing, but just removing the forged leads to wrong visit count from look aheads. So more likely something else in wrong, maybe we also need a new case? (don't think so currently)

Removing the forget at no_changes looks like a good starting point.

Look at #48 for an implemented version of your new test, feel free to also start your own PR based on this. The missing counting error was located when running ink-proof

from inkcpp.

JBenda avatar JBenda commented on July 28, 2024

#48 seemst to work now, the forget was missplaced

no_chache should not trigger a forget (as you descripetd)

but if we encounter a second newline (through tunnels or multiple glues) we need to move the save state with us to restore to the correct location, for that detecting a new line needs to forget the old save state and create a new one

from inkcpp.

LilithSilver avatar LilithSilver commented on July 28, 2024

Awesome, thankye.

from inkcpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.