You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Closes#3.
Currently, only "top level" forms of a module are allowed at the beginning of the source_file rule, but this makes this tree-sitter not usable, for example, in Markdown code blocks.
Allowing any fragment of an expression makes this tree-sitter usable for other languages to inject Erlang code, for example, a new language in the Phoenix (Elixir) style, that embeeds Erlang code in HTML.
---
Notes:
1. The tree generated for fragmented code is `(source_file (...exprs))`. Maybe the tree as is today as `(source_file (...forms))` should be for a file/module structure and `(fragment (...exprs))` should be for fragmented parts of code
2. The term "fragment" is what comes to my mind, but could be any other
3. I'm not sure about the conflicts order introduced by this PR
---
## Before this PR

## After this PR

Pull Request resolved: #9
Test Plan:
Imported from GitHub, without a `Test Plan:` line.
- CI
- cd tree-sitter-erlang
- make
Ensure all tests pass, and no generated files change
- cd ..
- cargo xtask codegen
Check that no checked in files change
- Compare lint output before and after
```
cargo run --bin elp -- lint --project ~/fbsource/whatsapp/server/erl --include-erlc-diagnostics --include-edoc-diagnostics --read-config --include-tests --include-ct-diagnostics &> /tmp/run-elp-lint.txt
```
Check out master
```
cargo run --bin elp -- lint --project ~/fbsource/whatsapp/server/erl --include-erlc-diagnostics --include-edoc-diagnostics --read-config --include-tests --include-ct-diagnostics &> /tmp/run-elp-lint-master.txt
```
`diff /tmp/run-elp-lint.txt /tmp/run-elp-lint-master.txt` should show no differences
Reviewed By: michalmuskala
Differential Revision: D69120163
Pulled By: alanz
fbshipit-source-id: 73f02ac6b61dbd0bec100d2dcfaa52b7694304cb
0 commit comments