go-ruby-prism

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: MIT

README

go-ruby-prism

Go Report Card License MIT Go Doc

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 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:

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

Licensed under MIT License

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL