Git Product home page Git Product logo

Comments (6)

velipso avatar velipso commented on July 20, 2024

More than just that... any of these partial labels can be left dangling around:

def test
    goto foo
end
test
def test
    declare test2
    test2
end
test
do
    declare test
    test
end

etc

from sink.

velipso avatar velipso commented on July 20, 2024

This is exposing some more weird behavior:

for: range 2
    test:
    say 'hi'
end
goto test

Technically valid, but feels like it shouldn't be. It jumps back into the loop, then falls out because the hidden variable is over the range. What happens if this hidden variable is reassigned?

from sink.

velipso avatar velipso commented on July 20, 2024

And we also have this beauty:

for: range 2
    goto skip
    var a
    skip:
    say a
    a = 1
end

outputs:

nil
1

from sink.

velipso avatar velipso commented on July 20, 2024

And this

goto into
for: range 5
    into:
    say 1
end

from sink.

velipso avatar velipso commented on July 20, 2024

Okay, so rewinding this discussion a bit...

I'm talking about two broad issues:

  1. Incomplete labels can currently exist, and cause weird issues -- this needs to be fixed
  2. Goto over variable boundaries can happen -- this I'm just accepting as an acceptable cost for using goto in the first place, user beware

from sink.

velipso avatar velipso commented on July 20, 2024

b3c2d26 fixes

from sink.

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.