Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Summpot committed Aug 16, 2023
1 parent 643b54f commit 84cbe2e
Show file tree
Hide file tree
Showing 87 changed files with 1,303 additions and 1,054 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "native/sources/tree-sitter-c/src"]
path = native/sources/tree-sitter-c/src
url = https://github.com/tree-sitter/tree-sitter-c
[submodule "native/sources/tree-sitter-json/src"]
path = native/sources/tree-sitter-json/src
url = https://github.com/tree-sitter/tree-sitter-json
14 changes: 7 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="libtree-sitter" Version="0.3.15" />
<PackageVersion Include="libtree-sitter-c" Version="0.3.15" />
<PackageVersion Include="libtree-sitter-cpp" Version="0.3.15" />
<PackageVersion Include="libtree-sitter-lua" Version="0.3.15" />
<PackageVersion Include="libtree-sitter" Version="0.3.17" />
<PackageVersion Include="libtree-sitter-c" Version="0.3.17" />
<PackageVersion Include="libtree-sitter-cpp" Version="0.3.17" />
<PackageVersion Include="libtree-sitter-lua" Version="0.3.17" />
<PackageVersion Include="GitVersion.MsBuild" Version="5.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Build-MesonProject {
}

$ErrorActionPreference = "Stop"
$ProjectNames = @("tree-sitter", "tree-sitter-c", "tree-sitter-cpp", "tree-sitter-lua")
$ProjectNames = @("tree-sitter", "tree-sitter-c", "tree-sitter-cpp", "tree-sitter-json", "tree-sitter-lua")
if ($IsWindows) {
$RIDS = @("win-x86", "win-x64", "win-arm64")
}
Expand Down
29 changes: 29 additions & 0 deletions native/nuspecs/libtree-sitter-json.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3">
<id>libtree-sitter-json</id>
<version>0.3.9+7</version>
<authors>Summpot</authors>
<owners>Summpot</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/Summpot/tree-sitter</projectUrl>
<description>Multi-platform native library for libtree-sitter-json.</description>
<copyright>Copyright (c) 2023 Summpot</copyright>
<repository type="git" url="https://github.com/tree-sitter/tree-sitter" branch="master" />
<dependencies>
<group targetFramework=".NETStandard2.0">
<dependency id="libtree-sitter-json.runtime.linux-arm64" version="0.3.9+7" />
<dependency id="libtree-sitter-json.runtime.linux-x64" version="0.3.9+7" />
<dependency id="libtree-sitter-json.runtime.osx-arm64" version="0.3.9+7" />
<dependency id="libtree-sitter-json.runtime.osx-x64" version="0.3.9+7" />
<dependency id="libtree-sitter-json.runtime.win-x64" version="0.3.9+7" />
<dependency id="libtree-sitter-json.runtime.win-x86" version="0.3.9+7" />
<dependency id="libtree-sitter-json.runtime.win-arm64" version="0.3.9+7" />
</group>
</dependencies>
</metadata>
<files>
<file src="LICENSE.TXT" target="LICENSE.TXT" />
</files>
</package>
19 changes: 19 additions & 0 deletions native/nuspecs/libtree-sitter-json.runtime.linux-arm64.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3">
<id>libtree-sitter-json.runtime.linux-arm64</id>
<version>0.3.9+7</version>
<authors>Summpot</authors>
<owners>Summpot</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/Summpot/tree-sitter</projectUrl>
<description>linux arm64 native library for libtree-sitter-json.</description>
<copyright>Copyright (c) 2023 Summpot</copyright>
<repository type="git" url="https://github.com/Summpot/tree-sitter" branch="master" />
</metadata>
<files>
<file src="LICENSE.TXT" target="LICENSE.TXT" />
<file src="linux-arm64/libtree-sitter-json.so" target="runtimes\linux-arm64\native\libtree-sitter-json.so" />
</files>
</package>
19 changes: 19 additions & 0 deletions native/nuspecs/libtree-sitter-json.runtime.linux-x64.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3">
<id>libtree-sitter-json.runtime.linux-x64</id>
<version>0.3.9+7</version>
<authors>Summpot</authors>
<owners>Summpot</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/Summpot/tree-sitter</projectUrl>
<description>linux arm64 native library for libtree-sitter-json.</description>
<copyright>Copyright (c) 2023 Summpot</copyright>
<repository type="git" url="https://github.com/Summpot/tree-sitter" branch="master" />
</metadata>
<files>
<file src="LICENSE.TXT" target="LICENSE.TXT" />
<file src="linux-x64/libtree-sitter-json.so" target="runtimes\linux-x64\native\libtree-sitter-json.so" />
</files>
</package>
19 changes: 19 additions & 0 deletions native/nuspecs/libtree-sitter-json.runtime.osx-arm64.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3">
<id>libtree-sitter-json.runtime.osx-arm64</id>
<version>0.3.9+7</version>
<authors>Summpot</authors>
<owners>Summpot</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/Summpot/tree-sitter</projectUrl>
<description>linux arm64 native library for libtree-sitter-json.</description>
<copyright>Copyright (c) 2023 Summpot</copyright>
<repository type="git" url="https://github.com/Summpot/tree-sitter" branch="master" />
</metadata>
<files>
<file src="LICENSE.TXT" target="LICENSE.TXT" />
<file src="osx-arm64/libtree-sitter-json.dylib" target="runtimes\osx-arm64\native\libtree-sitter-json.dylib" />
</files>
</package>
19 changes: 19 additions & 0 deletions native/nuspecs/libtree-sitter-json.runtime.osx-x64.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3">
<id>libtree-sitter-json.runtime.osx-x64</id>
<version>0.3.9+7</version>
<authors>Summpot</authors>
<owners>Summpot</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/Summpot/tree-sitter</projectUrl>
<description>linux arm64 native library for libtree-sitter-json.</description>
<copyright>Copyright (c) 2023 Summpot</copyright>
<repository type="git" url="https://github.com/Summpot/tree-sitter" branch="master" />
</metadata>
<files>
<file src="LICENSE.TXT" target="LICENSE.TXT" />
<file src="osx-x64/libtree-sitter-json.dylib" target="runtimes\osx-x64\native\libtree-sitter-json.dylib" />
</files>
</package>
19 changes: 19 additions & 0 deletions native/nuspecs/libtree-sitter-json.runtime.win-arm64.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3">
<id>libtree-sitter-json.runtime.win-arm64</id>
<version>0.3.9+7</version>
<authors>Summpot</authors>
<owners>Summpot</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/Summpot/tree-sitter</projectUrl>
<description>linux arm64 native library for libtree-sitter-json.</description>
<copyright>Copyright (c) 2023 Summpot</copyright>
<repository type="git" url="https://github.com/Summpot/tree-sitter" branch="master" />
</metadata>
<files>
<file src="LICENSE.TXT" target="LICENSE.TXT" />
<file src="win-arm64/tree-sitter-json.dll" target="runtimes\win-arm64\native\libtree-sitter-json.dll" />
</files>
</package>
19 changes: 19 additions & 0 deletions native/nuspecs/libtree-sitter-json.runtime.win-x64.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3">
<id>libtree-sitter-json.runtime.win-x64</id>
<version>0.3.9+7</version>
<authors>Summpot</authors>
<owners>Summpot</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/Summpot/tree-sitter</projectUrl>
<description>linux arm64 native library for libtree-sitter-json.</description>
<copyright>Copyright (c) 2023 Summpot</copyright>
<repository type="git" url="https://github.com/Summpot/tree-sitter" branch="master" />
</metadata>
<files>
<file src="LICENSE.TXT" target="LICENSE.TXT" />
<file src="win-x64/tree-sitter-json.dll" target="runtimes\win-x64\native\libtree-sitter-json.dll" />
</files>
</package>
19 changes: 19 additions & 0 deletions native/nuspecs/libtree-sitter-json.runtime.win-x86.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3">
<id>libtree-sitter-json.runtime.win-x86</id>
<version>0.3.9+7</version>
<authors>Summpot</authors>
<owners>Summpot</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/Summpot/tree-sitter</projectUrl>
<description>linux arm64 native library for libtree-sitter-json.</description>
<copyright>Copyright (c) 2023 Summpot</copyright>
<repository type="git" url="https://github.com/Summpot/tree-sitter" branch="master" />
</metadata>
<files>
<file src="LICENSE.TXT" target="LICENSE.TXT" />
<file src="win-x86/tree-sitter-json.dll" target="runtimes\win-x86\native\libtree-sitter-json.dll" />
</files>
</package>
5 changes: 5 additions & 0 deletions native/sources/tree-sitter-json/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project('tree-sitter-json', 'c')

incdir = include_directories('src/src')

library('tree-sitter-json', 'src/src/parser.c', include_directories : incdir)
1 change: 1 addition & 0 deletions native/sources/tree-sitter-json/src
Submodule src added at ca3f89
20 changes: 20 additions & 0 deletions src/TreeSitterSharp.C/CLanguageProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using TreeSitterSharp.Native;

namespace TreeSitterSharp.C;
public class CLanguageProvider : ILanguageProvider
{
[DllImport("libtree-sitter-c", EntryPoint = "tree_sitter_c", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
private static extern unsafe TsLanguage* tree_sitter_c();

public static unsafe Language GetLanguage()
{
return Language.FromNative(tree_sitter_c());
}

}
16 changes: 0 additions & 16 deletions src/TreeSitterSharp.C/TsC.cs

This file was deleted.

23 changes: 0 additions & 23 deletions src/TreeSitterSharp/Generated/NativeTypeNameAttribute.cs

This file was deleted.

Loading

0 comments on commit 84cbe2e

Please sign in to comment.