-
-
Notifications
You must be signed in to change notification settings - Fork 20
Forward references aren't validated #84
Copy link
Copy link
Open
Labels
C-diagnosticsWarnings and errors reported by PomskyWarnings and errors reported by PomskyC-languageIssues regarding Pomsky's syntaxIssues regarding Pomsky's syntaxbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Activity
Metadata
Metadata
Assignees
Labels
C-diagnosticsWarnings and errors reported by PomskyWarnings and errors reported by PomskyC-languageIssues regarding Pomsky's syntaxIssues regarding Pomsky's syntaxbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Forward references can only appear within a repeated group that also contains the group the reference refers to. For example:
This is ok because both the reference
::thirdand the referenced group:third()are within thefirstgroup, which is repeated.Describe the bug
Pomsky does not check that forward references fulfill the above criteria. Ruby allows forward references, but fails to compile when they're invalid, so this should be validated by Pomsky as well.
To Reproduce
Compile one of these with Pomsky using the
Rubyflavor:then try to compile the result with Ruby.
Expected behavior
Since Ruby doesn't accept invalid forward references, Pomsky shouldn't either.