1 unstable release

Uses old Rust 2015

0.0.2 May 8, 2017

#166 in #lua


Used in llang

MIT/Apache

60KB
1K SLoC

nom-lua travis-badge appveyor-badge coveralls-badge license-badge docs-badge

Lua 5.3 parser written with nom

Syntax

  • chunk (needs tests)
  • block
  • stat
    • ";"
    • varlist = explist
    • functioncall (deps functioncall)
    • label
    • "break"
    • goto
    • do end
    • while
    • repeat until
    • if
    • for
    • for in
    • function (deps funcname)
    • local function
    • local
  • retstat (needs tests)
  • label
  • varlist (deps var)
  • var
  • namelist (needs tests)
  • explist (needs tests)
  • exp (needs tests)
    • Numeral
    • Nil
    • Bool
    • LiteralString
    • "..."
    • functiondef
    • prefixexp
    • tableconstructor
    • op
  • prefixexp (needs to be finished)
  • functioncall (deps args, prefixexp)
  • args (deps explist, tableconstructor, LiteralString)
  • funcname
  • functiondef
  • funcbody
  • parlist
  • tableconstructor (needs tests)
  • fieldlist (needs tests)
  • field
  • fieldsep
  • Binop (percedence error)
  • Unop
  • Name
  • Numeral
    • Digit
    • Hex Digit
    • Float
    • Hex Float
  • LitrealString
    • Short Literal
      • linebreaks
      • byte
      • unicode
      • escape
      • '\z'
    • Literal

TODO

  • Different integer and floating point values (i32, f32)
  • Better syntax errors
  • Fallback to floats on overflow
  • Benchmarks
  • Fuzzing
  • Change tests to fail instead of panicking
  • Enforce ASTNodes correctness on more operations For example, BinOp could take a BinOp enum instead of ASTNode
  • Build all features on CI

License

nom-lua is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Dependencies

~695KB
~14K SLoC