package lua_parser

  1. Overview
  2. Docs
A Lua 5.2 Parser

Install

Dune Dependency

Authors

Maintainers

Sources

1.0.0.tar.gz
md5=040b79da95d5dbe7d5d2ecc03320b72e
sha512=537e2b38bf8590e9fc4592f4e39a6a8ad3029693e6b052376d342c13be9349fa4db3d3a2557e7ffaeb6580ad929d681271d951d0b619d3c6ca448042412e4a74

doc/src/lua_parser.lib/parse.ml.html

Source file parse.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(*
 The MIT License                                                                                                                                 
                                                                                                                                                 
 Copyright (c) 2020 Jason D. Nielsen <drjdnielsen@gmail.com>
 *)

open Lexer_utils

let parse_with_error lexbuf =
  try Parser.prog Lexer.tok lexbuf
  with Parser.Error -> failwith (pspos lexbuf)

let parse_from_chan chan =
  let lexbuf = Lexing.from_channel chan in
  parse_with_error lexbuf

let parse_from_string str =
  let lexbuf = Lexing.from_string str in
  parse_with_error lexbuf
OCaml

Innovation. Community. Security.