Git Product home page Git Product logo

yarp's Introduction

Yet Another Ruby Parser

This is an early work-in-progress project geared at replacing the existing CRuby parser. Its aims are threefold:

  • Portability - we want the ability to use this parser in other projects, implementations, and tools.
  • Error tolerance - we want this parser to be able to recover from as many syntax errors as possible.
  • Maintainability - we want this to be a long-standing projects with good hygiene. This means tutorials, examples, documentation, clean code, good test coverage, etc.

Background

This link is where you can find the design document for the project. It is also a work-in-progress, but should give you a good sense of the overall goals and motivations.

There are many parsers that have been built before in various stages of upkeep. Below is a list of the ones I have read through and found useful:

There are also a couple of tools that define node shapes for every kind of node in the Ruby syntax tree. I've taken inspiration from those tools as well. They include most of the parsers above, as well as:

Overview

The repository contains the infrastructure for both a shared library (librubyparser) and a native Ruby extension. The shared library has no bindings to Ruby itself, and so can be used by other C libraries. The native Ruby extension links against ruby.h, and so is suitable in the context of Ruby.

.
├── Makefile              configuration to compile the shared library and native tests
├── Rakefile              configuration to compile the native extension and run the Ruby tests
├── bin
│   ├── template          generates code from the nodes and tokens configured by config.yml
│   └── templates         directory containing all of the various templates
├── config.yml            specification for tokens and nodes in the tree
├── ext
│   └── yarp
│       └── extension.c   the native extension that interacts with librubyparser
├── lib
│   ├── yarp              support files for the Ruby library
│   └── yarp.rb           main entrypoint into the Ruby library
├── src
│   ├── yarp.c            main entrypoint into the shared library
│   └── yarp.h            main header file for the shared library
└── test                  Ruby tests for the Ruby library

Contributing

See the CONTRIBUTING.md file for more information. We additionally have documentation about the overall design of the project as well as various subtopics.

VSCode Extension

See the vscode/README.md file for more information and installation instructions.

yarp's People

Contributors

adisonlampert avatar ajshepley avatar andrykonchin avatar andyw8 avatar bitwise-aiden avatar ccocchi avatar chrisseaton avatar dependabot[bot] avatar dmitrytsepelev avatar dorianmariefr avatar drbragg avatar egiurleo avatar enebo avatar eregon avatar fncontroloption avatar haldun avatar hparker avatar iliabylich avatar jemmaissroff avatar kddnewton avatar max-leopold avatar nevans avatar nirvdrum avatar paracycle avatar rafaelfranca avatar tenderlove avatar vinistock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.