Skip to content

Commit

Permalink
Merge pull request #11 from stonemaster/master
Browse files Browse the repository at this point in the history
Update dependencies and fix compiler errors with recent DMD (v2.109.9)
  • Loading branch information
aminya authored Jul 12, 2024
2 parents 7335a6d + 319e77a commit 8014f88
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2022
- macos-11.0
- macos-13
d:
- "ldc-1.28.1"
- "dmd-2.098.1"
- "ldc-1.38.0"
- "dmd-2.109.1"
clang:
- 13.0.0
# default setup-cpp version
- true
cmake:
- 3.22.2
- 3.28.3
ninja:
- 1.10.2
- 1.11.1
exclude:
# TODO ci job fails with object.Error@(0): Access Violation error
- os: windows-2022
Expand Down Expand Up @@ -74,5 +75,7 @@ jobs:
env:
DUB_BUILD_TYPE: debug

- name: Lint
run: dub lint
# - name: Lint
# run: dub lint
# env:
# DUB_BUILD_TYPE: release
7 changes: 1 addition & 6 deletions dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ sourceFiles "./src/d_tree_sitter/libc.d" // gen by dpp
extraDependencyFiles "./src/tree-sitter-version.txt" "./package.json" "./src/meson.build"

lflags "$PACKAGE_DIR/src/d_tree_sitter/build/libtree_sitter.a"
dependency "bc-string" version="1.2.2"
dependency "bc-string" version="1.4.0"

// -------- Build Options and configurations --------

// enables most of the dips
dflags "-preview=dip25" "-preview=dip1000" "-preview=dip1008" "-preview=fieldwise" "-preview=fixAliasThis" "-preview=intpromote" "-preview=rvaluerefparam" "-preview=in"
/* dflags "-preview=dip1021" */ // causes random crashes
/* dflags "-preview=inclusiveincontracts" platform="dmd" // only on dmd */

buildType "release" {
dflags "-vgc" "--flto=full" "--ffast-math" "--linkonce-templates" platform="ldc"
buildOptions "releaseMode" "optimize" "inline"
Expand Down
2 changes: 1 addition & 1 deletion dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"fileVersion": 1,
"versions": {
"bc-string": "1.2.2"
"bc-string": "1.4.0"
}
}
3 changes: 3 additions & 0 deletions src/d_tree_sitter/libc.dpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module libc;

import core.stdc.stdint;


#include "./gen/tree-sitter/lib/include/tree_sitter/api.h"
2 changes: 1 addition & 1 deletion src/d_tree_sitter/node.d
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ struct Node
A node. If the given node doesn't have a parent, it returns the node itself.
Note: the nth might not be reached if there are no more parents.
*/
auto nth_parent(in uint max_nth = 2) @nogc nothrow @trusted const
auto nth_parent(uint max_nth = 2) @nogc nothrow @trusted const
{
auto maybeFirstParent = this.parent();
if (maybeFirstParent.isNull())
Expand Down
6 changes: 3 additions & 3 deletions src/d_tree_sitter/parser.d
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct Parser
Params:
language = the language you want to create a parser for
*/
this(in Language language) nothrow @nogc
this(Language language) nothrow @nogc
{
// Create a parser.
this.tsparser = ts_parser_new();
Expand All @@ -54,7 +54,7 @@ struct Parser
* NOTE it assumes that the language is compatible. Returns a boolean indicating whether or not the language was successfully
* assigned.
*/
auto set_language_nothrow(in Language language) nothrow
auto set_language_nothrow(Language language) nothrow
{
return ts_parser_set_language(tsparser, language.tslanguage);
}
Expand All @@ -69,7 +69,7 @@ struct Parser
* and compare it to this library's `TREE_SITTER_LANGUAGE_VERSION` and
* `TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION` constants.
*/
auto set_language(in Language language)
auto set_language(Language language)
{
// TODO make set_language private?
enforce_compatible_language(language);
Expand Down

0 comments on commit 8014f88

Please sign in to comment.