FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
stategraph/code/src/lua_pattern_sed/lua_pattern_sed.ml at main · stategraph/stategraph · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
stategraph
/
stategraph
Public
Notifications
You must be signed in to change notification settings
Fork
73
Star
1.3k
Code
Issues
107
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
stategraph
/
code
/
src
/
lua_pattern_sed
/
lua_pattern_sed.ml
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (16 loc) · 501 Bytes
Breadcrumbs
stategraph
/
code
/
src
/
lua_pattern_sed
/
lua_pattern_sed.ml
Copy path
File metadata and controls
19 lines (16 loc) · 501 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
let
print
line
=
function
|
Some
sline
-> print_endline sline
|
None
-> print_endline line
let
rl
()
=
try
Some
(read_line
()
)
with
End_of_file
->
None
let
rec
exec_subst
pat
rep
=
match
rl
()
with
|
Some
line
->
print line (
Lua_pattern.
substitute
~s:
line
~r:
rep pat);
exec_subst pat rep
|
None
->
()
let
()
=
let
pat
=
Lua_pattern.
of_string
Sys.
argv.(
1
)
in
let
rep
=
Lua_pattern.
rep_str
Sys.
argv.(
2
)
in
match
pat
with
|
Some
pat
-> exec_subst pat rep
|
_
-> exit
1
Back
|
FazBrowse Home
|
New Git URL