Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
artify
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
artify
Commits
a2db9fe6
Commit
a2db9fe6
authored
Jan 21, 2015
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now using tuples for patterns instead of arrays
parent
97dfaabb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
141 additions
and
144 deletions
+141
-144
artify.ml
artify.ml
+141
-144
No files found.
artify.ml
View file @
a2db9fe6
...
...
@@ -34,165 +34,162 @@ let artify replace_pat s =
let
y
=
i
/
w
in
let
o
ox
oy
=
char_at
(
x
+
ox
)
(
y
+
oy
)
in
let
m1
=
-
1
in
[
|
o
m1
m1
;
o
0
m1
;
o
1
m1
;
o
m1
0
;
o
0
0
;
o
1
0
;
o
m1
1
;
o
0
1
;
o
1
1
|
]
(
o
m1
m1
,
o
0
m1
,
o
1
m1
,
o
m1
0
,
o
0
0
,
o
1
0
,
o
m1
1
,
o
0
1
,
o
1
1
)
in
UTF8
.
init
(
String
.
length
s
)
(
fun
i
->
replace_pat
(
make_pat
i
))
let
u
s
=
UTF8
.
get
s
0
let
replace_pat_safe
=
function
|
[
|
_
;
'
|
'
|
'
+
'
;
_
;
'
-
'
|
'
+
'
;
'
+
'
;
'
-
'
|
'
+
'
;
_
;
'
|
'
|
'
+
'
;
_
|
]
->
u
"┼"
|
[
|
_
;
_
;
_
;
'
-
'
|
'
+
'
;
'
+
'
;
'
-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
"╷"
|
[
|
_
;
_
;
_
;
'
'
;
'
+
'
;
'
'
;
_
;
'
'
;
_
|
]
->
u
"╵"
|
[
|
_
;
'
'
;
_
;
'
'
;
'
+
'
;
x
;
_
;
_
;
_
|
]
->
pick_double
x
"┌╒"
|
[
|
_
;
_
;
_
;
'
'
;
'
+
'
;
x
;
_
;
'
'
;
_
|
]
->
pick_double
x
"└╘"
|
[
|
_
;
'
'
;
_
;
x
;
'
+
'
;
'
'
;
_
;
_
;
_
|
]
->
pick_double
x
"┐╕"
|
[
|
_
;
_
;
_
;
x
;
'
+
'
;
'
'
;
_
;
'
'
;
_
|
]
->
pick_double
x
"┘╛"
|
[
|
_
;
'
'
;
_
;
x
;
'
+
'
;
y
;
_
;
_
;
_
|
]
->
pick_double
(
both_double
x
y
)
"┬╤"
|
[
|
_
;
_
;
_
;
x
;
'
+
'
;
y
;
_
;
'
'
;
_
|
]
->
pick_double
(
both_double
x
y
)
"┴╧"
|
[
|
_
;
_
;
_
;
'
'
;
'
+
'
;
x
;
_
;
_
;
_
|
]
->
pick_double
x
"├╞"
|
[
|
_
;
_
;
_
;
x
;
'
+
'
;
'
'
;
_
;
_
;
_
|
]
->
pick_double
x
"┤╡"
|
[
|
_
;
_
;
_
;
x
;
'
+
'
;
y
;
_
;
_
;
_
|
]
->
pick_double
(
both_double
x
y
)
"┼╪"
|
_
,
'
'
,
_
,
'
'
,
'
+
'
,
'
'
,
_
,
'
'
,
_
->
u
"·"
(* XXX: maybe just leave the '+' *)
|
_
,
'
'
,
_
,
_
,
'
+
'
,
'
'
,
_
,
'
'
,
_
->
u
"╴"
|
_
,
'
'
,
_
,
'
'
,
'
+
'
,
_
,
_
,
'
'
,
_
->
u
"╶"
|
_
,
'
'
,
_
,
'
'
,
'
+
'
,
'
'
,
_
,
_
,
_
->
u
"╷"
|
_
,
_
,
_
,
'
'
,
'
+
'
,
'
'
,
_
,
'
'
,
_
->
u
"╵"
|
_
,
'
'
,
_
,
'
'
,
'
+
'
,
x
,
_
,
_
,
_
->
pick_double
x
"┌╒"
|
_
,
_
,
_
,
'
'
,
'
+
'
,
x
,
_
,
'
'
,
_
->
pick_double
x
"└╘"
|
_
,
'
'
,
_
,
x
,
'
+
'
,
'
'
,
_
,
_
,
_
->
pick_double
x
"┐╕"
|
_
,
_
,
_
,
x
,
'
+
'
,
'
'
,
_
,
'
'
,
_
->
pick_double
x
"┘╛"
|
_
,
'
'
,
_
,
x
,
'
+
'
,
y
,
_
,
_
,
_
->
pick_double
(
both_double
x
y
)
"┬╤"
|
_
,
_
,
_
,
x
,
'
+
'
,
y
,
_
,
'
'
,
_
->
pick_double
(
both_double
x
y
)
"┴╧"
|
_
,
_
,
_
,
'
'
,
'
+
'
,
x
,
_
,
_
,
_
->
pick_double
x
"├╞"
|
_
,
_
,
_
,
x
,
'
+
'
,
'
'
,
_
,
_
,
_
->
pick_double
x
"┤╡"
|
_
,
_
,
_
,
x
,
'
+
'
,
y
,
_
,
_
,
_
->
pick_double
(
both_double
x
y
)
"┼╪"
|
[
|
_
;
_
;
_
;
_
;
'
-
'
;
'
-
'
|
'
+
'
;
_
;
_
;
_
|
]
|
[
|
_
;
_
;
_
;
'
-
'
|
'
+
'
;
'
-
'
;
_
;
_
;
_
;
_
|
]
->
u
"─"
|
_
,
_
,
_
,
_
,
'
-
'
,
(
'
-
'
|
'
+
'
)
,
_
,
_
,
_
|
_
,
_
,
_
,
(
'
-
'
|
'
+
'
)
,
'
-
'
,
_
,
_
,
_
,
_
->
u
"─"
|
[
|
_
;
_
;
_
;
_
;
'
|
'
;
_
;
_
;
'
|
'
|
'
+
'
;
_
|
]
|
[
|
_
;
'
|
'
|
'
+
'
;
_
;
_
;
'
|
'
;
_
;
_
;
_
;
_
|
]
->
u
"│"
|
_
,
_
,
_
,
_
,
'
|
'
,
_
,
_
,
(
'
|
'
|
'
+
'
)
,
_
|
_
,
(
'
|
'
|
'
+
'
)
,
_
,
_
,
'
|
'
,
_
,
_
,
_
,
_
->
u
"│"
|
[
|
_
;
_
;
_
;
'
-
'
|
'
=
'
|
'
+
'
;
'
=
'
;
_
;
_
;
_
;
_
|
]
|
[
|_
;
_
;
_
;
_
;
'
=
'
;
'
-
'
|
'
=
'
|
'
+
'
;
_
;
_
;
_
|
]
->
u
"═"
|
_
,
_
,
_
,
(
'
-
'
|
'
=
'
|
'
+
'
)
,
'
=
'
,
_
,
_
,
_
,
_
|
_
,
_
,
_
,
_
,
'
=
'
,
(
'
-
'
|
'
=
'
|
'
+
'
)
,
_
,
_
,
_
->
u
"═"
|
[
|_;
_
;
_
;
_
;
c
;
_
;
_
;
_
;
_
|
]
->
UChar
.
of_char
c
|
_
->
failwith
"invalid pattern"
|
_
,
_
,
_
,
_
,
c
,
_
,
_
,
_
,
_
->
UChar
.
of_char
c
let
()
=
let
args
=
List
.
tl
(
Array
.
to_list
Sys
.
argv
)
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment