Skip to content

Commit

Permalink
Merge pull request #40 from jpt13653903/dependabot/npm_and_yarn/npm-6…
Browse files Browse the repository at this point in the history
…aa6fa85b1

build(deps): bump tree-sitter-cli from 0.24.7 to 0.25.0 in the npm group
  • Loading branch information
jpt13653903 authored Feb 2, 2025
2 parents da8ea8a + dfc580c commit 23fee9e
Show file tree
Hide file tree
Showing 30 changed files with 722 additions and 561 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ jobs:
uses: actions/checkout@v4
- name: Run fuzzer
uses: tree-sitter/fuzz-action@v4
with:
tree-sitter-version: v0.22.2
66 changes: 66 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
cmake_minimum_required(VERSION 3.13)

project(tree-sitter-vhdl
VERSION "1.2.4"
DESCRIPTION "VHDL grammar for tree-sitter"
HOMEPAGE_URL "https://github.com/jpt13653903/tree-sitter-vhdl"
LANGUAGES C)

option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
option(TREE_SITTER_REUSE_ALLOCATOR "Reuse the library allocator" OFF)

set(TREE_SITTER_ABI_VERSION 15 CACHE STRING "Tree-sitter ABI version")
if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$")
unset(TREE_SITTER_ABI_VERSION CACHE)
message(FATAL_ERROR "TREE_SITTER_ABI_VERSION must be an integer")
endif()

find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI")

add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json"
COMMAND "${TREE_SITTER_CLI}" generate src/grammar.json
--abi=${TREE_SITTER_ABI_VERSION}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Generating parser.c")

add_library(tree-sitter-vhdl src/parser.c)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c)
target_sources(tree-sitter-vhdl PRIVATE src/scanner.c)
endif()
target_include_directories(tree-sitter-vhdl
PRIVATE src
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bindings/c>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

target_compile_definitions(tree-sitter-vhdl PRIVATE
$<$<BOOL:${TREE_SITTER_REUSE_ALLOCATOR}>:TREE_SITTER_REUSE_ALLOCATOR>
$<$<CONFIG:Debug>:TREE_SITTER_DEBUG>)

set_target_properties(tree-sitter-vhdl
PROPERTIES
C_STANDARD 11
POSITION_INDEPENDENT_CODE ON
SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}"
DEFINE_SYMBOL "")

configure_file(bindings/c/tree-sitter-vhdl.pc.in
"${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-vhdl.pc" @ONLY)

include(GNUInstallDirs)

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree_sitter"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING PATTERN "*.h")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-vhdl.pc"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig")
install(TARGETS tree-sitter-vhdl
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")

file(GLOB QUERIES queries/*.scm)
install(FILES ${QUERIES}
DESTINATION "${CMAKE_INSTALL_DATADIR}/tree-sitter/queries/vhdl")

add_custom_target(ts-test "${TREE_SITTER_CLI}" test
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "tree-sitter test")
21 changes: 14 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
[package]
name = "tree-sitter-vhdl"
description = "VHDL grammar for tree-sitter"
version = "1.2.3"
version = "1.2.4"
authors = ["John-Philip Taylor"]
license = "MIT"
readme = "README.md"
keywords = ["incremental", "parsing", "tree-sitter", "vhdl"]
categories = ["parsing", "text-editors"]
categories = ["parser-implementations", "parsing", "text-editors"]
repository = "https://github.com/jpt13653903/tree-sitter-vhdl"
authors = ["John-Philip Taylor"]
edition = "2021"
autoexamples = false

build = "bindings/rust/build.rs"
include = ["bindings/rust/*", "grammar.js", "queries/Neovim/*", "src/*"]
include = [
"bindings/rust/*",
"grammar.js",
"queries/*",
"src/*",
"tree-sitter.json",
"LICENSE",
]

[lib]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter-language = "0.1.0"
tree-sitter-language = "0.1"

[build-dependencies]
cc = "1.0.87"
cc = "1.2"

[dev-dependencies]
tree-sitter = "0.23"
tree-sitter = "0.25.1"
90 changes: 38 additions & 52 deletions Makefile

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

64 changes: 29 additions & 35 deletions Package.swift

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

7 changes: 6 additions & 1 deletion binding.gyp

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

15 changes: 7 additions & 8 deletions bindings/c/tree-sitter-vhdl.pc.in

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

File renamed without changes.
2 changes: 2 additions & 0 deletions bindings/go/binding.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/binding_test.go

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

5 changes: 0 additions & 5 deletions bindings/go/go.mod

This file was deleted.

Loading

0 comments on commit 23fee9e

Please sign in to comment.