https://github.com/danielgatis/go-ruby-prism
The Ruby Prism parser bindings to GO (without cgo)
https://github.com/danielgatis/go-ruby-prism
Last synced: about 1 year ago
JSON representation
The Ruby Prism parser bindings to GO (without cgo)
- Host: GitHub
- URL: https://github.com/danielgatis/go-ruby-prism
- Owner: danielgatis
- License: mit
- Created: 2024-03-14T00:47:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-13T21:19:39.000Z (over 1 year ago)
- Last Synced: 2025-03-30T10:11:15.719Z (about 1 year ago)
- Language: Go
- Size: 1.79 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# go-ruby-prism
[](https://goreportcard.com/report/github.com/danielgatis/go-ruby-prism)
[](https://raw.githubusercontent.com/danielgatis/go-ruby-prism/master/LICENSE)
[](https://godoc.org/github.com/danielgatis/go-ruby-prism)
The go-ruby-prism is package that leverages the Ruby Prism parser compiled to WebAssembly for parsing Ruby code without the need for CGO.
## Features
- **CGO-Free**: Go-Ruby-Prism utilizes the [Ruby Prism parser](https://github.com/ruby/prism) compiled to WebAssembly, eliminating the need for CGO bindings.
- **Simplified Integration**: Seamlessly integrate Ruby code parsing into your Go applications with minimal setup.
- **High Performance**: Harnesses the efficiency of WebAssembly for speedy and efficient parsing of Ruby code.
- **Cross-Platform**: Works across various platforms supported by Go, ensuring compatibility in diverse environments.
## Usage
Here's a basic example demonstrating how to use this package:
```go
package main
import (
"context"
"fmt"
parser "github.com/danielgatis/go-ruby-prism/parser"
)
func main() {
ctx := context.Background()
p, _ := parser.NewParser(ctx)
source := "puts 'Hello, World!'"
result, _ := p.Parse(ctx, source)
fmt.Println(result)
}
```
You can find more examples in the examples folder.
## License
Copyright (c) 2024-present [Daniel Gatis](https://github.com/danielgatis)
Licensed under [MIT License](./LICENSE.txt)