Skip to content

will/tree-sitter-crystal

Repository files navigation

tree-sitter-crystal

A WIP tree-sitter grammar for Crystal.

Status

  • Comments
  • Literals
    • nil
    • bool
    • float
    • integer
    • symbol
    • char
    • string
      • literals
      • interpolation
    • array
    • hash
    • array-or-hash-index-access (foo[0] or foo[:something])
    • range
    • regex
    • tuple
    • namedtuple
    • proc
    • command
      • literals
      • interpolation
  • Assignment
    • to local var
    • to instance var
    • to class var
    • to constant
    • to "assignment methods"/properties
    • multiple-assignment
  • Binary operations
    • basic support
    • per-operator precedence definitions
  • Variables
    • local variables
    • instance variables
    • class variables
    • constants
  • Control expressions
    • if/else
      • "block-level" form (if something ; stuff ; else ; end)
      • "suffix" form (foo = bar if something)
    • unless
      • "block-level" form (unless something ; stuff ; else ; end)
      • "suffix" form (foo = bar unless something)
    • case
    • while
    • until
  • require statements
  • Type grammar
    • Basic "bare" types (e.g. Foo)
    • Namespaced types (e.g. Some::Namespace::Foo)
    • Generic types (e.g. Foo(T) and Foo(A, B))
    • Union types
    • Class definitions
    • Module definitions
      • include statements
    • Structs
    • Enums
    • Type annotations
      • in variable declarations
      • in method parameter declarations
      • as method return types
    • alias statements
  • Blocks
    • do blocks (with and without parameters)
    • {|x| whatever } blocks (with parameters only)
    • begin...rescue...end blocks
  • Method definitions
  • Method calls
  • "Bare" function calls (like puts 1 and puts(1))
  • Splats
    • in method calls
    • in method definitions
  • Macros
  • Annotations

Developing

To test tree-sitter generate && tree-sitter test (or just npm test)

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages