1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00
Commit Graph

8359 Commits

Author SHA1 Message Date
Rob Rix
3646ab2b15 Renderers produce Output. 2017-07-28 11:23:55 -04:00
Rob Rix
5da9f90532 Define an Output instance for ByteString. 2017-07-28 11:21:21 -04:00
Timothy Clem
709c4c98fc Use unwords and fmap instead of foldr and <> 2017-07-28 08:12:28 -07:00
Rob Rix
ab2c1a7cd3 Define an Output typeclass. 2017-07-28 11:12:04 -04:00
Rob Rix
acb35a5869 Stub in a module for an output typeclass. 2017-07-28 11:11:30 -04:00
Timothy Clem
2de353451d Just use a let here 2017-07-28 08:08:30 -07:00
Timothy Clem
162f25de9b Clean up lambdas for displayException 2017-07-28 08:05:08 -07:00
Rob Rix
bc5a98766c Merge branch 'master' into distribute-alternation-through-binds-and-overlapping-committed-choices 2017-07-27 20:38:12 -04:00
Rob Rix
0978826498 🔥 C term assignment. 2017-07-27 17:14:40 -04:00
Rob Rix
e5eb9f7a5b 🔥 the C constructor in Language. 2017-07-27 17:14:23 -04:00
Timothy Clem
3ab53d77a8 Bit more cleanup 2017-07-27 13:38:30 -07:00
Timothy Clem
eb7f5277e0 Little bit of cleanup 2017-07-27 12:56:04 -07:00
Timothy Clem
11876f2dcd Write key/value logs and log timing 2017-07-27 11:21:59 -07:00
Timothy Clem
a00701f96f Basic ability to set exitStatus 2017-07-26 20:50:59 -07:00
Rob Rix
95becb09cb Short-circuit alternations of throws at left. 2017-07-26 19:17:44 -04:00
Rob Rix
3d773fbe7d Allow throw rules to participate in committed choices. 2017-07-26 19:16:47 -04:00
Rob Rix
3a8c6ed83f Allow catch rules to participate in committed choices. 2017-07-26 19:14:31 -04:00
Rob Rix
75fd8b86f8 Catch rules hold assignments. 2017-07-26 19:14:01 -04:00
Rob Rix
368aca225d Coalesce returns on the left into committed choices. 2017-07-26 19:09:31 -04:00
Rob Rix
86e7837e76 Give Choose rules a (left-biased) way to match at the end of input. 2017-07-26 19:07:06 -04:00
Rob Rix
8486057a6d Alternation distributes through binds over Source rules. 2017-07-26 18:45:00 -04:00
Rob Rix
76feae64d7 Alternation distributes through binds over Location rules. 2017-07-26 18:42:52 -04:00
Rob Rix
5886098f65 Tighten up the assignment into the IntMap. 2017-07-26 16:19:25 -04:00
Rob Rix
7cbb8ff498 Rename the parameters. 2017-07-26 12:47:10 -04:00
Rob Rix
682bb5540d Reindent the choices case. 2017-07-26 12:45:23 -04:00
Rob Rix
96ef8d00bc Distribute alternation through children rules. 2017-07-26 12:10:07 -04:00
Rob Rix
3cbedc59a2 Distribute alternation through overlapping choices. 2017-07-26 11:11:44 -04:00
Rob Rix
2d264d4d44 Explicitly use the union operator. 2017-07-26 11:02:29 -04:00
Timothy Clem
26f9b77e8e Merge branch 'master' into python-assignment-fixes 2017-07-24 10:45:05 -07:00
Timothy Clem
fbad9eb01b Alphabetize alternates 2017-07-24 10:44:50 -07:00
Rob Rix
62af1aef30 🔥 an obsolete documentation comment. 2017-07-24 13:20:57 -04:00
Rob Rix
2d606aa934 Merge branch 'master' into simpler-monolithic-syntax 2017-07-24 13:20:14 -04:00
Rob Rix
20cdc2d480 Merge branch 'master' into serialize-concurrent-logging 2017-07-24 12:45:48 -04:00
Rob Rix
5e469a398c 📝 why we capture toNode & source in the top-level definition, but assignment and state in a lambda. 2017-07-24 12:40:09 -04:00
Rob Rix
7a28acf858 Capture the assignment & state in a lambda. 2017-07-24 12:39:52 -04:00
Rob Rix
3ac3002273 Rewrite go in pointful style for better inlining behaviour. 2017-07-24 12:31:55 -04:00
Rob Rix
103c0b9d1d Backtrack with a lambda. 2017-07-24 12:30:36 -04:00
Rob Rix
b83366c2d1 Revert "Revert "Lift the operations in Files to MonadIO.""
This reverts commit 8adcb0fba5275ecde11781256b69b43f601f1037.
2017-07-23 16:17:39 -04:00
Rob Rix
0c9bc34a1c Revert "Lift the operations in Files to MonadIO."
This reverts commit 11915d97bf6083c8f4cffaa5cb18b3341e89de48.
2017-07-23 16:16:52 -04:00
Rob Rix
145a1ad155 Revert "Revert "Lift the operations in Files to MonadIO.""
This reverts commit 2d5468e38a3050327654bf5251c16fb68660917c.
2017-07-23 16:16:38 -04:00
Rob Rix
1f4ba7e09d Revert "Lift the operations in Files to MonadIO."
This reverts commit 11915d97bf6083c8f4cffaa5cb18b3341e89de48.
2017-07-23 16:15:01 -04:00
Rob Rix
f1295cfe0b 🔥 SplitSyntaxDiff. 2017-07-23 16:00:36 -04:00
Rob Rix
d09c1690d7 Remove the leaf type parameter from SplitSyntaxDiff. 2017-07-23 16:00:10 -04:00
Rob Rix
ba68f866fd Remove the leaf type parameter from SyntaxDiff. 2017-07-23 15:59:02 -04:00
Rob Rix
aa8ebfcd73 Remove the leaf type parameter from SyntaxTerm. 2017-07-23 15:56:08 -04:00
Rob Rix
0ba3264f32 Remove the leaf type parameter from Syntax. 2017-07-23 15:46:29 -04:00
Rob Rix
8c46ff8afb 🔥 Syntax record selectors. 2017-07-23 15:15:17 -04:00
Rob Rix
edcb55a686 Move the source adjacent to where it’s used. 2017-07-23 15:08:53 -04:00
Rob Rix
7902bf683d Pass blobs to parseToAST. 2017-07-23 15:06:21 -04:00
Rob Rix
ca68b834e1 Specify language lookup with a list. 2017-07-23 15:03:02 -04:00
Rob Rix
ec0c5420a3 Use the SyntaxTerm type synonym. 2017-07-23 15:00:46 -04:00
Rob Rix
cb90f2dd43 Don’t slice the Source down repeatedly.
Slicing Source is O(1).
2017-07-23 14:59:34 -04:00
Rob Rix
999d2d1efb Remove the Language from TreeSitterParsers. 2017-07-23 14:56:44 -04:00
Rob Rix
607e538588 Define a function selecting a Language for a Ptr TSLanguage. 2017-07-23 14:56:18 -04:00
Rob Rix
5b8015311f Show the language of sources with parse errors. 2017-07-23 14:44:12 -04:00
Rob Rix
86823f75ad Log a warning on parse error. 2017-07-23 14:42:51 -04:00
Rob Rix
8b3b6f36e2 Define a catamorphism determining whether a term contains parse errors. 2017-07-23 14:40:30 -04:00
Rob Rix
93f653b765 Bind the error fields. 2017-07-23 14:33:38 -04:00
Rob Rix
2fb501ab30 Bind the current time instead of using do notation. 2017-07-23 14:27:24 -04:00
Rob Rix
77e7ed0ba5 Spacing. 2017-07-23 14:24:05 -04:00
Rob Rix
b7e776ee90 Add the hours, minutes, & seconds to timestamps. 2017-07-23 14:21:20 -04:00
Rob Rix
bbb0c307e5 Add timestamps to logged messages. 2017-07-23 14:16:15 -04:00
Rob Rix
adc71548e5 Pass Messages to formatMessage. 2017-07-23 14:15:53 -04:00
Rob Rix
69b9b1d6be Pass Messages over the queue with the current time. 2017-07-23 14:12:13 -04:00
Rob Rix
29fd11f96f Define a Message datatype. 2017-07-23 14:11:48 -04:00
Rob Rix
6358896dc5 Pass the option to print source when formatting assignment errors. 2017-07-23 13:45:12 -04:00
Rob Rix
a2f1a0cfe0 Add an option & CLI flag for including source. 2017-07-23 13:44:18 -04:00
Rob Rix
7a36a428da Merge branch 'run-assignment-worker-wrapper' into serialize-concurrent-logging 2017-07-22 18:10:56 -04:00
Rob Rix
0678c2aeee Always return at least one zero-width match. 2017-07-22 18:06:32 -04:00
Rob Rix
519c43d39d Correct the indentation of the argument docs. 2017-07-22 17:47:18 -04:00
Rob Rix
e4397a57b3 Rename atNodeOrEnd to anywhere. 2017-07-22 17:34:13 -04:00
Rob Rix
4f5990d5ad Rename atEnd to reflect the fact that it might not be. 2017-07-22 17:33:47 -04:00
Rob Rix
3b95662be2 Guard the expected symbols by pattern matching. 2017-07-22 17:29:35 -04:00
Rob Rix
fa8d0e4db6 🔥 the inlining of run. 2017-07-22 17:28:09 -04:00
Rob Rix
0ffb818898 Don’t bind the first assignment. 2017-07-22 17:27:08 -04:00
Rob Rix
acc1d683d1 Define runAssignment as a Kleisli composition. 2017-07-22 17:26:40 -04:00
Rob Rix
a1a3f3be79 Rename the first state so we don’t use it where we mean some later state. 2017-07-22 17:25:54 -04:00
Rob Rix
d2bde129da Combine goMany and loop. 2017-07-22 17:25:39 -04:00
Rob Rix
6f954d4510 Define runMany as a worker/wrapper. 2017-07-22 17:11:26 -04:00
Rob Rix
2adf4ee765 Use Either’s MonadError instance to backtrack. 2017-07-22 16:59:38 -04:00
Rob Rix
6caaec8289 Spacing. 2017-07-22 16:58:09 -04:00
Rob Rix
2ee6332b66 🔥 projectNode. 2017-07-22 16:57:45 -04:00
Rob Rix
8b63e54f6d 🔥 an unnecessary fmap. 2017-07-22 16:56:21 -04:00
Rob Rix
4a0fb31ba1 Handle node errors in one place. 2017-07-22 16:55:43 -04:00
Rob Rix
c7d3def19f 🔥 choiceSymbols. 2017-07-22 16:53:46 -04:00
Rob Rix
15a6680848 Divide rule behaviours into at-end and at-node. 2017-07-22 16:53:18 -04:00
Rob Rix
d5799cff0d Project the head node. 2017-07-22 16:36:21 -04:00
Rob Rix
770e367c9b Tacit definition of choiceSymbols. 2017-07-22 16:33:59 -04:00
Rob Rix
ba0f28fce2 Only bind results explicitly once we need to destructure them. 2017-07-22 16:32:56 -04:00
Rob Rix
18ae76951b De-golf children assignment. 2017-07-22 16:31:23 -04:00
Rob Rix
7675f348d2 Rename advanceState to advance. 2017-07-22 16:27:02 -04:00
Rob Rix
5fab039939 Only drop when there are choices. 2017-07-22 16:24:26 -04:00
Rob Rix
30fba30c28 Correct the sense of the predicate. 2017-07-22 16:20:16 -04:00
Rob Rix
32c03be782 Rename AssignmentState to State. 2017-07-22 16:13:42 -04:00
Rob Rix
b91f70ec6a Simplify error construction. 2017-07-22 16:08:12 -04:00
Rob Rix
04fe451ca3 Swap the parameters to nodeError. 2017-07-22 16:05:55 -04:00
Rob Rix
a4a8e85bbb Extract the computation of errors for a given node. 2017-07-22 16:05:02 -04:00
Rob Rix
0aa86a309f Reformat Error. 2017-07-22 16:00:50 -04:00
Rob Rix
130b4a0d3e Write the child chain as a Kleisli composition. 2017-07-22 15:55:30 -04:00
Rob Rix
2c98b31f73 Run child assignments as direct Monadic chain. 2017-07-22 15:52:37 -04:00
Rob Rix
09787f5e93 Combine the Error constructors. 2017-07-22 15:43:48 -04:00
Rob Rix
630d78ae2a 🔥 the Show1 instance for Error. 2017-07-22 15:41:56 -04:00
Rob Rix
1b3a8f1311 Simplify error construction. 2017-07-22 15:34:56 -04:00
Rob Rix
a04a05cf1a Combine ErrorCause into Error. 2017-07-22 15:31:43 -04:00
Rob Rix
8f492b7a9a Combine the error clauses. 2017-07-22 15:19:27 -04:00
Rob Rix
126e319b88 Bind the head node. 2017-07-22 15:07:31 -04:00
Rob Rix
fd27976ba6 🔥 the note re: nullability.
It really only made sense when we were matching stateNodes at the same time.
2017-07-22 15:04:42 -04:00
Rob Rix
6a80c9dae9 🔥 some unneccessary quantifiers. 2017-07-22 15:03:58 -04:00
Rob Rix
8062a7aad4 Spacing. 2017-07-22 15:02:17 -04:00
Rob Rix
1d8c4fdeea Define a helper to project nodes. 2017-07-22 15:01:29 -04:00
Rob Rix
40313b598f Simplify the chain for choices. 2017-07-22 14:56:19 -04:00
Rob Rix
f628d22aee Match the head node with guard clauses. 2017-07-22 14:52:34 -04:00
Rob Rix
140b5cf49b Simplify how the node is projected out. 2017-07-22 14:50:26 -04:00
Rob Rix
11e83f0413 Define the error cases with guard clauses. 2017-07-22 14:49:14 -04:00
Rob Rix
dc9bfe28d1 Combine the rules for Location assignments. 2017-07-22 14:41:58 -04:00
Rob Rix
e8afa8817e Preserve backtracking errors via a setter. 2017-07-22 14:34:04 -04:00
Rob Rix
9bac600596 Define advanceState closed over the projection. 2017-07-22 14:27:46 -04:00
Rob Rix
8be255dfd7 Define dropAnonymous closed over the projection. 2017-07-22 14:24:43 -04:00
Rob Rix
8404b320b6 Define expectedSymbols with guard clauses. 2017-07-22 14:23:38 -04:00
Rob Rix
346d87b572 Tighten up the computation of the starting state. 2017-07-22 14:23:01 -04:00
Rob Rix
b97deff731 Tighten up how alternations are run. 2017-07-22 14:12:04 -04:00
Rob Rix
48cfac86f2 Tighten up how catching is run. 2017-07-22 14:10:56 -04:00
Rob Rix
fd20883532 📝 stateError. 2017-07-22 14:09:13 -04:00
Rob Rix
b9353f0d15 📝 the arguments to assignBy. 2017-07-22 14:07:58 -04:00
Rob Rix
53bb412fd3 Align the arguments with the ::. 2017-07-22 14:06:44 -04:00
Rob Rix
83a0d9c60e Swap the order of the source & assignment. 2017-07-22 14:06:07 -04:00
Rob Rix
455f912941 Swap the order of the projection & source. 2017-07-22 14:04:52 -04:00
Rob Rix
d464da8089 runAssignment is exhaustive. 2017-07-22 13:59:45 -04:00
Rob Rix
a1d03bb6cc Inline go. 2017-07-22 13:56:56 -04:00
Rob Rix
4eabcf9cfc Reformat the type signature for go. 2017-07-22 13:50:31 -04:00
Rob Rix
8a1a027e22 🔥 assign. 2017-07-22 13:47:36 -04:00
Rob Rix
9822c85709 🔥 assignAllFrom. 2017-07-22 13:47:08 -04:00
Rob Rix
0666ea03fe Define assignBy in terms of runAssignment & requireExhaustive. 2017-07-22 13:46:54 -04:00
Rob Rix
353847c5e3 Recur and then require exhaustiveness. 2017-07-22 13:45:50 -04:00
Rob Rix
07b132e631 Define a combinator requiring exhaustiveness. 2017-07-22 13:44:51 -04:00
Rob Rix
15b7735874 Define assignAllFrom using do-notation. 2017-07-22 13:38:16 -04:00
Rob Rix
2b72ca3a8a Inline runMany. 2017-07-22 13:34:43 -04:00
Rob Rix
fab398e089 Pull runMany out of run. 2017-07-22 13:34:40 -04:00
Rob Rix
a7a04ae3d3 📝 the parameters to runAssignment. 2017-07-22 13:32:51 -04:00
Rob Rix
5b674d1940 runMany closes over the source and projection. 2017-07-22 13:29:41 -04:00
Rob Rix
37494f9c03 go shadows the result type parameter. 2017-07-22 13:29:12 -04:00
Rob Rix
ee66fc74bf runMany shadows the result type parameter. 2017-07-22 13:28:59 -04:00
Rob Rix
cbed2b82a0 run shadows the result type parameter. 2017-07-22 13:28:45 -04:00
Rob Rix
4b28073c6e Pull the body of runAssignment into a worker function. 2017-07-22 13:24:09 -04:00
Rob Rix
f3a780e3a9 Reformat the type signature for run. 2017-07-22 13:22:42 -04:00
Rob Rix
d1f291c62d Merge branch 'master' into serialize-concurrent-logging 2017-07-22 13:20:20 -04:00
Timothy Clem
ed525a310f Finally clauses can have multiple statements/expressions 2017-07-21 15:46:17 -07:00
Timothy Clem
618165452a With statements with multiple withItems and partial withItems 2017-07-21 15:46:04 -07:00
Timothy Clem
1ab0701df2 Allow comments in pairs 2017-07-21 15:10:31 -07:00
Timothy Clem
8831317423 Fix issues with with and multiple body statements 2017-07-21 15:01:01 -07:00
Timothy Clem
a7df785093 flatten expressionList for single element lists 2017-07-21 15:00:39 -07:00
Timothy Clem
fed576137d Now that keyword is top level, don't need this 2017-07-21 14:59:43 -07:00
Timothy Clem
4461cb1542 Move yield to top level 2017-07-21 14:59:19 -07:00
Timothy Clem
136f43775a No need for duplicate parseError 2017-07-21 14:58:30 -07:00
Timothy Clem
22bdce0c46 Relax identifier to expression 2017-07-21 14:25:14 -07:00
Timothy Clem
b3a857a83f Let's pretend everything's an expression 2017-07-21 14:17:53 -07:00
Timothy Clem
f7202b23c8 Allow assignment of KeywordIdentifier 2017-07-21 14:17:22 -07:00
Timothy Clem
edbc7a5a0a Program's gotta be Diffable 2017-07-21 13:30:32 -07:00
Timothy Clem
3ec1f212e6 Merge branch 'master' into program-nodes-in-parse-tree-output 2017-07-21 13:25:19 -07:00
Rob Rix
07f1083543 Add a CLI flag for the log level, defaulting to warnings. 2017-07-21 16:17:17 -04:00
Rob Rix
323859d585 Move the fields onto the next line. 2017-07-21 16:15:56 -04:00
Rob Rix
1c7456571b Better help text for --colour. 2017-07-21 16:13:55 -04:00
Rob Rix
5131ca98ff Show the valid values for options. 2017-07-21 16:13:14 -04:00
Rob Rix
10044e7dcc Align the actual values, not the default. 2017-07-21 16:11:56 -04:00
Rob Rix
9937a419d1 Add an option controlling the log level. 2017-07-21 16:04:35 -04:00
Rob Rix
94e8eb7f20 Separate log level & message. 2017-07-21 16:02:35 -04:00
Rob Rix
09baaffc46 Better help text for --colour. 2017-07-21 16:01:35 -04:00
Rob Rix
01ac5356cb Configure the passed-in options. 2017-07-21 15:59:28 -04:00
Rob Rix
293104b94a Colourize logged messages. 2017-07-21 15:53:53 -04:00
Rob Rix
22d81403f0 Pass the colourization flag to formatMessage. 2017-07-21 15:48:46 -04:00
Rob Rix
7d6aa01c93 Error & Message formatting produces a String. 2017-07-21 15:48:30 -04:00
Rob Rix
580b817b9f Rename sink to logSink. 2017-07-21 15:43:42 -04:00
Rob Rix
d1babd0fb7 Pass the options to the sink. 2017-07-21 15:43:28 -04:00
Rob Rix
3c213b72db Export withSGRCode. 2017-07-21 15:41:59 -04:00
Rob Rix
e1c7fb438b Rename runTaskOptions to runTaskWithOptions. 2017-07-21 15:40:02 -04:00
Rob Rix
7577eec628 Pass withSGRCode a flag instead of Options. 2017-07-21 15:39:20 -04:00
Rob Rix
4baa0dd2b2 🔥 parens/indentation. 2017-07-21 15:37:43 -04:00
Rob Rix
63efa14594 Better help info for the colour flag. 2017-07-21 15:37:23 -04:00
Rob Rix
882947b689 Add a flag to enable/disable colour output. 2017-07-21 15:36:19 -04:00
Timothy Clem
c540661bb2 Unwrap one level of structure for ExpressionStatement in Python 2017-07-21 12:24:14 -07:00
Timothy Clem
3522fb2170 Don't display for in ConstructorName 2017-07-21 12:23:54 -07:00
Rob Rix
75721c09f0 Define options controlling Task running & output. 2017-07-21 14:45:38 -04:00
Rob Rix
d87c8a98b4 Move runParser into Task. 2017-07-21 14:19:19 -04:00
Rob Rix
b8ebbd2a3d Add an option to disable the display of source. 2017-07-21 14:17:34 -04:00
Rob Rix
72385b8a93 Better docs for optionsColour. 2017-07-21 14:13:04 -04:00
Rob Rix
4e79edf421 Separate printing & formatting errors with options. 2017-07-21 14:12:41 -04:00
Rick Winfrey
b7339fef17 Merge branch 'master' into diff-assignment-by-syntax 2017-07-21 10:52:17 -07:00
Rick Winfrey
589acd30fd Update 📝 2017-07-21 10:50:53 -07:00
Rick Winfrey
62129785f2 Move instance 2017-07-21 10:50:24 -07:00
Rob Rix
dcd2e77704 Redistribute the parens. 2017-07-21 13:50:13 -04:00
Rob Rix
19bf5498f8 Move pure earlier in the chain. 2017-07-21 13:42:09 -04:00
Rob Rix
4c494a8c57 Revert "Run Tasks using foldFreer."
This reverts commit 8bbd7a0caa4c56a5d32c88af0a4b32837294cad0.
2017-07-21 13:41:16 -04:00
Rob Rix
d575ca6dce Revert "🔥 redundant parens."
This reverts commit 62cf5bd8ab878c0f6fbf62f5358ea90c7c9034dc.
2017-07-21 13:41:02 -04:00
Timothy Clem
68b2352745 Merge remote-tracking branch 'origin/master' into program-nodes-in-parse-tree-output 2017-07-21 10:39:34 -07:00
Rob Rix
4be8ad55d1 🔥 redundant parens. 2017-07-21 13:35:36 -04:00
Rob Rix
4f8a42650d Run Tasks using foldFreer. 2017-07-21 13:34:51 -04:00
Rob Rix
3c0ed9029f Rename writeThread to sink. 2017-07-21 13:34:01 -04:00
Timothy Clem
34e3dc9965 Add Program syntax wrapper to python too 2017-07-21 10:31:57 -07:00
Rob Rix
e6bb7d6863 Lift actions into IO. 2017-07-21 13:28:04 -04:00
Rob Rix
0109f340ed Lift the operations in Files to MonadIO. 2017-07-21 13:15:54 -04:00
Rob Rix
5e4f221585 Define a MonadIO instance for Task. 2017-07-21 13:09:51 -04:00
Rob Rix
d886ba21f0 Run tasks by refinement, writing log messages for each one. 2017-07-21 13:06:14 -04:00
Timothy Clem
289e0cbd2a Merge remote-tracking branch 'origin/master' into lenient-ruby-assignment 2017-07-21 09:52:57 -07:00
Timothy Clem
4b25ff1636 Merge remote-tracking branch 'origin/master' into lenient-ruby-assignment 2017-07-21 09:52:03 -07:00
Timothy Clem
dad86d0dd8 Merge branch 'master' into program-nodes-in-parse-tree-output 2017-07-21 09:51:50 -07:00
Timothy Clem
5d1720f93c Merge remote-tracking branch 'origin/master' into fix-some-python-assignment-errors 2017-07-21 09:47:16 -07:00
Timothy Clem
1269577a75 Merge remote-tracking branch 'origin/master' into fix-ruby-empty-statement 2017-07-21 09:28:46 -07:00
Rob Rix
b51da4519e Log from a serializing background thread. 2017-07-21 12:13:50 -04:00
Rob Rix
8b4db1d3e8 Define a record selector for message content. 2017-07-21 12:10:34 -04:00
Rob Rix
86169b6eb6 Define informational messages. 2017-07-21 12:10:06 -04:00
Rob Rix
007fdd0e5c Define runTask using foldFreer. 2017-07-21 12:09:06 -04:00
Timothy Clem
2f9f9f5752 Merge remote-tracking branch 'origin/master' into remove-sourceState 2017-07-21 09:07:33 -07:00
Rob Rix
4a067250c6 Merge branch 'bump-freer' into serialize-concurrent-logging 2017-07-21 12:03:39 -04:00
Timothy Clem
20905f6e65 Write this as guards instead 2017-07-21 08:59:38 -07:00
Rob Rix
6a04e3843b Sort the import of Files down. 2017-07-21 11:42:06 -04:00
Rob Rix
e2a21addf2 Log messages to stderr. 2017-07-21 11:38:17 -04:00
Rob Rix
6c272105a4 Format messages as ByteStrings. 2017-07-21 11:38:02 -04:00
Rob Rix
03862a33f5 Define a Message type for logging. 2017-07-21 11:37:54 -04:00
Rob Rix
d1b3cc5c06 🔥 runAlgorithm/runAlgorithmSteps.
These have been subsumed by freer-cofreer’s runFreer & freerSteps.
2017-07-21 11:08:01 -04:00
Rob Rix
07edce5bfc Bump freer-cofreer to master. 2017-07-21 11:05:58 -04:00
Rick Winfrey
dc0d6ed90b Fix typo 2017-07-20 17:34:19 -07:00
Rick Winfrey
e1460fadc1 Clarify "rest" in terms of Union 2017-07-20 17:25:27 -07:00
Rick Winfrey
74c6714be1 📝 the Diffable instances 2017-07-20 17:21:20 -07:00
Timothy Clem
cf268a3ce3 Make Ruby assignment lenient: everything is an expression 2017-07-20 15:10:12 -07:00
Rick Winfrey
16ed7e704a Merge branch 'master' into diff-assignment-by-syntax 2017-07-20 14:50:52 -07:00
Timothy Clem
ad7342b93f Merge branch 'master' into catch-error-specs 2017-07-20 14:25:23 -07:00
Rick Winfrey
ad70ccb97d 🔥 Diffable for old Syntax 2017-07-20 14:21:59 -07:00
Rick Winfrey
ec5ec8ebb5 Replace diffLinearly -> diffRecursively 2017-07-20 14:17:01 -07:00
Rick Winfrey
b6396fbd51 Derive Diffable instances for Syntax constructors 2017-07-20 14:16:18 -07:00
Rick Winfrey
c8da38ddc2 Add Diffable class and instances 2017-07-20 14:15:01 -07:00
Timothy Clem
9618db2cdb Produce program syntaxes (for ruby at least) 2017-07-20 13:52:10 -07:00
Timothy Clem
fc9851334f Introduce expressions and declarations to Python assignment to cleanup code 2017-07-20 11:54:41 -07:00
Timothy Clem
6bf440d240 Python elif and else need to take multiple statements too 2017-07-20 11:42:56 -07:00
Timothy Clem
996b8fbf30 Fix python assignment for multiple statements in if body 2017-07-20 11:39:07 -07:00
Timothy Clem
2ca5412769 Python ExpressionStatement can have one or more declarations 2017-07-20 11:26:26 -07:00
Timothy Clem
2c00461f23 Allow assignment of <> operator in Python 2017-07-20 11:15:50 -07:00
Timothy Clem
19eb8f2706 Try to take some source for EmptyStatement 2017-07-20 11:06:34 -07:00
Timothy Clem
2880052c15 Remove sourceState from AssignmentState 2017-07-20 10:23:21 -07:00
joshvera
de2146a1cd Merge 'master' into json 2017-07-20 12:35:34 -04:00
Timothy Clem
6b1a3b0efd Fix zero width repetitions infinite loop
Introduces a stateCounter to detect progress and accepts one and only one zero width match.

Refactored tests a bit to not assert internal state unless specifically necessary.
2017-07-20 09:32:24 -07:00
Timothy Clem
4cdac77633 Test out catchError 2017-07-20 09:32:24 -07:00
joshvera
f7a7a2c180 Add parseError to value Assignment in the JSON parser 2017-07-20 11:12:08 -04:00
joshvera
0b497fb8a2 Remove JSON from ToCTermRenderer since it doesn't have functions 2017-07-20 11:06:19 -04:00
joshvera
fb84ec83f5 Add JSON to parseBlob 2017-07-20 11:06:19 -04:00
joshvera
00205c3d26 Sort Syntax in JSON parser 2017-07-20 11:06:19 -04:00
Rob Rix
734e42802d Correct the docs for parse. 2017-07-20 10:23:35 -04:00
Rob Rix
f9ce0a9e63 Take the blob parameter explicitly. 2017-07-19 20:24:52 -04:00
Rob Rix
6f1cf00255 Move the implementations of readBlobs/readBlobPairs into Task. 2017-07-19 20:20:20 -04:00
Rob Rix
e6739b5430 📝 writeToOutput. 2017-07-19 20:18:44 -04:00
Rob Rix
aaf39930b0 Simplify how the output is defaulted to stdout. 2017-07-19 20:07:17 -04:00
Rob Rix
839c64b4a3 Rename Command.Files to Files. 2017-07-19 19:57:36 -04:00
Rob Rix
8d73a83cdf Bind instead of using do notation. 2017-07-19 17:41:06 -04:00
Rob Rix
71356ead42 Construct a single task. 2017-07-19 17:39:48 -04:00
Rob Rix
beb6c4788c WriteToOutput takes a handle or a path. 2017-07-19 17:29:38 -04:00
Rob Rix
766f71ba90 🔥 the obsolete getOutputPath logic. 2017-07-19 17:26:52 -04:00
joshvera
c513e6e34b Merge origin/master 2017-07-19 17:26:22 -04:00
Rob Rix
aad5e2d396 Correct the docs. 2017-07-19 17:24:06 -04:00
Rob Rix
1cb3541efe Construct a task in the options parser. 2017-07-19 17:22:10 -04:00
Rob Rix
a85aa1f8ff Carry the language in error declarations. 2017-07-19 17:17:39 -04:00
Rob Rix
c8416ee0fd Pass blobs to the declaration algebras. 2017-07-19 17:16:51 -04:00
Rob Rix
c0f894162e Derive an NFData instance for Language. 2017-07-19 17:15:44 -04:00
Rob Rix
4d5ffe7a11 🔥 ParseMode. 2017-07-19 15:46:49 -04:00
Rob Rix
fe21d792fe Define runParse by composition. 2017-07-19 15:46:31 -04:00
Rob Rix
17af42e21e Define runDiff by composition. 2017-07-19 15:46:27 -04:00
Rob Rix
2cce3dd671 Define a Task to write output. 2017-07-19 15:44:22 -04:00
Rob Rix
cbb6c885a4 Define Tasks to read blobs. 2017-07-19 15:41:40 -04:00
Rob Rix
8d43d19296 Construct Eithers for the input source(s). 2017-07-19 15:40:56 -04:00
Rob Rix
97a4f75ca8 Generalize readBlobPairs to lists of path/language pairs. 2017-07-19 15:37:01 -04:00
joshvera
e637d195b9 Add remaining json syntax 2017-07-19 15:35:47 -04:00
Rob Rix
6afe6a94a4 Define a high-level operation to read a pair of blobs 2017-07-19 15:28:26 -04:00
Rob Rix
90f4aa38a7 Define a high-level operation to read in blobs. 2017-07-19 15:24:55 -04:00
Rob Rix
ab7b39e771 Align the doc comments for AssignmentParser. 2017-07-19 15:17:02 -04:00
joshvera
381d5e741f Add some structure to JSON.Syntax 2017-07-19 15:17:00 -04:00
Rob Rix
abd0e5ab41 Correct the docs for readFile. 2017-07-19 15:14:21 -04:00
Rob Rix
446ee85894 Pass extant blobs’ paths to showPos. 2017-07-19 15:02:27 -04:00
Rob Rix
b11cf64103 Pass the blob to printError. 2017-07-19 14:59:42 -04:00
Rob Rix
4d62b8be3f Merge branch 'master' into task-input-output 2017-07-19 14:47:53 -04:00
Rob Rix
97c8b90c83 runParser takes a Blob. 2017-07-19 14:47:07 -04:00
Rob Rix
6dd56e5bd9 Parse tasks take blobs. 2017-07-19 14:42:02 -04:00
Rob Rix
5481883b9f 🔥 Command. 2017-07-19 14:14:07 -04:00
Rob Rix
1c51f23ef4 Import all the symbols from Command.Files instead of Command. 2017-07-19 14:13:22 -04:00
Rob Rix
b630a11b6e 🔥 Arguments. 2017-07-19 14:08:38 -04:00
Rob Rix
7aa8ea1150 Export the DiffMode/ParseMode constructors. 2017-07-19 14:08:32 -04:00
Rob Rix
be5de7acaf Move DiffMode into SemanticCmdLine. 2017-07-19 14:07:18 -04:00
Rob Rix
4df9192d02 Move ParseMode into SemanticCmdLine. 2017-07-19 14:05:23 -04:00
Rob Rix
2cd59243a0 🔥 DiffArguments. 2017-07-19 14:04:39 -04:00
Rob Rix
b74cc92213 🔥 ParseArguments. 2017-07-19 14:04:33 -04:00
Rob Rix
30d4c6a6e8 🔥 ProgramMode. 2017-07-19 14:04:17 -04:00
Rob Rix
5e13616358 🔥 Arguments. 2017-07-19 14:03:51 -04:00
Rob Rix
1a3708a462 Format the export list. 2017-07-19 14:02:22 -04:00
Rob Rix
e03ba6b0e4 Define diffing/parsing CLI parsers in terms of SomeRenderer and the action to be performed. 2017-07-19 14:00:30 -04:00
Rob Rix
5ea5b7fb05 Export SomeRenderer. 2017-07-19 13:59:20 -04:00
Rob Rix
0722f09626 Define a SomeRenderer type to abstract type indices away. 2017-07-19 13:54:48 -04:00
Rick Winfrey
9d1f4f19ca Update ErrorSummary to use MaybeLanguage 2017-07-18 17:18:09 -07:00
Rick Winfrey
c92157b988 🔥 Undetected constructor
- Representing as Maybe Language is helpful for blobs that are null.
2017-07-18 17:17:33 -07:00
Rick Winfrey
c7eb0dc482 🔥 language from Summaries; 🔥 language from JSONSummary
- We only care about the language when there's a parse error, so language is added to ErrorSummary only
2017-07-18 16:49:39 -07:00
Rick Winfrey
565445039e Add language to Summaries 2017-07-18 15:59:55 -07:00
Rick Winfrey
9d2119ffc8 Add language field to JSONSummary 2017-07-18 15:58:37 -07:00
Rick Winfrey
7fdc32b77c Add Undetected Language constructor 2017-07-18 15:52:18 -07:00
Timothy Clem
74d7bc9d36 Merge branch 'master' into constructor-name 2017-07-18 11:34:54 -07:00
Timothy Clem
28a3313d12 Rename constructorLabelWithSource => constructorNameAndConstantFields 2017-07-18 11:33:28 -07:00
Timothy Clem
31a2e6a08d Return a ConstructorLabel instead of a ByteString 2017-07-18 11:32:59 -07:00
Timothy Clem
b0e98bd6b5 Reduce language pragmas needed 2017-07-18 11:23:37 -07:00
Timothy Clem
49100a7479 Use Generic1 to get conName for syntax constructor labels 2017-07-18 10:03:32 -07:00
Timothy Clem
a6f375859f Update Parser to use Either instead of Result 2017-07-17 14:39:08 -07:00
Timothy Clem
039e019551 Track errors in AssignmentState, Result => Either 2017-07-17 14:39:03 -07:00
Timothy Clem
902aa213f5 Assign HTMLInline in markdown 2017-07-17 10:50:02 -07:00
Rob Rix
9370addba1 Print the source in white. 2017-07-17 12:58:41 -04:00
Rob Rix
1c1349ef82 Apply the ShowS in putStrErr. 2017-07-17 12:56:40 -04:00
Rob Rix
1b117ef8b0 Add a newline after the callstack. 2017-07-17 12:55:39 -04:00
Rob Rix
dcb1794cfa Print the callstack in white. 2017-07-17 12:55:13 -04:00
joshvera
3f6c71b3a4 Add json grammar module 2017-07-17 12:52:50 -04:00
Rob Rix
d997779bdf Traverse the Maybe directly. 2017-07-17 12:52:17 -04:00
Rob Rix
36801584e0 Prefer the later error. 2017-07-17 12:51:42 -04:00
Rob Rix
a07726fcf3 Preserve errors through repetitions. 2017-07-17 12:22:27 -04:00
Rob Rix
8354b701ae Alternating results preserves errors. 2017-07-17 12:20:02 -04:00
Rob Rix
3a7c4a238f Produce errors at the current node’s location instead of the end of the previous node.
This gives us better localization of errors, pointing at the start of the (guaranteed extant) current node instead of the state’s current location (which can be an arbitrary distance earlier in the source).
2017-07-17 12:19:15 -04:00
Rob Rix
b66cfcc52c Select the lesser of the node symbol & the parse error symbol.
This effectively clamps the ERROR symbol (65535) to the maximal constructor.
2017-07-14 14:43:36 -04:00
Rick Winfrey
921be5bfca Assign Let statements in Except clauses 2017-07-13 15:52:03 -07:00
Rick Winfrey
af8b0ffd2f Add Catch record fields 2017-07-13 15:49:33 -07:00
Rick Winfrey
9c9f43d4e9 Assign Decorators with no ArgumentList 2017-07-13 15:22:01 -07:00
Rick Winfrey
08560875b6 uncurry and swap 2017-07-13 15:15:36 -07:00
Rick Winfrey
c0e47ffd8a 🔥 old comment 2017-07-13 15:15:17 -07:00
Rick Winfrey
8a0e952a11 Merge branch 'master' into python-slice-expressions 2017-07-13 10:03:53 -07:00
Rick Winfrey
0999f42b96 Merge branch 'master' into python-slice-expressions 2017-07-13 10:02:57 -07:00
Rick Winfrey
8b2f608221 🔥 toEnumeration 2017-07-13 09:50:19 -07:00
Rob Rix
8546dc80b7 Merge branch 'master' into parse-error-symbols 2017-07-13 11:03:15 -04:00
Rob Rix
b264246b93 Merge branch 'master' into nested-decorators 2017-07-13 11:01:10 -04:00
Rob Rix
7b888cd760 Merge branch 'master' into parse-error-symbols 2017-07-13 10:58:28 -04:00
Rick Winfrey
0e5a22da2b Assign nested decorators 2017-07-12 18:51:14 -07:00
Rick Winfrey
91d15699ce Assign slice expressions 2017-07-12 15:31:41 -07:00
Rick Winfrey
6da98f3d34 Rename Literal.Range -> Expression.Enumeration 2017-07-12 15:28:05 -07:00
Rob Rix
47e8fdeef5 Represent Markdown nodes with the Node/AST types. 2017-07-12 17:03:57 -04:00
Rob Rix
3bd4fe5665 Assign parse errors in Ruby statements. 2017-07-12 16:20:42 -04:00
Rob Rix
d229ec2310 Assign parse errors in Python. 2017-07-12 16:20:37 -04:00
Rob Rix
1e4eb2d24e Remove the error parameter from Syntax.Error. 2017-07-12 16:20:24 -04:00
Rob Rix
e050a44cf4 Define a Node type for the intermediate representation of metadata. 2017-07-12 15:55:21 -04:00
Rob Rix
c4fc6e5c4a Use the AST synonym. 2017-07-12 15:40:54 -04:00
Rob Rix
00221d421f 🔥 the ParseError ErrorCause. 2017-07-12 15:35:00 -04:00
Rob Rix
cf8148f804 Merge branch 'master' into parse-error-symbols 2017-07-12 14:58:40 -04:00
Timothy Clem
7fff9cc64a Merge branch 'master' into ruby-assignment 2017-07-12 10:49:19 -07:00
Rick Winfrey
83fcc206f3 Merge branch 'master' into par-arg-eters 2017-07-12 10:09:06 -07:00
Rick Winfrey
934cb445b0 🔥 the >>=! 2017-07-12 10:02:55 -07:00
Rob Rix
230570c42b Obviate the need for Maybe around symbols. 2017-07-12 12:55:57 -04:00
Timothy Clem
b3ef7cbded Fix up unary defined?, thanks @robrix 2017-07-12 09:06:50 -07:00
Timothy Clem
f87a5039a7 Go back to original Syntax.Empty 2017-07-12 08:18:03 -07:00
Timothy Clem
4d70e1c358 Merge branch 'master' into markdown-headings 2017-07-12 08:12:47 -07:00
Rick Winfrey
10a0efcf0b Move literal assignment to top 2017-07-11 16:20:30 -07:00
Rick Winfrey
f1e9e215ce Collapse parameter assignments 2017-07-11 16:08:49 -07:00
Rick Winfrey
be2969b153 Collapse argument assignments 2017-07-11 16:08:28 -07:00