-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
755 additions
and
283 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import SwiftSyntax | ||
import SwiftSyntaxBuilder | ||
import SwiftSyntaxMacros | ||
|
||
public struct DatabaseIndexMacro: Macro { | ||
|
||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import SwiftSyntax | ||
import SwiftSyntaxBuilder | ||
import SwiftSyntaxMacros | ||
|
||
public struct TableMacro: Macro { | ||
|
||
} | ||
|
||
extension TableMacro: PeerMacro { | ||
public static func expansion(of node: SwiftSyntax.AttributeSyntax, providingPeersOf declaration: some SwiftSyntax.DeclSyntaxProtocol, in context: some SwiftSyntaxMacros.MacroExpansionContext) throws -> [SwiftSyntax.DeclSyntax] { | ||
return [] | ||
} | ||
|
||
} | ||
|
||
extension TableMacro: AccessorMacro { | ||
public static func expansion( | ||
of node: SwiftSyntax.AttributeSyntax, | ||
providingAccessorsOf declaration: some SwiftSyntax.DeclSyntaxProtocol, | ||
in context: some SwiftSyntaxMacros.MacroExpansionContext | ||
) throws -> [SwiftSyntax.AccessorDeclSyntax] { | ||
|
||
func identifier(from node: VariableDeclSyntax) -> TokenSyntax { | ||
node.bindings.first!.cast(PatternBindingSyntax.self).pattern.cast(IdentifierPatternSyntax.self).identifier | ||
} | ||
|
||
let id = identifier(from: declaration.cast(VariableDeclSyntax.self)) | ||
|
||
return [ | ||
// """ | ||
// get { | ||
// _$\(id) | ||
// } | ||
// """, | ||
// """ | ||
// set { | ||
// _$\(id) = newValue | ||
// } | ||
// """ , | ||
] | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
import HashTreeCollections | ||
|
||
public enum Indexes { | ||
|
||
/// A Indexing store | ||
/// | ||
/// { | ||
/// Grouping-ID : [ | ||
/// - Grouped-ID | ||
/// - Grouped-ID | ||
/// - Grouped-ID | ||
/// ], | ||
/// Grouping-ID : [ | ||
/// - Grouped-ID | ||
/// - Grouped-ID | ||
/// - Grouped-ID | ||
/// ] | ||
/// } | ||
/// | ||
// public typealias GroupByEntity = Never | ||
|
||
// public typealias GroupByKey = Never | ||
|
||
/** | ||
Mapping another key to the entity id. | ||
``` | ||
[ | ||
Key: EntityID | ||
Key: EntityID | ||
Key: EntityID | ||
] | ||
``` | ||
*/ | ||
public typealias Hash<Key: Hashable, Entity: EntityType> = HashTreeCollections.TreeDictionary<Key, Entity.EntityID> | ||
|
||
public typealias Ordered<Entity: EntityType> = Array<Entity.EntityID> | ||
|
||
public typealias Set = Never | ||
|
||
} |
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
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
Oops, something went wrong.