Commit Graph

10992 Commits (026b2674d09dbc5cd279e769902387c95b6a126d)
 

Author SHA1 Message Date
Wilfred Hughes 84dfcd8b5b Only consider the first 1,000 bytes in binary file detection
This is sufficient, and we were spending a lot of time in this
function in the sample files from #297.
2022-06-12 23:45:00 +07:00
Maksim Novikov 5340f94f45
Add initial support of TRUNCATE statement
Extend support of COMMENT and INSERT
2022-06-12 16:29:43 +07:00
Maksim Novikov 2685131425
Improve support of INSERT, COMMENT expressions 2022-06-12 16:10:27 +07:00
Maksim Novikov 2bce477da0
Add COMMENT ON statement support 2022-06-12 15:50:06 +07:00
Maksim Novikov aabbcf3fe3
Add support for more statements
* ALTER SCHEMA
* ALTER TABLE ... OWNER TO ...
* CREATE EXTENSION ... [SCHEMA, VERSION, CASCADE]
* CREATE FUNCTION LANGUAGE as quoted string
2022-06-12 15:28:30 +07:00
Maksim Novikov 14e8ba8839
Support double quote escaping in strings 2022-06-12 14:48:49 +07:00
Maksim Novikov c3d3b38557
Intorduce external parser for dollar quoted strings
PostgreSQL supports stings of the following format $TAG$mycontent$TAG$
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING

These strings often used to define a function body.
2022-06-12 11:03:02 +07:00
Max Novikov 2ec2fedbb3
Merge pull request #25 from m-novikov/m-novikov-insert
Add transaction statements and imrove existing statements support
2022-06-11 22:57:56 +07:00
Maksim Novikov 5378bc74cc
Quoted nested names support
Co-authored-by: Tim Luo <shiwen@merico.dev>
2022-06-11 22:43:59 +07:00
Maksim Novikov 736b7e7539
Interpret function body as string
Building syntax tree should be solved via language injection
https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection
2022-06-11 16:17:13 +07:00
Maksim Novikov 7ccb93e4cc
Transaction statements 2022-06-11 16:01:54 +07:00
Maksim Novikov 7335711c4f
Improve CREATE INDEX support 2022-06-11 16:01:53 +07:00
Maksim Novikov a21f3d2587
Extend INSERT and ALTER TABLE support 2022-06-11 16:01:20 +07:00
Max Novikov dbd2fcfeae
Merge pull request #24 from m-novikov/math-expressions
Improve mathematical expressions support
2022-06-11 11:11:03 +07:00
Maksim Novikov 0d3cde974e
Improve mathematical expressions support
Co-authored-by: Tim Luo <shiwen@merico.dev>
2022-06-11 11:06:08 +07:00
Max Novikov 05ebda7cd8
Merge pull request #23 from m-novikov/m-novikov-update-deps
Update dependencies
2022-06-11 08:41:50 +07:00
Maksim Novikov 1a25ff8262
Update dependencies 2022-06-11 08:37:28 +07:00
Christian Frøystad 363cd0d05f Fixes bugs in heredoc implementation 2022-06-09 20:46:01 +07:00
Christian Frøystad 56af3f2321 Adds a new string_value node to solve #122 and restore consistency after the introduction of encapsed strings 2022-06-09 12:24:08 +07:00
Christian Frøystad b5b2cdbfb5 Adds support for interpolated strings to HEREDOC and adds structure to
the result
2022-06-09 12:21:56 +07:00
Wilfred Hughes e369f5b53f Mention performance improvements 2022-06-09 10:19:20 +07:00
Wilfred Hughes dd80e58640 Roll version 2022-06-09 10:12:46 +07:00
Michael Davis 7b7628230e
add integration test CI (#32) 2022-06-08 18:32:26 +07:00
Patrick Thomson a935608722 Ensure external_scanner_scan returns false for unrecognized tokens
I noticed that clang++ warned here: 
```
deps/tree-sitter-gleam/src/scanner.c:28:1: warning: non-void function does not return a value in all control paths
```

An explicit return fixes things up.
2022-06-08 17:32:27 +07:00
Michael Davis a2e5b69f51 Generate parser 2022-06-08 03:55:36 +07:00
Michael Davis 8bde531227
parse floats with no trailing digits (#31)
floats may have a trailing dot with no trailing digits, like in
the float stdlib module:

    pub fn absolute_value(x: Float) -> Float {
      case x >=. 0. {
        True -> x
        _ -> 0. -. x
      }
    }
2022-06-07 23:55:19 +07:00
Kolja Lampe a9a8efad44 Prepare 5.6.0 2022-06-07 23:23:33 +07:00
dependabot[bot] ca0a13f1ac
Bump regex from 1.5.4 to 1.5.6 (#81)
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.4 to 1.5.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.4...1.5.6)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-06 23:15:37 +07:00
Antonio Ochoa Solano 67bdb848ab
Simplify embedded_braced_expression (#29)
* Simplify embedded_braced_expression

* Separate heredoc variables in almost test

* Add external node _embedded_opening_brace

* Update build files

Co-authored-by: David Frankel <42774874+frankeld@users.noreply.github.com>
2022-06-06 11:50:53 +07:00
nsfisis 866e4a1557 Adds support for constructor property promotion with readonly modifiers 2022-06-06 09:18:54 +07:00
Yoann Padioleau 140c96cf39
Merge pull request #50 from stumash/val-decl-start-lambda
allow val def at start of lambda
2022-06-06 08:54:55 +07:00
Michael Hoffmann a4164c4086
playground: fix typo 2022-06-05 12:46:00 +07:00
Michael Hoffmann 236e5b286f playground: initial version 2022-06-05 12:41:49 +07:00
Michael Hoffmann 73932c360b
examples: add a corpus of real world examples crawled from github 2022-06-05 10:40:39 +07:00
Christian Frøystad b9b719ded9 Fixes #133 - Incorrect precedence for error supression operator 2022-06-03 11:07:03 +07:00
Michael Hoffmann 4ff21306a7
changelog: mark as released 2022-06-02 20:13:06 +07:00
Michael Hoffmann a87b709739 fix: allow empty string literals 2022-06-02 20:12:15 +07:00
resolritter 1b3ba31c75
Fix extends (#204)
* support extends (abstract)

* regenerate parser

Co-authored-by: resolritter <resolritter@users.noreply.github.com>
2022-06-02 09:10:56 +07:00
Christian Frøystad fdbef3621b Adds support for the never return type from the no_return RFC 2022-06-01 15:02:43 +07:00
Max Brunsfeld dafcef7943 Use node 16 on CI 2022-05-31 14:13:03 +07:00
Sergio A. Vargas fc60b7cce8
Update operators and identifiers (#34)
- Add more operator types:
  - Bitshift
  - Rational
  - "Dotty"
- Fix unary operators:
  - Add broadcasting dots
  - Allow unary operators as variables
  - Parse <unary-op><array> as a unary_expression (not an index
    expression)
- Fix pipe typos (femtolisp uses pipes as raw symbol delimiters).
- Simplify `binary_expression` rule.
- Make assignment, binary and unary operators visible. Operators that
  have their own rules (pair, range) are not made visible.
- Use unicode categories instead of character ranges for valid
  identifiers. It allows more characters, and removes some invalid ones.
- Update tests.
2022-05-31 14:11:51 +07:00
Max Brunsfeld 03b5a92cb0 Use node 16 on CI 2022-05-31 14:07:03 +07:00
Max Brunsfeld d078a2ef7b Add GH actions status badge to README 2022-05-31 14:02:19 +07:00
Max Brunsfeld e8a1974645 Add GH actions config 2022-05-31 13:58:42 +07:00
Christian Frøystad 20b20d8d77 Adds support for first class callable syntax 2022-05-31 22:42:04 +07:00
Christian Frøystad 5bb176f547 Fixes bug #131 - Parse error when using self as constant 2022-05-31 18:35:47 +07:00
Ben Martineau 725f60e8fb
fix: not operator precedence (#166)
* test: demonstrate incorrect precedence

* test: not precedence in other scenarios

* fix: match not operator precedence in python
2022-05-31 08:50:50 +07:00
Sjoerd Langkemper b2e0b03b32 Parse readonly properties
E.g.
```
class A {
   public readonly string $prop;
}
```
2022-05-31 14:33:46 +07:00
Damien Guard 9c494a503c
Various fixes (#226)
* Remove label_name not in official grammar"

* Add some missing fields

* Fix lambda modifiers
2022-05-30 17:23:01 +07:00
Lukas Pistrol 49716ffc11
add spm support (#227) 2022-05-30 16:39:02 +07:00