John Sundell
ddd2bf9020
Don’t treat keywords used as function names as keywords
...
Swift enables the use of keywords as function names, and we want those
to be treated as plain text (like other function names) rather than as
keywords. Some keywords require escaping using back-ticks, and this
patch accounts for both of those variations.
2019-03-08 17:55:44 +01:00
John Sundell
87437d7425
Don’t treat .init() as an enum
...
This change adds a special condition not to treat `.init()` as an enum
(or any other kind of dot access), just like we previously had for `self`.
2019-03-08 17:26:10 +01:00
John Sundell
5d075f7168
Add support for indirect enums
...
This patch makes Splash correctly highlight `indirect` enums. The keyword
was missing from the grammar definition.
2019-03-06 10:40:03 +01:00
John Sundell
4c6f71c0de
Support custom token types
...
This change makes it possible to implement custom token types, which is
really useful when building specialized grammars that use non-standard
token types.
2018-09-28 14:02:42 +02:00
John Sundell
30b9300441
StatementTests: Nitpicky code style fixes
2018-09-06 08:41:50 +02:00
John Sundell
2a049c2031
Merge branch 'master' into patch-1
2018-09-05 23:32:15 +02:00
Marco Capano
2af2ec9d57
Fixing tests
...
This fixes a missing .whitespace in testForStatementWithContinue and handles indentation in testRepeatWhileStatement
2018-09-05 19:11:16 +02:00
Marco Capano
b8bc4ff2c3
Updating allTests static var
2018-09-05 18:45:53 +02:00
Marco Capano
3c638adcf5
Adding tests for repeat, while, continue and Fallthrough
2018-09-05 18:43:22 +02:00
Luffy
7a2f284e5d
missed a component in the test declaration
2018-09-05 07:20:35 +05:30
Nikhil Muskur
70f49996fc
added the test case in allTests array
2018-09-05 07:06:01 +05:30
Nikhil Muskur
ea71fd7191
test added for the "inout" keyword
2018-09-05 06:58:51 +05:30
John Sundell
187effae29
DeclarationTests: Nitpicky code style fixes
2018-08-28 13:23:04 +02:00
wangchi
c1465b0a65
added “defer” as a keyword
2018-08-28 16:06:43 +08:00
John Sundell
ac9b512013
Don’t highlight keywords when used as a parameter label
...
Most keywords can be used as parameter labels, such as “for” or “in”, but
they shouldn’t be highlighted in that context.
2018-08-27 19:01:57 +02:00
John Sundell
dc83f92228
Highlight ‘self’ as keyword when used to refer to a type
...
This patch fixes syntax highlighting when using `.self` to refer to a type.
2018-08-27 18:44:07 +02:00
John Sundell
1faa928214
Correctly highlight subscript declarations
...
This patch fixes syntax highlighting when declaring
a subscript:
```
struct MyStruct {
subscript(key: Key) -> Value? {
…
}
}
```
2018-08-27 18:32:22 +02:00
John Sundell
a86694802e
Highlight enums used as subscripting keys
...
This patch fixes highlighting when an enum is used as a dictionary key, like this:
```
let value = dictionary[.key]
```
2018-08-27 18:14:17 +02:00
John Sundell
c73767a0bc
HTMLOutputFormat: Escape < and > characters
...
This patch makes `HTMLOutputFormat` correctly escape all < and > characters
that occur in source code. Otherwise, a web browser rendering the resulting
HTML will interpret those characters as tags.
2018-08-27 00:14:48 +02:00
John Sundell
be35cef1ea
Correctly handle static methods called on a generic type
...
This patch fixes syntax highlighting for the following scenario:
```
Type<GenericType>.call()
```
Highlighting generic types is especially tricky, since we want them to
be highlighted when appearing at the call site, like above - but we don’t
want to highlight them when they are being declared. Hopefully with this
fix all/most edge cases are covered.
2018-08-27 00:10:08 +02:00
John Sundell
896a56b682
Correctly highlight properties after function calls
...
This patch fixes highlighting in the following scenarios:
```
call().property
call(argument).property
```
2018-08-25 12:56:34 +02:00
John Sundell
8645db8de0
Initial commit
2018-08-24 18:42:07 +02:00