This commit separates `as` and `is` into their own keyword syntax,
and contains them in a new syntax region for type casts.
Also removes an extraneous `swiftGenericsWrapper` in the `swiftType`
syntax match.
Fixes#48
This is part of the language and previously broken syntax highlighting
broken everything below it as well. Now the highlighting is fixed as
well. It was fallout from changing the type wrapper to contain ALL.
This can't possibly be true. But right now somethings haven't been
highlighted correctly because the wrapper types have been blocking them.
Now these are explicitly marked as containing ALL, which works in the
example.swift file. I'm sure we're going to have to back this off, and
we'll do that case by case.
This fixes a problem where comments at the end of a line could be
contained in the highlighting of the prefix. Now matches end 1 character
before their "actual" end
This fixes a bug where if you had a very long documentation comment, and
you launched vim and it resumed with only being able to see a portion of
that comment, the comment would not be highlighted correctly. By default
ruby syncs 500 lines so we could probably up this number if needed, but
this should be fine for now.
Closes#49
Previously in text such as `- parameter` the `-` was also highlighted.
This change introduces the highlight start operator to make it start
after that character, so now just `parameter` is highlighted.
Highlighting would break if a newline was placed before the "{". So,
change the highlighting regex to just keep matching until the new line.
References #57
This adds the availability arguments described in the "Attributes"
chapter of the "The Swift Programming Language" book. Also expand the
list of platform names based on the Swift book.
References #56
Conforming to Xcode, the syntax file now highlights platforms contained
within the `#available` condition.
It also now removes highlighting numbers and the "*" (i.e, symbol for
future platforms) that are contained within the `#available` condition
since they are not literal numbers or operator (thanks to @acclissold
for the idea)
Additionally, add tests to example.swift to demonstrate highlighting of
them.
References #56
Swift compiler currently allows multiple underscore in an underscore
padded number. For instance, 1___00 is a valid way to write 100 in
Swift.
Also add more underscore padded numbers in example.swift file for
testing purposes. Thanks to @aclissold for these.
References #55
"The Basics" chapter of the official "The Swift Programming Language"
book states that you can pad numbers with underscores to help
readability.
This commit also handles the case where underscore padded numbers can
also contain a period (i.e., underscore padded float/double)
Additionally, added some underscore padded numbers in example/swift.vim
for testing purposes.
Fixes#51
This updates the swift.vim syntax file with new keywords and attributes
that were introduced in Swift 2.0
Additional information about these new keyword and attributes may be
found in "The Swift Programming Language" (Swift 2 Prerelease) [1]
[1]: https://itunes.apple.com/us/book/id1002622538
I could get this to work. The failed use case is this:
baseURL = "http://www.oaklandpostonline.com/search/?q&tarticle&c[]blogs*"
The start pattern matches the `=` right after baseURL and ends on `[]`
in the URL. I couldn't get this to ignore the swiftString type or ignore
if there was a quote right after the URL. Mainly everything is horrible.
Closes#37
This fixes an issue where the beginning /* in a C-style block comment
was interpreted as an operator. I read somewhere in syntax.txt (I think)
that the order rules appear in the syntax definition file affects the
interpretation. This is one of those times. The comment block needs to
be after the operator definitions.
This should fix the issue where, if you start a string which a single
non-matched quote, the string and interpolated string isn't highlighted
until the quote was closed. This seems like a bad idea since strings
only function when they are on a single line and this example:
"foo
" bar
highlights like they can spread over multiple lines. Where `bar` is
highlighted like a keyword and not part of an unclosed string. This is
also how ruby.vim does this so I assume this is the way to do it.
This fixes#28