1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 05:41:54 +03:00
Commit Graph

855 Commits

Author SHA1 Message Date
Rob Rix
22fa931d4d Use Term.Roll. 2015-09-23 12:31:28 -04:00
Rob Rix
04550ca9bd Remove SwiftAST. 2015-09-23 11:35:38 -04:00
Rob Rix
00ff3c2447 We no longer need to namespace these. 2015-09-23 11:34:35 -04:00
Rob Rix
6571de8514 Remove Prism. 2015-09-23 11:34:00 -04:00
Rob Rix
9fdd9f1109 Remove Array/DictionaryConvertible. 2015-09-23 11:33:55 -04:00
Rob Rix
68965379f7 Remove the JSON Prisms. 2015-09-23 11:33:34 -04:00
Rob Rix
7ef8a3f8c0 Clean up. 2015-09-22 17:41:02 -04:00
Rob Rix
f61b025c80 Unpack methods/functions differently from classes/extensions. 2015-09-22 17:40:23 -04:00
Rob Rix
0b6f81f8b7 Don’t test the prism. 2015-09-22 17:39:55 -04:00
Rob Rix
0c5c3910f6 Print the bodies of abstractions. 2015-09-22 17:35:41 -04:00
Rob Rix
8b6e1c1c08 Fix an infinite loop in Doc construction.
I don’t know how this managed never to be tested.
2015-09-22 17:33:56 -04:00
Rob Rix
5b1f35d7ff Term constructors. 2015-09-22 17:26:45 -04:00
Rob Rix
a6473b9eff Abstractions can have >1 elements in their body. 2015-09-22 17:23:48 -04:00
Rob Rix
0c4e9a0b58 Construct a Term from the JSON. 2015-09-22 17:18:22 -04:00
Rob Rix
b7647a46ed Use the temporary. 2015-09-22 17:17:58 -04:00
Rob Rix
9612325ea8 Add an extension to Term constructing it from JSON. 2015-09-22 17:16:58 -04:00
Rob Rix
401d0b4194 Capture the dictionary in a temporary. 2015-09-22 17:16:38 -04:00
Rob Rix
4a51b786d3 Capture the path in a temporary. 2015-09-22 17:16:25 -04:00
Rob Rix
b1c8394a8f Convenience constructor for JSON from AnyObject. 2015-09-22 17:15:55 -04:00
Rob Rix
aa82ed1a2b Remove Swift AST parsing. 2015-09-21 17:35:38 -04:00
Rob Rix
e54bc56d13 Extract document structure with SourceKitten. 2015-09-21 17:32:41 -04:00
Rob Rix
1e9be8b9b0 Prism conjunction. 2015-09-21 17:23:29 -04:00
Rob Rix
1d0a54d62a Rename Swift to SwiftAST. 2015-09-21 17:01:00 -04:00
Rob Rix
514a863547 Add a mapping convenience for constructed Prisms. 2015-09-21 16:46:48 -04:00
Rob Rix
5daa7d4398 Don’t bother with Iso. 2015-09-21 16:46:32 -04:00
Rob Rix
13f1d70071 We really don’t need this old thing. 2015-09-21 16:45:52 -04:00
Rob Rix
83e3c8e232 Missed a rename. 2015-09-21 16:45:45 -04:00
Rob Rix
ddc020c774 Rename Array/DictionaryType to Array/DictionaryConvertible. 2015-09-21 16:44:24 -04:00
Rob Rix
07d01dc79a Move DictionaryType to its own file. 2015-09-21 16:43:22 -04:00
Rob Rix
56569eeb73 Move ArrayType to its own file. 2015-09-21 16:42:52 -04:00
Rob Rix
1ec7e5b06c Extension methods use the converter and wrap the static prisms. 2015-09-21 16:28:04 -04:00
Rob Rix
806ea1ea93 Add a JSONConverter property to JSONConvertibles. 2015-09-21 16:27:45 -04:00
Rob Rix
b5efc49129 Restore the static prisms. 2015-09-21 16:25:34 -04:00
Rob Rix
0ca911e603 JSON/Prism extensions are public. 2015-09-21 16:08:43 -04:00
Rob Rix
7e40055294 Add .map to Prisms taking an Iso. 2015-09-21 16:05:58 -04:00
Rob Rix
1f3d05ae23 Add Iso. 2015-09-21 16:05:29 -04:00
Rob Rix
3efd234eea Dictionary/array extensions are public. 2015-09-21 15:59:52 -04:00
Rob Rix
20a7520181 Move dictionary/array extensions into Prism. 2015-09-21 15:59:17 -04:00
Rob Rix
92482ddbab Replace (most of) the static Prisms with properties in a constrained extension on Prism. 2015-09-21 15:53:30 -04:00
Rob Rix
fda61501e1 Array Prism subscripting is safe. 2015-09-21 15:42:07 -04:00
Rob Rix
0eca419468 Subscripting Prism<T, [U]> by Int produces Prism<T, U>. 2015-09-21 15:41:01 -04:00
Rob Rix
4f97a6bc4a Subscripting Prism<T, [K:V]> by K returns Prism<T,V>. 2015-09-21 15:40:43 -04:00
Rob Rix
c03c01f726 Typealiases for array/dictionary types. 2015-09-21 15:29:27 -04:00
Rob Rix
a787679652 JSON is public. 2015-09-21 15:23:16 -04:00
Rob Rix
d82acf8b9f Add a public constructor. 2015-09-21 15:23:01 -04:00
Rob Rix
78ae28a1ae forward/backward are public. 2015-09-21 15:22:55 -04:00
Rob Rix
e989c8aac5 Prism & its concatenation are public. 2015-09-21 15:22:14 -04:00
Rob Rix
21e1b7e3e9 toJSON/toAnyObject are private. 2015-09-21 15:21:31 -04:00
Rob Rix
fb48f88575 Move the prisms into the JSON namespace. 2015-09-21 15:21:09 -04:00
Rob Rix
700a7004c4 Add a representation of JSON & prisms for encoding/casting. 2015-09-21 15:20:33 -04:00
Rob Rix
8625c90aaa Add Prisms. 2015-09-21 15:19:49 -04:00
Rob Rix
3ff518ac46 Add a dictionary constructor over key/value pairs. 2015-09-21 15:19:42 -04:00
Rob Rix
c1f9dd3dd7 Xcode loves breaking search paths. 2015-09-21 11:17:19 -04:00
Rob Rix
de2c7f5169 Add & link SourceKitten & dependencies. 2015-09-21 11:14:31 -04:00
Rob Rix
ab4ec9e0aa Add a root parser taking multiple sexprs. 2015-09-18 16:36:14 -04:00
Rob Rix
ca5298da88 Test that empty branches can be produced. 2015-09-18 16:32:07 -04:00
Rob Rix
8b1afceaad Atoms are equatable. 2015-09-18 16:31:54 -04:00
Rob Rix
dfde9f26b9 Prioritize key/value pairs ahead of atoms. 2015-09-18 16:31:47 -04:00
Rob Rix
b71b40bf6f Atoms must be one or more character. 2015-09-18 16:31:25 -04:00
Rob Rix
654492158a Symbol nodes can be equated. 2015-09-18 16:31:05 -04:00
Rob Rix
04a207f71b Parse symbols. 2015-09-18 16:03:58 -04:00
Rob Rix
4b3ea05f8e This is just the worst test of alphabetic characters I can imagine. 2015-09-18 16:02:41 -04:00
Rob Rix
bcec39379d Allow atoms to occur in branches. 2015-09-18 15:58:01 -04:00
Rob Rix
b80e8cb527 Extract a parser for atoms. 2015-09-18 15:56:53 -04:00
Rob Rix
3b6838097f Test branch parsing. 2015-09-18 15:44:11 -04:00
Rob Rix
23f8a99867 S-expression parsing includes branches and key/value pairs. 2015-09-18 15:43:23 -04:00
Rob Rix
b5cdad9f32 Remove a bogus space. 2015-09-18 15:43:04 -04:00
Rob Rix
4f1181c51e Add a delay combinator. 2015-09-18 15:42:53 -04:00
Rob Rix
abb63b7c4d Words can contain _. 2015-09-18 15:38:05 -04:00
Rob Rix
a918261abc Use concat. 2015-09-18 15:37:53 -04:00
Rob Rix
08d07baef7 Allow values to be quoted or non-ws strings. 2015-09-18 15:08:37 -04:00
Rob Rix
73da6e2d32 No zero-width matches from not. 2015-09-18 15:08:24 -04:00
Rob Rix
c46c35157a Values can be quoted. 2015-09-18 15:04:04 -04:00
Rob Rix
fbcd667a4c Full parser. 2015-09-18 15:03:50 -04:00
Rob Rix
37612e763a Combinator which matches a character when its argument does not. 2015-09-18 15:03:42 -04:00
Rob Rix
0224ccc5c7 Move never in with the other parsers. 2015-09-18 13:53:12 -04:00
Rob Rix
56c139cd0b Test that the key value parser accepts alphabetic keys & values. 2015-09-18 13:46:52 -04:00
Rob Rix
c92dbc446b The Swift AST is Equatable. 2015-09-18 13:45:47 -04:00
Rob Rix
2edb3b60f1 Move all the parsers into Swift.Parsers. 2015-09-18 13:43:25 -04:00
Rob Rix
cce9fe71b8 Whitespace has some places it can be. 2015-09-18 13:43:08 -04:00
Rob Rix
8191905eaf Add a simple tree type representing Swift AST. 2015-09-18 13:39:28 -04:00
Rob Rix
079518a3f4 Add words. 2015-09-18 13:39:08 -04:00
Rob Rix
ec19009614 Move the S-expression parser into the library. 2015-09-18 11:24:05 -04:00
Rob Rix
8cdb91b5c4 Remove the lambda calculus parser. 2015-09-18 11:23:47 -04:00
Rob Rix
29cc2ed663 Character class from sequences of characters. 2015-09-18 11:23:05 -04:00
Rob Rix
3317e8778b Doubt is testable. 2015-09-18 11:19:12 -04:00
Rob Rix
5c7132a3bd Rename Fix to Term. 2015-09-18 10:12:34 -04:00
Rob Rix
70d55b81dd Full SES. 2015-09-17 15:57:04 -04:00
Rob Rix
318d8f2ea9 Test SES inserting/deleting in the middle. 2015-09-17 15:56:53 -04:00
Rob Rix
3885572e72 Test SES deleting at head. 2015-09-17 15:56:01 -04:00
Rob Rix
8c642c6f94 Test SES inserting at head. 2015-09-17 15:55:30 -04:00
Rob Rix
1fd445c1ef min-with-comparator. 2015-09-17 15:55:11 -04:00
Rob Rix
6e3d6a2209 Construct diffs from terms. 2015-09-17 15:55:01 -04:00
Rob Rix
8a4a205055 Recursive implementation. 2015-09-17 15:12:49 -04:00
Rob Rix
afab45e68a Stream is a monad. 2015-09-17 14:36:40 -04:00
Rob Rix
128361bbe8 Memo is a monad. 2015-09-17 14:36:34 -04:00
Rob Rix
afaa68b1e0 Add a concat overload over Memo<Stream>. 2015-09-17 14:34:39 -04:00
Rob Rix
25a88b3c69 const. 2015-09-17 14:34:26 -04:00
Rob Rix
3187d564e1 Abbreviate Stream.concat. 2015-09-17 14:30:49 -04:00
Rob Rix
e99c67ad42 Abbreviate Stream.map. 2015-09-17 14:30:41 -04:00
Rob Rix
e118119dd3 Align with the types. 2015-09-17 14:27:52 -04:00
Rob Rix
87e4d6ccfc map using analysis to work around a compiler crash. 2015-09-17 14:26:59 -04:00
Rob Rix
ab6cb6c67b Stream.rest does not force. 2015-09-17 14:26:25 -04:00
Rob Rix
d62d4a33bb Don’t switch in uncons. 2015-09-17 14:23:51 -04:00
Rob Rix
ad835e6c9a Add a case analysis method. 2015-09-17 14:23:33 -04:00
Rob Rix
a1136f8e58 rest forces. 2015-09-17 14:23:05 -04:00
Rob Rix
298c2accae uncons does not force the remainder of the stream. 2015-09-17 14:22:05 -04:00
Rob Rix
b3c0e92d2a Stream concatenation. 2015-09-17 14:14:01 -04:00
Rob Rix
587ffcbb24 Stream is NilLiteralConvertible. 2015-09-17 14:12:39 -04:00
Rob Rix
6e5c72098a Memo is a functor. 2015-09-17 14:10:51 -04:00
Rob Rix
538bbf0c27 Extra line. 2015-09-17 09:07:27 -04:00
Rob Rix
911501c337 Diff is Comparable. 2015-09-16 15:47:03 -04:00
Rob Rix
f9023f88b7 Equality of empty diffs. 2015-09-16 15:46:45 -04:00
Rob Rix
d0d53d152a Diff applications, abstractions, and groups as arrays. 2015-09-16 15:00:06 -04:00
Rob Rix
6a8915fc61 Approximate SES. 2015-09-16 14:58:53 -04:00
Rob Rix
d92afc817e Make Cons indirect to work around a runtime deadlock. 2015-09-16 14:56:34 -04:00
Rob Rix
8618d7bbca Insert/Delete convenience constructors. 2015-09-16 13:52:53 -04:00
Rob Rix
7e5100c813 Stream memoizes. 2015-09-16 13:44:02 -04:00
Rob Rix
71236c1b8d Remove the autoclosure constructor. 2015-09-16 13:43:57 -04:00
Rob Rix
590a290c0a Memo constructors. 2015-09-16 13:42:31 -04:00
Rob Rix
8c16f0321b Add a Memo type. 2015-09-16 12:59:57 -04:00
Rob Rix
3bade61660 Stream is a SequenceType. 2015-09-16 12:28:45 -04:00
Rob Rix
9c47dae557 Stream.map. 2015-09-16 12:27:23 -04:00
Rob Rix
0dfd3a5ecd Diffs have a magnitude. 2015-09-16 12:23:24 -04:00
Rob Rix
e823f84d4a Syntax folding. 2015-09-16 12:22:53 -04:00
Rob Rix
53ce3368cc Stream.isEmpty. 2015-09-16 11:56:06 -04:00
Rob Rix
fc7fa9db3b Construct Streams with sequences, generators, and sources. 2015-09-16 11:54:19 -04:00
Rob Rix
bec4764a39 Stream unconsing. 2015-09-16 11:44:56 -04:00
Rob Rix
4aa5a86143 Basic Stream abstraction. 2015-09-16 11:42:49 -04:00
Rob Rix
65d8b04eb9 (Failing) test of non-empty/empty SES. 2015-09-16 10:04:30 -04:00
Rob Rix
8a2ff37cb9 (Failing) test of empty/non-empty terms. 2015-09-16 10:02:20 -04:00
Rob Rix
6e5aacc988 SES is over [Fix], not [Diff]. 2015-09-16 09:59:13 -04:00
Rob Rix
1aed2f8949 Test that empty collections generate empty diffs. 2015-09-16 09:56:28 -04:00
Rob Rix
2fdff49711 Stub in SES. 2015-09-16 09:56:15 -04:00
Rob Rix
b0c396d734 Fix the copyright. 2015-09-15 15:23:07 -04:00
Rob Rix
440ccb9444 Leave Doc implicit wherever possible. 2015-09-15 14:33:09 -04:00
Rob Rix
8bf3464764 Test the production of copying diffs. 2015-09-15 14:29:54 -04:00
Rob Rix
02de7f075e Add the sexpr grammar to the tests. 2015-09-15 14:28:32 -04:00
Rob Rix
29dcc19069 Remove the broken playground. 2015-09-15 14:27:18 -04:00
Rob Rix
9654536de1 Whatever you say, Xcode. 2015-09-15 14:26:25 -04:00
Rob Rix
5f464f3e10 🔥 Tree. 2015-09-15 14:17:40 -04:00
Rob Rix
bf10dfca2d Diff.debugDescription gets the debug strings for its contents. 2015-09-15 14:09:45 -04:00
Rob Rix
d3b82148b8 Diff is CustomDebugStringConvertible. 2015-09-15 14:08:59 -04:00
Rob Rix
cae54e2c95 Fix can be empty. 2015-09-15 14:07:35 -04:00
Rob Rix
64c3a6074b Don’t specialize description. 2015-09-15 13:58:47 -04:00
Rob Rix
d76ec6a208 Move Tree up in the list. 2015-09-15 13:56:08 -04:00
Rob Rix
9b9daa910a Remove the heading. 2015-09-15 13:55:46 -04:00
Rob Rix
d5d63a892d Define Doc directly, not algebraically. 2015-09-15 13:55:09 -04:00
Rob Rix
41bba38001 Fix is an enum. 2015-09-15 13:49:23 -04:00
Rob Rix
6724c834e5 Remove FixpointType. 2015-09-15 13:46:45 -04:00
Rob Rix
d23d646f66 Tree is CustomStringConvertible. 2015-09-15 12:52:07 -04:00
Rob Rix
5f66984cec Tree is public. 2015-09-15 12:50:36 -04:00
Rob Rix
485565b4e4 Add a simple rose tree. 2015-09-15 12:49:39 -04:00
Rob Rix
871dc356dd Tweak some things to make Xcode happy. 2015-09-15 12:34:53 -04:00
Rob Rix
93fd2acc81 Add 'prototype/' from commit 'a7fef6ced9d2b71dfdf5e6d8fb765ab0c0bc6be5'
git-subtree-dir: prototype
git-subtree-mainline: 0244ce39f68a04b515f32b2b8ea9a3e0228923c7
git-subtree-split: a7fef6ced9
2015-09-15 12:32:12 -04:00