This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
14
unikernel/duniverse/ocaml-dns/resolvconf/dns_resolvconf.ml
Normal file
14
unikernel/duniverse/ocaml-dns/resolvconf/dns_resolvconf.ml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
let parse buf =
|
||||
try
|
||||
Resolvconf_state.reset ();
|
||||
let buf =
|
||||
if String.(get buf (pred (length buf))) = '\n' then buf else buf ^ "\n"
|
||||
in
|
||||
let lexbuf = Lexing.from_string buf in
|
||||
Ok (Resolvconf_parser.resolvconf Resolvconf_lexer.lex lexbuf)
|
||||
with
|
||||
| Parsing.Parse_error ->
|
||||
Error (`Msg (Fmt.str "parse error at line %d" Resolvconf_state.(state.lineno)))
|
||||
| exn ->
|
||||
Error (`Msg (Fmt.str "error at line %d: %s" Resolvconf_state.(state.lineno)
|
||||
(Printexc.to_string exn)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue