mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Unlike other prefix operators, unary minus is folded into the NumberLiteralExpr in the parser. This commit recreates this effect in the lexer-based syntax map so that token ranges will include the leading minus. rdar://problem/20205885
52 lines
859 B
Swift
52 lines
859 B
Swift
// This is a comment.
|
|
// This is a comment that contradicts the previous comment.
|
|
|
|
class Foo {
|
|
var test : Int
|
|
var a, b : Int
|
|
}
|
|
|
|
#if CONF
|
|
var g : Int
|
|
#else
|
|
var g : Float
|
|
#endif
|
|
|
|
// Something. FIXME: Blah.
|
|
// Something http://www.apple.com something else
|
|
//http://www.apple.com
|
|
// http://www.apple.com
|
|
|
|
var str = "some string \(0)"
|
|
|
|
func <#test1#>() {}
|
|
|
|
/// Brief description.
|
|
///
|
|
/// Some words.
|
|
///
|
|
/// - Parameters:
|
|
/// - x: ...
|
|
/// - z
|
|
/// - Notafield: THISISNOTAFIELD
|
|
///
|
|
/// - parameter y: A number
|
|
/// - returns: `x + y`
|
|
func foo(x: Int, y: Int) -> Int { return x + y }
|
|
|
|
/**
|
|
- note: NOTENOTENOTE
|
|
- warning: WARNWARNWARN
|
|
- returns nothing
|
|
- RETURNS: Void
|
|
- requires: List items to be at the top level
|
|
*/
|
|
func bar() {}
|
|
|
|
// mailto:awesomeguy@apple.com
|
|
// radar:1234567
|
|
// mailto:thisisnotmail
|
|
// unknownprotocol://awesomeguy.com
|
|
|
|
_ = -123
|