Skip to content

Indentation parse issue #3117

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

Closed
calebegg opened this issue Aug 8, 2013 · 3 comments
Closed

Indentation parse issue #3117

calebegg opened this issue Aug 8, 2013 · 3 comments

Comments

@calebegg
Copy link

calebegg commented Aug 8, 2013

Sometimes, it's useful to split up arrays over multiple lines. I ran into a disappointing parse with this. Here's my best attempt at an SSCCE:

Breaks:

a = ->
    foo = [
           3
          ]
    bar = baz

Works (but not my preference):

a = ->
    foo = [
           3
           ]
    bar = baz

Also Works (really really weird, all I did is dedent the body by two spaces):

a = ->
  foo = [
         3
        ]
  bar = baz

The first one puts the last line (bar = baz) outside the function, which is baffling because it's at the same indent level as the previous start of a line. The others do not.

If I leave out the first line, the bar = baz line just vanishes from the compiled output completely. This is especially bad.

@vendethiel
Copy link
Collaborator

See all the others tickets about whitespace sensitivity being too forgiving.

@calebegg
Copy link
Author

calebegg commented Aug 8, 2013

Could you point me to a specific one? I tried to search, but didn't find anything about coffeescript totally ignoring entire lines/blocks of code because of indentation. Also, this hardly seems like it's "too forgiving".

@vendethiel
Copy link
Collaborator

#1018 and (mostly) #1275 (sorry for not linking earlier, I'm on my phone)

Also, "too forgiving" because the rest of the output just vanishes.

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

No branches or pull requests

2 participants