BlindingDark / tree-sitter-elixir

Tree Sitter grammar for Elixir

Home Page:https://tuxified.github.io/tree-sitter-elixir/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tree-sitter-elixir

Build Status

Elixir grammar for tree-sitter, you can try it out in the playground.

References

Status

Current status (not mentioned parts are not implemented):

map

  • empty
  • with one key and value
  • with many keys and values
  • error

struct

  • empty
  • with one key and value
  • with many keys and values
  • error with string key

bitstring

  • empty
  • with integer
  • with integer and type-specifier
  • with integer and multiple type-specifier
  • with integer and bit-pattern size
  • with integer and bit-pattern size and type-specifier
  • with integer and bit-pattern size and multiple type-specifiers
  • with float
  • with float and type-specifier
  • with float and multiple type-specifier
  • with float and bit-pattern size
  • with float and bit-pattern size and type-specifier
  • with float and bit-pattern size and multiple type-specifiers
  • with string
  • with many components

boolean

  • Boolean

number

  • Integer
  • Negative
  • Integer Multi Digits
  • Integer With Underscore
  • Binary Integer
  • Binary Integer With Underscore
  • Hex Integer
  • Hex Integer With Underscore
  • Octal Integer
  • Octal Integer With Underscore
  • Float
  • Float large
  • Float With Underscore
  • Float With Underscore + Scientific Notation
  • Float With Underscore + Scientific Notation 2
  • Float negative
  • Float with negative exponential/scientific notation

module_attribute

  • moduledoc attribute

atom

sigil

  • empty
  • string
  • braced
  • multiline
  • regex with modifier
  • only single char sigil

module_functions

  • zero arity function
  • zero arity function with parens
  • single arity function
  • plural arity function
  • short hand function

string

  • String - Single line
  • String - Single line with escaped double quote
  • String - Multi Line
  • String - Concatenation
  • String - Multi Line with internal double quotes

list

  • List - Empty list
  • List With Elements
  • List - Error
  • List - Trailing Separator

module

  • Module with atom
  • Module with Elixir uppercase atom

tuple

  • Tuple
  • Tuple - Error
  • Tuple - Trailing Separator

Anonymous Functions

  • without args
  • multiple clauses
  • multiple clauses with guard

variable

  • snake_case
  • camelCase
  • ends in ?
  • ends in !

keyword_list:

  • Keyword empty list
  • Keyword list shorthand syntax
  • Keyword list tuple syntax
  • Keyword list error - shorthand before tuple syntax
  • Keyword list mixed - tuples + shorthand

charlist

  • Charlist - Single line
  • Single line with escaped quote
  • Charlist - Multi line
  • Charlist - Multi line with internal quote
  • Char - Single
  • Char - list

string_interpolation

  • basic
  • with operator
  • with text
  • in mutil line strings
  • interpolating strings in strings
  • interpolating strings in strings with operator

operators

  • Unary operators
  • Operators with left associativity
  • op right associativity

for_comprehension

  • For - list generator
  • For - bistring generator
  • For - filter tuple
  • For - square list
  • For - with options (into:, reduce: , unique: )

TODO

  • tests, tests, tests
  • use, import, require and other macro/function calls in module body?
  • function capture (&Enum.map/2)
  • pipe operator (does it need special treatment?)
  • doctest (# iex> ... ) ?
  • elaborate flow control (if+else, with)
  • default arguments & function heads without body; def a(b, c \ [])
  • records?
  • fix difference between alias (Modulename) & others things like qualified function calls
  • optional parens (ex. function calls)
  • optional semicolon
  • anonymous function calls ( fib.(4) )
  • bugfixes, edge cases, bugfixes....

About

Tree Sitter grammar for Elixir

https://tuxified.github.io/tree-sitter-elixir/

License:MIT License


Languages

Language:C 99.2%Language:JavaScript 0.7%Language:Rust 0.1%Language:C++ 0.0%Language:Python 0.0%