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

Whitespace in type annotation should be ignored #54

Closed
Tetralux opened this issue Dec 28, 2015 · 5 comments
Closed

Whitespace in type annotation should be ignored #54

Tetralux opened this issue Dec 28, 2015 · 5 comments

Comments

@Tetralux
Copy link
Contributor

The following two snippets should be interpreted identically.

x::UInt8
x   ::   UInt8

When you have a function or type constructor which takes lots of arguments, such that you break them up into multiple lines, it is nice to be able to align them. :)

function doit(
        firstarg :: Int
        second   :: UInt
        third    :: Bool
        forth    :: AbstractArray)

   # function body
end

Or, if they are kwargs...

function doit(;
        firstarg ::           Int = -45
        second   ::          UInt = 247
        third    ::          Bool = true
        forth    :: AbstractArray = [])

   # function body
end
@StefanKarpinski
Copy link

Do you have an example of a case where these do not parse the same?

@Tetralux
Copy link
Contributor Author

@StefanKarpinski
Here is an example of what I found it by; though other highlightings exhibit the same trait.

screenshot 2015-12-28 18 45 30

@StefanKarpinski
Copy link

Sorry, I thought this was an issue on https://github.com/JuliaLang/julia and was confused. Carry on.

@Tetralux
Copy link
Contributor Author

@StefanKarpinski I did wonder. 😄

@sglyon
Copy link
Contributor

sglyon commented Dec 28, 2015

I think this is a good idea (the goal should always be to match the actual Julia parser), but don't have time to make the changes myself.

I'd be happy to review a PR though... 😉

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