Commit Graph

203 Commits

Author SHA1 Message Date
Rijnard van Tonder
d65d1f646d don't access unsafe buffer 2020-07-06 18:40:50 -07:00
Rijnard van Tonder
3e852c4ed5
Update for OCaml 4.10 and Core 0.13 (#188) 2020-07-04 17:42:52 -07:00
Rijnard van Tonder
a9b68a0656 separate parsers for engines 2020-06-21 00:44:05 -07:00
Rijnard van Tonder
d6090577f2
Fast offset conversion (#182) 2020-05-09 00:53:25 -07:00
Rijnard van Tonder
f0d89e24b3 compute line table once per source 2020-04-30 16:48:03 -07:00
Rijnard van Tonder
ab93d72163
add flag for omega matcher engine (#179) 2020-04-28 15:22:18 -07:00
Rijnard van Tonder
2094680e95
exclude file option and refactors (#177) 2020-04-19 02:13:18 -07:00
Rijnard van Tonder
a363e45e7f
exclude dir takes multiple arguments (#175) 2020-03-26 18:17:46 -07:00
Rijnard van Tonder
c46ce7fee2 allow full alphabetic range for labels 2020-02-16 00:53:12 -07:00
Rijnard van Tonder
26b7acf21b
add expression hole semantics (#170) 2020-02-15 23:39:01 -07:00
Rijnard van Tonder
fa4dd553df
allow arbitrary labels for rewrite IDs (#169) 2020-02-15 17:15:58 -07:00
Rijnard van Tonder
d5d8a5cce4
Allow substituting fresh IDs in rewrite (#168) 2020-01-31 19:22:48 -07:00
Rijnard van Tonder
ac44dbe9e6 remove unused files 2020-01-11 15:13:57 -07:00
Rijnard van Tonder
823b6005da omega matcher progress 2020-01-11 15:09:07 -07:00
Rijnard van Tonder
46e35d8d61 add fast offset conversion function 2020-01-10 23:38:02 -07:00
Rijnard van Tonder
3e437f1a8a
exempt underscore from inferred equality constraints (#160) 2020-01-08 16:31:44 -07:00
Rijnard van Tonder
e9107547ae
Update lwt dependency (#156) 2019-12-25 00:23:44 -07:00
Rijnard van Tonder
ff9dc04bc4
remove unneeded attempts for string parsing (#158) 2019-12-22 16:15:20 -07:00
Rijnard van Tonder
8f71ec8306
Don't print a long string on timeout (#155) 2019-12-12 15:03:55 -07:00
Rijnard van Tonder
b47825a1f4
Use text matcher for plain text file extensions (#154) 2019-12-09 16:53:44 -07:00
Rijnard van Tonder
3fee93b352
Print line numbers for -match-only option (#152) 2019-12-02 18:34:09 -07:00
Rijnard van Tonder
e6810b9ebb update types for alternative engine 2019-11-28 12:37:52 -07:00
Rijnard van Tonder
5d2f553929
Optional holes initial implementation (#133) 2019-11-24 01:48:17 -07:00
Rijnard van Tonder
2ff2069cf0
Warn on simple hole start pattern (#147) 2019-11-22 03:20:15 -07:00
Rijnard van Tonder
72b6a9b8c6
Handle all cases of trailing newline patch compatible diffs (#140) 2019-11-20 01:56:30 -07:00
Rijnard van Tonder
bd21fe2228
Generate patch-compatible diffs (#135) 2019-11-18 19:56:52 -07:00
Rijnard van Tonder
047f2fc33a correct indentation 2019-11-05 20:40:57 -07:00
Rijnard van Tonder
40cac158b6
Separate Javascript and Typescript and handle .tsx and .jsx (#130) 2019-11-05 18:42:17 -07:00
Rijnard van Tonder
f9311011f9
Convert match offsets to line and column (#128) 2019-11-03 01:36:09 -07:00
Rijnard van Tonder
1aacf1c057
Add new matching engine (#127) 2019-11-03 00:57:02 -07:00
Rijnard van Tonder
caf3d7cd91
Error if both -diff and -stdout are specified (#125) 2019-10-27 22:27:54 -07:00
Rijnard van Tonder
9e95c7c78f
Add basic definition for Nim (#122) 2019-10-25 23:44:55 -07:00
Rijnard van Tonder
5a1fc4ff3d
Add definition for Reason (#121) 2019-10-21 22:48:02 -07:00
Rijnard van Tonder
18abf1f904
Add -disable-substring-matching option 2019-10-03 23:20:03 -04:00
Rijnard van Tonder
2a3164ce91
Fix up case for handling empty string properly 2019-10-02 01:22:00 -04:00
Rijnard van Tonder
c32a96d0a2 correct editor offset 2019-09-26 01:21:09 -04:00
Rijnard van Tonder
c855e811d9
Make patch paths relative to current directory. 2019-09-26 00:51:32 -04:00
Rijnard van Tonder
516bcf9d2a
Remove lambda-term 2019-09-25 22:57:29 -04:00
Rijnard van Tonder
5d391bc355 0.9.0 release and updates 2019-09-25 03:38:10 -04:00
Rijnard van Tonder
75f70a2816 Fix number of files reported in review mode 2019-09-25 02:13:52 -04:00
Rijnard van Tonder
f60e0b7866
Update test coverage and dune files 2019-09-25 01:12:25 -04:00
Rijnard van Tonder
3350299f04
Add -default-no option to interactive mode 2019-09-24 23:26:53 -04:00
Rijnard van Tonder
194d423d96
Infer equality from template when there's no rule file 2019-09-24 21:39:42 -04:00
Rijnard van Tonder
e7fdaa5229
Allow all kinds of hole syntax in rewrite template 2019-09-24 03:10:11 -04:00
Rijnard van Tonder
69b9987df8
Error on invalid matcher option 2019-09-24 03:09:55 -04:00
Rijnard van Tonder
e695d73082
Fix up -count and -d option 2019-09-24 00:51:36 -04:00
Rijnard van Tonder
fcb4b41f53
Add interactive mode 2019-09-24 00:35:12 -04:00
Rijnard van Tonder
e8a7d9e625
Update opam and dependencies 2019-09-22 19:29:29 -04:00
Rijnard van Tonder
d025f38253
Output newline-separated matches with -match-only 2019-09-20 01:28:14 -04:00
Rijnard van Tonder
8fd51d3809
Clean up output module 2019-09-20 00:41:45 -04:00
Rijnard van Tonder
582b337c7d fixup implicit equality and add test 2019-09-18 03:16:41 -04:00
Rijnard van Tonder
1bbe0e8007
Match empty string before newline for newline hole 2019-09-17 02:16:05 -04:00
Rijnard van Tonder
0d705a7a0b
Use an optional type for escapable string syntax 2019-09-16 08:53:12 -05:00
Rijnard van Tonder
e43eb684c0
Add /substitute endpoint to server
Closes #72
2019-09-15 19:16:17 -05:00
Rijnard van Tonder
c1fc7f9154
Factor out shared rewrite pipeline for CLI and server 2019-09-15 18:47:20 -05:00
Rijnard van Tonder
7ecd5abfb3
remove angle delimiters from Elixir 2019-09-13 18:51:13 -04:00
Rijnard van Tonder
cf1e350106
Implicit equal constraint in templates with same hole identifiers 2019-09-13 02:38:40 -04:00
Rijnard van Tonder
0b691c851c
Introduce simplified rewrite rule syntax 2019-09-13 02:24:49 -04:00
Rijnard van Tonder
99966c347c
Fix up python definition. 2019-09-13 02:24:29 -04:00
Rijnard van Tonder
a6b8d7130d
Bug fix: allow nonalphanumeric delimiters preceding alphanum delimiters 2019-09-11 18:18:48 -04:00
Rijnard van Tonder
9b47a19731
Explain matcher
- Emit warning if the generic matcher is inferred
- Infer extension even if `.` is absent (Go is inferred for `go`, Java for `java`, etc.)
- Adds `comby -list` that lists `-match` options for all supported languages
- Emits the inferred matcher of non-generic matchers if `DEBUG_COMBY` is set
2019-09-03 23:30:41 -04:00
Rijnard van Tonder
05d2ce6812 add more languages to -list 2019-09-03 23:17:19 -04:00
Rijnard van Tonder
4bdb1dd3f0
Exclude reserved delimiters from matching non-space holes 2019-09-02 23:01:28 -04:00
Rijnard van Tonder
2301b60765 explain matcher 2019-09-02 23:00:54 -04:00
Rijnard van Tonder
45d5505c4e
Consecutive newline holes should match consecutive lines 2019-09-01 00:52:23 -04:00
Rijnard van Tonder
d2da2fff47 wip explain matcher 2019-08-29 01:56:58 -04:00
Thorsten Ball
c5a86ab5df Add Syntax_config
Adds `-custom_matcher` flag for custom language syntax
2019-07-31 05:05:58 -07:00
Rijnard van Tonder
0a71e07077
Remove bash alphanum delimiter whitespace 2019-07-11 03:36:00 -04:00
Rijnard van Tonder
7708c056d1
Add alphanumeric delimiter support
Adds support for nestable alphanumeric delimiters (e.g., `def ... end` in Ruby,`case ... esac` in Bash, and `begin ... end` in OCaml).
2019-07-06 01:19:51 -04:00
Rijnard van Tonder
b91c424740
Extended hole matching
Adds shorthands:
`:[x\n]` to match until newline
`:[x.]` to match alphanumeric and punctuation
`:[ ]` or `[ x]` to match only spaces/tabs
2019-06-30 23:44:12 -07:00
Rijnard van Tonder
b27f6ab4b6
Add -json-only-diff 2019-06-19 01:53:08 -04:00
Rijnard van Tonder
3704ede05a
Map .jsx and .tsx to JS matcher 2019-06-17 17:06:53 -04:00
Rijnard van Tonder
47afef6b20
Add paren and dyck languages 2019-06-15 19:33:18 -04:00
Rijnard van Tonder
dc4b4b3b88
Option -matcher to force matcher and ignore file extensions 2019-06-11 03:45:51 -04:00
Rijnard van Tonder
265d9410c3
Add more languages and experimental block keywords 2019-06-06 16:34:38 -04:00
Rijnard van Tonder
2a34e9ff92
Fix strings prefixed by non-whitespace or hole or delimiter 2019-06-06 12:13:11 -04:00
Rijnard van Tonder
1dc3c9005e
Relax balanced apostrophe for ocaml and rust 2019-06-05 23:06:34 -04:00
Rijnard van Tonder
210bbcc8a3
Add Julia, Fortran, Pascal. 2019-06-05 22:49:03 -04:00
Rijnard van Tonder
7d789a58fe
Use colored diff output by default. Fix printing. 2019-06-05 22:47:10 -04:00
Rijnard van Tonder
eabf75d7a7
Refactor main
- Configuration options
- Option error detection
- Dedicated output types
- Printers
2019-05-29 22:06:29 -04:00
Rijnard van Tonder
0bde4aae73
Use OCaml 4.07 2019-05-17 21:52:25 -04:00
Rijnard van Tonder
36ef457e43
Add bisect-ppx and coveralls 2019-04-27 20:03:27 -04:00
Rijnard van Tonder
fe4fd72bb3
Fix lisp strings 2019-04-27 19:10:55 -04:00
Rijnard van Tonder
c58fd43129
Dart has triple quotes raw strings (#17) 2019-04-26 23:17:14 -04:00
Rijnard van Tonder
2df40597f4 fix timer 2019-04-25 23:52:05 -04:00
Rijnard van Tonder
c120778228
Update file extensions for new matchers. 2019-04-23 19:27:29 -04:00
Rijnard van Tonder
d86ef120c2 Nested comments for languages that need them 2019-04-23 19:25:22 -04:00
Rijnard van Tonder
b02b053ed2
More languages 2019-04-23 16:11:41 -04:00
Rijnard van Tonder
8d4fca6bcb
Use a single language module 2019-04-23 13:14:40 -04:00
Rijnard van Tonder
639ec7d1df
Parse raw strings before strings because python ambiguity 2019-04-23 12:46:25 -04:00
Rijnard van Tonder
e2cca3e614
Use comment variants and pull out mparser dependencies. 2019-04-23 02:23:20 -04:00
Rijnard van Tonder
6e939a21ab
Single hole with prefix. *Uses attempt* 2019-04-22 14:13:43 -04:00
Rijnard van Tonder
ca791604f1 match until character 2019-04-21 19:57:21 -04:00
Rijnard van Tonder
3c5876043e Add very basic matcher for latex 2019-04-20 23:48:55 -04:00
Rijnard van Tonder
f142a6c140 be more strict about spaces: at least one space also required 2019-04-18 01:28:22 -04:00
Rijnard van Tonder
90cd6f5e5c there must be at least one predicate in a rule 2019-04-18 01:26:39 -04:00
Rijnard van Tonder
4f9180a5ff make server tests more robust 2019-04-14 01:28:03 -04:00
Rijnard van Tonder
021049138b allow short hole syntax in rewrite template 2019-04-12 22:25:37 -04:00
Rijnard van Tonder
455fb95e29 rename to in_place_substitutions 2019-04-12 20:54:05 -04:00
Rijnard van Tonder
d2b23cd217 Use generic matcher on unsupported extensions, and include base string delimiters for it 2019-04-12 00:11:35 -04:00
Rijnard van Tonder
65d56fbe82 remove deprecated rewrite rule parts 2019-04-09 12:34:53 -04:00
Rijnard van Tonder
1e1d919c78 change environment json output to variable key 2019-04-09 12:26:49 -04:00
Rijnard van Tonder
f5c03e19ef Initial code commit 2019-04-09 03:18:31 -04:00