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

Keywords as argnames in fun declarations #32

Open
paddor opened this issue Aug 14, 2016 · 0 comments
Open

Keywords as argnames in fun declarations #32

paddor opened this issue Aug 14, 2016 · 0 comments
Labels

Comments

@paddor
Copy link

paddor commented Aug 14, 2016

Crystal supports the use of keywords as arguments in method definitions (by using an external argument name) and also fun declarations (by just using it, using an external argument name results in compile-error).

Unfortunately, this makes the syntax highlighting trip. Here the issue with method definitions:

def foo(good : Bool, num : Int, alias s : String, property p : Symbol)
  puts "alias = #{s}"
  puts "num = #{num}"
  puts "property = #{p}"
end
foo good: true, num: 5, alias: "bla", property: :xyz

which looks like this on my machine:
screen shot 2016-08-14 at 02 19 37

And here the issue with fun declarations:

  fun zdir_resync(self : Void*, alias : LibC::Char*) : Void* # "LibC::Char*" has no color
  fun zframe_meta(self : Void*, property : LibC::Char*) : LibC::Char* # "property" wrongly has a color

Here's how it looks in my:
screen shot 2016-08-14 at 02 10 49

I just noticed these seem to be correctly recognized by Github's higlighting.

My vi -v says NVIM v0.1.5-719-gf1eb303.

@rhysd rhysd added the bug label May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants