lib-ruby-parser (C++ bindings)
4.0.1+ruby-3.1.1
C++ bindings for lib-ruby-parser library
|
lib-ruby-parser
All classes/methods are defined under lib_ruby_parser
namespace. API mostly mirrors Rust version.
Pre-compiled libraries and header files are available on Releases, supported platforms:
x86_64-apple-darwin
x86_64-unknown-linux-gnu
x86_64-pc-windows-msvc
ParserResult
contains the following fields:
Node* ast
- potentually nullable AST, tagged enumTokenList tokens
- list of tokensDiagnosticList diagnostics
- list of diagnosticsCommentList comments
- list of commentsMagicCommentList magic_comments
- list of magic commentsDecodedInput input
- decoded inputAll node classes fully match node structs of the original Rust implementation. You can check full documentation (nodes
module)
TARGET
(e.g. export TARGET=x86_64-apple-darwin
, no default value)CXX
(e.g. g++
)BUILD_ENV
(debug
or release
, debug
is the default value)make tests/run
to run testsmake libruby_parser_cpp.a
(or make libruby_parser_cpp.lib
for MSVC) to get a static librarymake lib-ruby-parser.hpp
to get a header filebuild.mk
file that is included my the main Makefile
ruby-parser-cpp
.*.{hpp, cpp}
files in the root directoryscripts
directory contains per-triplet additional configurations for make
codegen
directory is a Rust micro-library that does code generationbenchmark
directory contains a set of scripts to compare performance of Rust vs C++ vs Ripper