- Proposal: SE-NNNN
- Author: Harlan Haskins
- Review Manager: TBD
- Status: Awaiting Review
- Decision Notes: Rationale
- Pull Request: apple/swift-package-manager#257
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if os(macOS) | |
import Darwin | |
#elseif os(Linux) | |
import Glibc | |
#endif | |
// MARK: Tokens | |
enum BinaryOperator: Character { | |
case plus = "+" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if os(macOS) | |
import Darwin | |
#elseif os(Linux) | |
import Glibc | |
#endif | |
enum BinaryOperator: Character { | |
case plus = "+" | |
case minus = "-" | |
case times = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreign type String { | |
foreign init(_: *Int8) -> String | |
foreign var length: Int | |
foreign func charCodeAt(_: Int) -> Int8 | |
foreign static func fromCharCode(_: Int8) -> String | |
} | |
type Op { | |
let opcode: Int8 | |
var operand: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreign type Array { | |
foreign init() -> Array | |
foreign func push(_: Any) | |
foreign subscript(_: Int) -> Any | |
foreign var length: Int | |
} | |
foreign type Math { | |
foreign static func random() -> Double | |
foreign static func floor(_: Double) -> Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(source_file | |
(import_decl 'Foundation') | |
(top_level_code_decl | |
(brace_stmt | |
(pattern_binding_decl | |
(pattern_named type='CGPoint' 'a') | |
(call_expr type='CGPoint' location=point.swift:2:9 range=[point.swift:2:9 - line:2:38] nothrow arg_labels=x:y: | |
(constructor_ref_call_expr type='(Int, Int) -> CGPoint' location=point.swift:2:9 range=[point.swift:2:9 - line:2:9] nothrow | |
(declref_expr implicit type='(CGPoint.Type) -> (Int, Int) -> CGPoint' location=point.swift:2:9 range=[point.swift:2:9 - line:2:9] decl=CoreGraphics.(file).CGPoint.init(x:y:) function_ref=single specialized=no) | |
(type_expr type='CGPoint.Type' location=point.swift:2:9 range=[point.swift:2:9 - line:2:9] typerepr='CGPoint')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ModuleID = '-' | |
source_filename = "-" | |
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-apple-macosx10.9" | |
define hidden void @_TFV4test3Foo8printBarfT_T_(i64) #0 { | |
entry: | |
%1 = call %swift.type* @_TMaP_() #6 | |
%2 = call { %swift.bridge*, i8* } @_TFs27_allocateUninitializedArrayurFBwTGSax_Bp_(i64 1, %swift.type* %1) | |
%3 = extractvalue { %swift.bridge*, i8* } %2, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
enum Relation<T> where T: Strideable { | |
case equal(T) | |
case greater(T) | |
case greaterOrEqual(T) | |
case less(T) | |
case lessOrEqual(T) | |
case between(T, T) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct StackFrame { | |
let symbol: String | |
let file: String | |
let address: UInt64 | |
let symbolAddress: UInt64 | |
var demangledSymbol: String { | |
return _stdlib_demangleName(symbol) | |
} | |
} |
- Proposal: SE-NNNN
- Authors: Harlan Haskins, Julio Carrettoni, Robert Widmann
- Review Manager: TBD
- Status: Awaiting review