Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#195 strikes again #200

Closed
vendethiel opened this issue Feb 3, 2013 · 6 comments
Closed

#195 strikes again #200

vendethiel opened this issue Feb 3, 2013 · 6 comments

Comments

@vendethiel
Copy link
Contributor

Got bitten by this just now ... It's basically the same as #195
Just this :
for get(a in b) then or for [get a in b] then
Of course implicit call isn't applicable here, but I thought we may count how deep we are in {} (I don't think we even need to differentiate between those) before checking inFor.

@satyr
Copy link
Owner

satyr commented Feb 4, 2013

This has always been the case (just wasn't practical before quick map). You can't use binary in/of right after for.

I thought we may count how deep we are in {} (I don't think we even need to differentiate between those) before checking inFor.

We'd need separate flags for each nesting level to handle this.

@vendethiel
Copy link
Contributor Author

May I ask why? I thought this would not be the case as they need to be balanced anyway.

@satyr
Copy link
Owner

satyr commented Feb 4, 2013

Because they can nest, e.g.:

for (
  for a in b => c
).p of xs => ...

@vendethiel
Copy link
Contributor Author

Ah, right. No idea how to (cleanly) handle that (does not look like it's working currently tbh, havn't tested master yet). I was talking about depth of ()[]{} but that's definitely a failing case here :(. Except with an array which counts balance count, no idea (like =>) but that seems horrible for such an edge case.

case \for
  this@@inFor.push 0
  #...
case \(
  if @inFor
    that[*-1]++
  #...
case \)
  if @inFor
    that[*-1]--
  #...
case \in
  if @inFor
    if that[*-1] #we're in ()[]{}
      tag = \RELATION
    else
      tag = \IN
      that.pop!
  #...
### probably doesn't handle `in`/`of` in bodies. 

@satyr satyr closed this as completed in 0fd717f Mar 2, 2013
@goto-bus-stop
Copy link

Thanks a lot :)

@vendethiel
Copy link
Contributor Author

gorgeous

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants