Commit Graph

10555 Commits (beacd69dd27f26bdb4c19c8806a786098ff05a06)
 

Author SHA1 Message Date
Wilfred Hughes 1d5b4e0055 Update mimalloc 2022-04-14 22:04:43 +07:00
Wilfred Hughes e45dc8f2ba Update to latest tree-sitter 2022-04-14 22:01:10 +07:00
Wilfred Hughes 279e4d72a9 Update to latest clap 2022-04-14 21:57:20 +07:00
Wilfred Hughes 480b9c05f9 Prefer `Janet` for the language name 2022-04-14 21:50:55 +07:00
Wilfred Hughes 9dce9e8618 Consistent language ordering 2022-04-14 21:50:03 +07:00
Wilfred Hughes e9d1f93848 Add TOML to language list 2022-04-14 21:49:06 +07:00
Alex Pinkus (Bot) bfde8a81c1 Use test-ci when validating generated grammar 2022-04-14 21:48:24 +07:00
Wilfred Hughes 12bc7f7de4 Tweak readme wording 2022-04-14 21:46:51 +07:00
Alex Pinkus (Bot) 9c6c2b41d2 0.2.0 release 2022-04-14 21:38:18 +07:00
Alex Pinkus 06250ce807 Commit generated grammar on an isolated branch
Certain consumers of tree-sitter do not wish to take a dependency on the
CLI in order to generate their grammars. Long-term, those consumers will
be able to use packaging systems like tspm or obtain grammars from
github actions. In the short term, though, not packaging the grammar
means that there is no way for them to consume it.

This creates a GitHub action that will push the static grammar to an
isolated branch of this repository, allowing those systems to use GitHub
as a kind of hosting system for grammar artifacts. We push the grammar
on creation of a new ref to keep the number of deltas relatively low.
2022-04-14 21:29:27 +07:00
Wilfred Hughes 18b1204b3a Rename Getting Started to Installation in the manual 2022-04-14 21:26:36 +07:00
Wilfred Hughes 6b24e28c28 Add support for TOML 2022-04-14 21:21:36 +07:00
Wilfred Hughes b9aa884d0a Add 'vendor/tree-sitter-toml/' from commit '8bd2056818b21860e3d756b5a58c4f6e05fb744e'
git-subtree-dir: vendor/tree-sitter-toml
git-subtree-mainline: 8a1484289f
git-subtree-split: 8bd2056818
2022-04-14 20:03:45 +07:00
Wilfred Hughes 8a1484289f cargo fmt 2022-04-14 18:46:16 +07:00
Wilfred Hughes 1a93162740 Fix block sclars in YAML 2022-04-14 18:45:48 +07:00
Sergio A. Vargas 71ecd1ec57
Refactor literals (#31)
* Create a separate rule for literals and move tests

- Create a rule for literals: numbers, characters, strings and commands
- Place tests for literals in separate file
- Create a `test/` directory and move `corpus/`

NOTE: All literals are indexable

* Update numeric literals

- Add binary and octal integer literals
- Add hexadecimal float literals

- Fix numbers allowing trailing underscores
- Fix hexadecimal prefix allowing uppercase `X`
- Fix coefficients allowing non-decimal bases
- Fix primitive types not allowing leading zeros

- Update tests

* Add escape sequences and unicode codepoints

* Refactor comments

- Rename `comment` to `line_comment`
- Split block comment scanner into a separate function

* Refactor string and command literals

- Add string interpolations
- Add prefixed command literals
- Add triple backquote command literals
- Remove backticks from valid string identifiers
- Distinguish between standard and non-standard string literals.
  non-standard strings cannot have interpolations.
- Update escape sequences
- Update tests

NOTE: The scanner uses a stack to keep track of string delimiters.

* generate and update scripts

- Do a shallow clone of examples (instead of cloning the whole repo).
- 6 files now parse correctly
2022-04-14 17:45:53 +07:00
Alex Pinkus (Bot) 1ded93fe49 Updating top repository version 2022-04-14 07:28:57 +07:00
Wilfred Hughes 47fe0cfc42 Add some more common keyword-ish capture names for highlighters 2022-04-14 00:40:09 +07:00
Wilfred Hughes b3872e6513 Add syntax highlighting and regression test for Kotlin 2022-04-14 00:38:44 +07:00
Wilfred Hughes 059fc824ff Add Kotlin support
Closes #220
2022-04-14 00:21:29 +07:00
Wilfred Hughes 600a4fb039 Add 'vendor/tree-sitter-kotlin/' from commit 'a4f71eb9b8c9b19ded3e0e9470be4b1b77c2b569'
git-subtree-dir: vendor/tree-sitter-kotlin
git-subtree-mainline: cbd93bc2ea
git-subtree-split: a4f71eb9b8
2022-04-14 00:05:02 +07:00
Wilfred Hughes cbd93bc2ea Update output examples for --dump-ts 2022-04-14 00:02:22 +07:00
Wsevolod 8e9dba7bd7
Handle `from_clause` in `export type` statement (#208) 2022-04-13 09:44:02 +07:00
Wilfred Hughes 92b3c6e932 Use clap's built-in env var feature
Fixes #239
2022-04-12 23:57:20 +07:00
the-mikedavis 1dabc1c790 Generate parser 2022-04-12 14:20:51 +07:00
Michael Davis 108cdd550f
allow only one stab clause without a right-hand-side
Only one stab clause in a multi-stab-clause expression may be empty.
Multiple is a syntax error.

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-04-12 09:16:45 +07:00
Michael Davis 662426cd85
handle stab clauses without right-hand-sides
Currently a stab clause without a right-hand-side is parsed as an error:

```elixir
Enum.map(xs, fn x ->
end)
```

And the `end` token ends up not being highlighted as a keyword. The
compiler gives a warning about this syntax but it comes up pretty
often when editing (writing a `case` block for example).

Implementation-wise, this might be a bug in tree-sitter? `prec.right`
seems to fight with error recovery when the rightmost token(s) are
`optional`.

```elixir
fn ->
end
```

gets parsed as

```scm
(anonymous_function
  (stab_clause
    right: (body (identifier)))
  (MISSING "end"))
```

although the `optional` should allow this case. I've seen this in
other grammars and it seems like the way around it is to replace
the `prec.right` with a conflict.
2022-04-11 19:23:22 +07:00
Alex Pinkus (Bot) 897df54ad1 Updating top repository version 2022-04-11 12:10:08 +07:00
Wilfred Hughes cf2a8544d0 Separate usage from installation in manual
Also document language overriding.
2022-04-10 16:18:19 +07:00
Wilfred Hughes 8dd639d4d4 Mention GitHub releases in manual 2022-04-10 16:09:28 +07:00
Wilfred Hughes db9ab874d8 Roll version 2022-04-10 16:00:31 +07:00
Wilfred Hughes f496da2d1e Difftastic is now available as GitHub releases
Closes #193
2022-04-10 15:58:42 +07:00
Wilfred Hughes 2a28bf6d54 Roll version to exercise release again 2022-04-10 15:39:25 +07:00
Wilfred Hughes 167bd65c15 cargo publish is now done by GitHub action 2022-04-10 15:39:02 +07:00
Wilfred Hughes 6a566b33f5 Use the same Rust version for release 2022-04-10 15:38:49 +07:00
Wilfred Hughes 43c50ae1bb Publish to crates.io from GitHub action too 2022-04-10 13:07:03 +07:00
Wilfred Hughes a43adb2f4b Document build fixes in 0.26.2 2022-04-10 13:00:14 +07:00
Wilfred Hughes a0ac25c69f Clarify action name 2022-04-10 12:54:24 +07:00
Wilfred Hughes 7a17daa64b Merge commit '99a2182dbe68dce338771ca673fccd14094719b0' 2022-04-10 12:51:52 +07:00
Wilfred Hughes 99a2182dbe Revert "scanner: use the same lookahead type throughout"
This reverts commit 734a4ccaed.
2022-04-10 12:51:15 +07:00
Wilfred Hughes c1bc2b6ad0 Test on all of Linux, Mac and Windows 2022-04-10 12:41:36 +07:00
Wilfred Hughes 18126be646 Next release will be 0.26.2 2022-04-10 12:41:22 +07:00
Wilfred Hughes 890c28a5ac Update changelog for 0.26.1 2022-04-10 12:39:15 +07:00
Wilfred Hughes 10cd0d45b0 Next release will be 0.26.1 2022-04-10 12:25:54 +07:00
Wilfred Hughes 5b56bbbc3c Skip changelog parsing for now 2022-04-10 12:23:59 +07:00
Wilfred Hughes 2d2c05b783 Basic release configuration using GitHub actions
Based on
https://github.com/marketplace/actions/build-and-upload-rust-binary-to-github-releases
2022-04-10 10:58:41 +07:00
Wilfred Hughes ff89ac3c75 Fix duplicate job name 2022-04-09 23:31:19 +07:00
Wilfred Hughes 99a49ea388 Run cargo check on macOS too 2022-04-09 23:29:21 +07:00
Wilfred Hughes 1830d286e0 Ensure unchanged MatchedPos have the same number on LHS and RHS
Fixes #246
2022-04-09 21:12:31 +07:00
Wilfred Hughes 1c9ae2fbc6 Fix parsing of built-in Zig identifiers
Fixes #248
2022-04-09 19:38:07 +07:00