Skip to content

Inconsistent array casting #854

Description

@Announcement

Short arrays aren't enough to loop

[to 10] does what expected and so does [.. for [0 to 10]]

But in contrast...

[.. for [to 10]] throws

Parse error on line 1: Unexpected 'FROM'

Activity

  1. summivox commented on Mar 21, 2016

    @summivox
    Contributor

    Just FYI: [.. for to 10] now works thanks to #859

  2. rhendric commented on Mar 21, 2016

    @rhendric
    Collaborator

    [.. for to 10] works, but [.. for [to 10]] still doesn't; shouldn't this remain open?

  3. summivox commented on Mar 22, 2016

    @summivox
    Contributor

    Lexer black magic rewrite is to blame. Specifically, lexer.ls:868 skipped a square bracket (oops!) before any "official" rewrite takes place (oops again!).

    IMHO this kind of thing belong to the parser. However a refactor would be non-trivial and requires attention from @vendethiel .

    I also agree that this should remain open as it is certainly a bug.

  4. summivox commented on Mar 22, 2016

    @summivox
    Contributor

    I am going to patch this temporarily with a grammar fix.

  5. added a commit that references this issue on Mar 22, 2016
    4eb140e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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