All Projects → LPGhatguy → mab

LPGhatguy / mab

Licence: other
Style-preserving Lua parser in Rust

Programming Languages

rust
11053 projects
lua
6591 projects

Projects that are alternatives of or similar to mab

unimport
unimport is a Go static analysis tool to find unnecessary import aliases.
Stars: ✭ 64 (+357.14%)
Mutual labels:  static-analysis
gotcha
Go Taint CHeck Analyser
Stars: ✭ 40 (+185.71%)
Mutual labels:  static-analysis
constyble
CSS complexity linter
Stars: ✭ 92 (+557.14%)
Mutual labels:  static-analysis
phpstan-dba
PHPStan based SQL static analysis and type inference for the database access layer
Stars: ✭ 163 (+1064.29%)
Mutual labels:  static-analysis
save
Universal test framework for cli tools [mainly for code analyzers and compilers]
Stars: ✭ 33 (+135.71%)
Mutual labels:  static-analysis
shell-linter
A Github Action for ShellCheck
Stars: ✭ 58 (+314.29%)
Mutual labels:  static-analysis
deps-infer
Infer mvn deps from sources
Stars: ✭ 36 (+157.14%)
Mutual labels:  static-analysis
haros
H(igh) A(ssurance) ROS - Static analysis of ROS application code.
Stars: ✭ 168 (+1100%)
Mutual labels:  static-analysis
twly
Wanna get DRY? Static analysis tool for detecting repeat code.
Stars: ✭ 42 (+200%)
Mutual labels:  static-analysis
r2frida-book
The radare2 + frida book for Mobile Application assessment
Stars: ✭ 38 (+171.43%)
Mutual labels:  static-analysis
eslint-plugin-vue-scoped-css
ESLint plugin for Scoped CSS in Vue.js
Stars: ✭ 58 (+314.29%)
Mutual labels:  static-analysis
intercept
INTERCEPT / Policy as Code Static Analysis Auditing / SAST
Stars: ✭ 54 (+285.71%)
Mutual labels:  static-analysis
CKS-Exercises-Certified-Kubernetes-Security-Specialist
A set of curated exercises to help you prepare for the CKS exam
Stars: ✭ 124 (+785.71%)
Mutual labels:  static-analysis
phpstan.el
Interface to PHPStan (PHP static analyzer)
Stars: ✭ 22 (+57.14%)
Mutual labels:  static-analysis
firehose
Interchange format for results for static analysis tools
Stars: ✭ 62 (+342.86%)
Mutual labels:  static-analysis
go-mnd
Magic number detector for Go.
Stars: ✭ 153 (+992.86%)
Mutual labels:  static-analysis
aura
Python source code auditing and static analysis on a large scale
Stars: ✭ 101 (+621.43%)
Mutual labels:  static-analysis
XmlDocInspections
Configurable XML Doc warnings for ReSharper
Stars: ✭ 25 (+78.57%)
Mutual labels:  static-analysis
Cpp2IL
Work-in-progress tool to reverse unity's IL2CPP toolchain.
Stars: ✭ 689 (+4821.43%)
Mutual labels:  static-analysis
tiro
TIRO - A hybrid iterative deobfuscation framework for Android applications
Stars: ✭ 20 (+42.86%)
Mutual labels:  static-analysis

Mab, a Lossless Lua Parser in Rust


No Longer Maintained

Check out Full Moon instead, mab's successor!


This is a work in progress lossless Lua 5.1+ parser written in Rust. It will preserve all comments, whitespace, and style distinctions like quotes and escaping.

I want to use Mab for a number of future projects:

  • Static analysis tool to replace luacheck
  • Style checker and reformatter like gofmt or rustfmt (maybe named "Stylua")
  • Static typing like TypeScript or Flow
  • Documentation parser/generator like Rustdoc, more robust than LDoc
  • A tool like Google's Rerast for Rust or Facebook's codemod

Goals

  • PUC-Rio Lua 5.1+, LuaJIT 2.0+ support
    • Optionally validate against specific versions of Lua by casting between ASTs
  • 100% style and whitespace preservation
    • You should be able to read and overwrite your entire project and have zero changes
  • Foundation for static analysis and strong typing
  • Support for language extensions without breaking existing tools
    • The AST should be able to cast to any normal version of Lua
    • The project should either:
      • Leverage Rust's type system (non-exhaustive patterns, especially) to guarantee that tools can be recompiled with forks of this project with zero changes.
      • Or, use a technique similar to an Entity Component System to implement extended tokens and AST nodes.

Contributing

Contributions are welcome -- there is a lot of work to be done!

Mab supports Rust 1.26 stable and newer.

There is already a fairly sizable test suite implemented as a "parse by example" system. Test file inputs are located in parse_examples/source.

The test runner (cargo test) will read, tokenize, and parse these source files and check the last-known good results folder (parse_examples/results) to see if they match what they did before.

If you're making changes that modify the parser's AST, delete the corresponding serialized token list and AST JSON files. When you run the test runner next, it will generate files that should be manually reviewed and submitted alongside your change. Git's diff viewer can help identify if what was changed was intentional.

Be careful with line endings when developing on Windows. The repository has a .editorconfig file as well as a .gitattributes file to try to guarantee that all Lua files have LF line endings as opposed to CRLF. Checking in a parse by example token list with CRLF line endings baked into it will cause CI to fail.

License

This project is available under the terms of The Mozilla Public License, version 2.0. Details are available in LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].