Skip to content

S-H-GAMELINKS/kanayago

Repository files navigation

Kanayago(金屋子)

Trying to Make Ruby's Parser Available as a Gem.

Support Ruby version

Kanayago(金屋子) is supported Ruby 3.4 or Ruby head.

Installation

From RubyGems

gem install kanayago

Build and Install in local

First, clone this repository.

git clone https://github.com/S-H-GAMELINKS/kanayago.git

Move kanayago directory, and run bundle install.

cd kanayago && bundle install

Finally, build Kanayago gem and install it.

bundle exec rake build
gem install pkg/kanayago-0.1.0.gem

Usage

require 'kanayago/kanayago'

result = Kanayago.parse('117 + 117')
# => #<Kanayago::ScopeNode:0x00007f522199c5a8>

p result.body
# => #<Kanayago::OperatorCallNode:0x00007f5221b06358>

p result.body.recv
p result.body.recv.val
# => #<Kanayago::IntegerNode:0x00007f5221b06330>
# => 117

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/S-H-GAMELINKS/kanayago.

Referenced implementations

yui-knk/ruby-parser

License

The gem is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published