ruby/prism là dự án mã nguồn mở trên GitHub với 1.0k sao, viết chủ yếu bằng C. Prism Ruby parser
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This is a parser for the Ruby programming language. It is designed to be portable, error tolerant, and maintainable. It is written in C99 and has no dependencies.
Getting started
To compile the parser, you will need:
C99 compiler
GNU make
Ruby 2.7.0 or later
Once you have these dependencies, run:
bundle install
to fetch the Ruby dependencies. Finally, run:
bundle exec rake compile
to compile the parser. It will be built in the build directory. To test that everything is working, run:
bin/parse -e "1 + 2"
to see the syntax tree for the expression 1 + 2.
Overview
The repository contains the infrastructure for both a shared library (libprism) and a native CRuby extension. The shared library has no bindings to CRuby itself, and so can be used by other projects. The native CRuby extension links against ruby.h, and so is suitable in the context of CRuby.
.
├── Makefile configuration to compile the shared library and native tests
├── Rakefile configuration to compile the native extension and Ruby tests
├── bin
│ ├── lex runs the lexer on a file or string and prints the tokens
│ ├── parse runs the parse on a file or string and prints the AST
│ └── prism a CLI for development and debugging
├── config.yml specification for tokens and nodes in the tree
├── doc documentation website
├── docs markdown documentation about the project
├── ext
│ └── prism
│ ├── extconf.rb configuration to generate the Makefile for the native extension
│ └── extension.c the native extension that interacts with libprism
├── gemfiles gemfiles used by different Ruby versions in CI
├── include
│ ├── prism header files for the shared library
│ └── prism.h main header file for the shared library
├── java
| ├── api Java API for Prism
| ├── native Java native bindings for the shared library
| └── wasm Java WASM bindings for the shared library
├── javascript JavaScript WASM bindings for the shared library
├── lib
│ ├── prism Ruby library files
│ └── prism.rb main entrypoint for the Ruby library
├── rakelib various Rake tasks for the project
├── rbi RBI type signatures for the Ruby library
├── rust
│ ├── ruby-prism Rustified crate for the shared library
│ └── ruby-prism-sys FFI binding for Rust
├── sample
│ └── prism Sample code that uses the Ruby API for documentation purposes
├── sig RBS type signatures for the Ruby library
├── src
│ └── prism.c main entrypoint for the shared library
├── templates contains ERB templates generated by templates/template.rb
│ └── template.rb generates code from the nodes and tokens configured by config.yml
└── test
├── cpp tests for the C++ bindings
├── embedded smoke test for bare-metal targets
├── fuzz files related to fuzz testing
└── prism
├── fixtures Ruby code used for testing
└── snapshots snapshots of generated syntax trees corresponding to fixtures
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/ruby/prism là nguồn chính thức.
ruby/prism có phải mã nguồn mở không?
Có — ruby/prism phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/ruby/prism.
ruby/prism là gì?
ruby/prism (ruby/prism) là dự án C trên GitHub. Theo mô tả gốc: Prism Ruby parser
Đọc đầy đủ README ở tab phía trên.
Chưa chắc prism có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về prism.