NOTE: This repository is no longer maintain. Please use https://github.com/elixir-lang/tree-sitter-elixir which's a tree-sitter implementation maintained by Elixir Team.
Elixir grammar for tree-sitter, you can try it out in the playground.
- Elixirs parser
- Tree sitter Erlang by @ostera
- IntelliJ Elixir plugin by @kronicdeth
Current status (not mentioned parts are not implemented):
- empty
- with one key and value
- with many keys and values
- error
- empty
- with one key and value
- with many keys and values
- error with string key
- 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
- 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
- moduledoc attribute
- Atom - Unquoted
- Atom - Operator
- Atom - Quoted
- Atom - Unicode support (depends on tree-sitter/tree-sitter#95)
- empty
- string
- braced
- multiline
- regex with modifier
- only single char sigil
- zero arity function
- zero arity function with parens
- single arity function
- plural arity function
- short hand function
- String - Single line
- String - Single line with escaped double quote
- String - Multi Line
- String - Concatenation
- String - Multi Line with internal double quotes
- List - Empty list
- List With Elements
- List - Error
- List - Trailing Separator
- Module with atom
- Module with Elixir uppercase atom
- Tuple
- Tuple - Error
- Tuple - Trailing Separator
- without args
- multiple clauses
- multiple clauses with guard
- snake_case
- camelCase
- ends in ?
- ends in !
- Keyword empty list
- Keyword list shorthand syntax
- Keyword list tuple syntax
- Keyword list error - shorthand before tuple syntax
- Keyword list mixed - tuples + shorthand
- Charlist - Single line
- Single line with escaped quote
- Charlist - Multi line
- Charlist - Multi line with internal quote
- Char - Single
- Char - list
- basic
- with operator
- with text
- in mutil line strings
- interpolating strings in strings
- interpolating strings in strings with operator
- Unary operators
- Operators with left associativity
- op right associativity
- For - list generator
- For - bistring generator
- For - filter tuple
- For - square list
- For - with options (into:, reduce: , unique: )
Tree-sitter aims to be a tool to easily produce a fast, embeddable parser for tools like syntax highlighting in editors, more richer diff analysis in GitHub and code (security) analysers. As LSP is a tool meant to be used by all editors and for all languages, such is Tree-sitter when it comes to parsers.
Lots of the syntax has already been done, but there's also lots to be done. In case you want a taste, take it for a spin on the playground
- Try it out, see if you find bugs which are not part of the issues list (amd report them plz)
- If you have time and like to code: take a look at the issues list and call dibs on one
- If you see spelling mistakes, would like to make the playground better in any way or think you can improve this project in any other way, feel free to reach out (either via issues or in private)
Feel free to open an issue or post it on Elixir Forum with your question. :)