Skip to content

Commit

Permalink
chore!: Standardize on lowercase gap everywhere.
Browse files Browse the repository at this point in the history
Bump version to 0.2.0.

BREAKING CHANGE: Tools previously using the `tree-sitter-gap` package
should now change the grammar name from `GAP` to `gap`.
  • Loading branch information
reiniscirpons committed May 26, 2024
1 parent fe82cbe commit 70b53e0
Show file tree
Hide file tree
Showing 19 changed files with 74 additions and 68 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "tree-sitter-GAP"
description = "GAP grammar for the tree-sitter parsing library"
version = "0.1.2"
name = "tree-sitter-gap"
description = "gap grammar for the tree-sitter parsing library"
version = "0.2.0"
authors = ["Max Horn", "Reinis Cirpons <[email protected]>"]
keywords = ["incremental", "parsing", "GAP", "GAP-system"]
keywords = ["incremental", "parsing", "gap", "gap-system"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/reiniscirpons/tree-sitter-GAP"
repository = "https://github.com/gap-system/tree-sitter-gap"
edition = "2021"
license = "MIT"
readme = "README.md"
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# tree-sitter-gap

[![Build/test](https://github.com/reiniscirpons/tree-sitter-gap/actions/workflows/ci.yml/badge.svg)](https://github.com/reiniscirpons/tree-sitter-gap/actions/workflows/ci.yml)
[![Build/test](https://github.com/gap-system/tree-sitter-gap/actions/workflows/ci.yml/badge.svg)](https://github.com/gap-system/tree-sitter-gap/actions/workflows/ci.yml)

[tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for [GAP system](https://www.gap-system.org/) files.

## Want to help complete this?

- Install `tree-sitter`, [official instructions](https://tree-sitter.github.io/tree-sitter/creating-parsers#installation);
- Install `tree-sitter` (version >= 0.22.2), [official instructions](https://tree-sitter.github.io/tree-sitter/creating-parsers#installation);
- Read ["how to create a parser"](https://tree-sitter.github.io/tree-sitter/creating-parsers);
- Make the existing tests pass;
- Resolve the TODOs in source and test files;
- Add more missing language features;
- Validate by running on the whole GAP library and on packages, see [Tests](#tests) section below.
- Validate by running on the whole `GAP` library and on packages, see [Tests](#tests) section below.

Files to edit are

Expand All @@ -27,7 +27,7 @@ Files to edit are

Almost everything else was generated automatically by `tree-sitter generate`.

Bits of the `GAP` syntax is documented in [Chapter 4](https://docs.gap-system.org/doc/ref/chap4_mj.html) of the GAP manual.
Bits of the `GAP` syntax are documented in [Chapter 4](https://docs.gap-system.org/doc/ref/chap4_mj.html) of the GAP manual.
A more in-depth look at the `GAP` grammar can be obtained by studying the `GAP-system` source files, especially

- [`read.c`](https://github.com/gap-system/gap/blob/master/src/read.c) for parsing keywords and high level language constructs;
Expand All @@ -39,7 +39,7 @@ A more in-depth look at the `GAP` grammar can be obtained by studying the `GAP-s
To run syntax tree and highlighting tests run

```
tree-sitter test
make test_quick
```

note that highlighting tests will only be run once all syntax tree tests pass.
Expand All @@ -62,7 +62,14 @@ parses.

### Issues finding grammar in external tools

Try specifying the grammar name as `GAP` all caps, instead of lowercase `gap`.
Try specifying the grammar name as lowercase `gap`, instead of uppercase `GAP`.

### Highlighting tests fail

Make sure you are using `tree-sitter` 0.22.2 or above. A breaking change in
highlight group priority was introduces with version 0.22.2, which means that
older versions of the `tree-sitter` tool will incorrectly highlight the
existing test files.

## Acknowledgements

Expand Down
2 changes: 1 addition & 1 deletion binding.gyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/go/binding.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bindings/go/binding_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/go/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions bindings/node/binding.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/python/tree_sitter_gap/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions bindings/rust/lib.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const LITERAL_REGEXP = {
};

module.exports = grammar({
name: "GAP",
name: "gap",

externals: ($) => [
$.string_start,
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "tree-sitter-gap",
"version": "0.1.2",
"description": "GAP grammar for tree-sitter",
"version": "0.2.0",
"description": "gap grammar for tree-sitter",
"keywords": [
"tree-sitter",
"parser",
"GAP",
"GAP-system"
"gap",
"gap-system"
],
"files": [
"grammar.js",
Expand All @@ -22,13 +22,13 @@
"Reinis Cirpons <[email protected]> (https://reinisc.id.lv)"
],
"license": "MIT",
"homepage": "https://github.com/reiniscirpons/tree-sitter-gap#readme",
"homepage": "https://github.com/gap-system/tree-sitter-gap#readme",
"bugs": {
"url": "https://github.com/reiniscirpons/tree-sitter-gap/issues"
"url": "https://github.com/gap-system/tree-sitter-gap/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/reiniscirpons/tree-sitter-gap.git"
"url": "git+https://github.com/gap-system/tree-sitter-gap.git"
},
"main": "bindings/node",
"types": "bindings/node",
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "tree-sitter-GAP"
description = "Gap grammar for tree-sitter"
version = "0.1.2"
name = "tree-sitter-gap"
description = "gap grammar for tree-sitter"
version = "0.2.0"
keywords = ["incremental", "parsing", "tree-sitter", "gap"]
classifiers = [
"Intended Audience :: Developers",
Expand All @@ -19,7 +19,7 @@ license.text = "MIT"
readme = "README.md"

[project.urls]
Homepage = "https://github.com/tree-sitter/tree-sitter-gap"
Homepage = "https://github.com/gap-system/tree-sitter-gap"

[project.optional-dependencies]
core = ["tree-sitter~=0.21"]
Expand Down
2 changes: 1 addition & 1 deletion setup.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions src/parser.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static inline bool skip_line_continuation(TSLexer *lexer) {
return true;
}

bool tree_sitter_GAP_external_scanner_scan(void *payload, TSLexer *lexer,
bool tree_sitter_gap_external_scanner_scan(void *payload, TSLexer *lexer,
const bool *valid_symbols) {
Scanner *scanner = (Scanner *)payload;

Expand Down Expand Up @@ -161,7 +161,7 @@ bool tree_sitter_GAP_external_scanner_scan(void *payload, TSLexer *lexer,
return false;
}

unsigned tree_sitter_GAP_external_scanner_serialize(void *payload,
unsigned tree_sitter_gap_external_scanner_serialize(void *payload,
char *buffer) {
Scanner *scanner = (Scanner *)payload;

Expand All @@ -170,7 +170,7 @@ unsigned tree_sitter_GAP_external_scanner_serialize(void *payload,
return size;
}

void tree_sitter_GAP_external_scanner_deserialize(void *payload,
void tree_sitter_gap_external_scanner_deserialize(void *payload,
const char *buffer,
unsigned length) {
Scanner *scanner = (Scanner *)payload;
Expand All @@ -180,12 +180,12 @@ void tree_sitter_GAP_external_scanner_deserialize(void *payload,
}
}

void *tree_sitter_GAP_external_scanner_create() {
void *tree_sitter_gap_external_scanner_create() {
Scanner *scanner = ts_calloc(1, sizeof(Scanner));
return scanner;
}

void tree_sitter_GAP_external_scanner_destroy(void *payload) {
void tree_sitter_gap_external_scanner_destroy(void *payload) {
Scanner *scanner = (Scanner *)payload;
free(scanner);
}

0 comments on commit 70b53e0

Please sign in to comment.