Skip to content

Commit

Permalink
deps src: Automatic update
Browse files Browse the repository at this point in the history
  • Loading branch information
marvim committed Nov 14, 2024
1 parent 18a1a73 commit d115017
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 42 deletions.
30 changes: 15 additions & 15 deletions src/luajit-stamp/download-luajit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ function(check_file_hash has_hash hash_is_good)
set("${has_hash}" TRUE PARENT_SCOPE)

message(VERBOSE "verifying file...
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz'")
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz'")

file("SHA256" "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz" actual_value)
file("SHA256" "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz" actual_value)

if(NOT "${actual_value}" STREQUAL "cbf1647acbd340c62b9c342dae43290762efa1b26d8bf8457f143fabf8ed86c7")
if(NOT "${actual_value}" STREQUAL "1375ebdbe04df03bf5f21a576885a7a7e7caf3a0191d68eef513ec1fb2921512")
set("${hash_is_good}" FALSE PARENT_SCOPE)
message(VERBOSE "SHA256 hash of
/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz
/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz
does not match expected value
expected: 'cbf1647acbd340c62b9c342dae43290762efa1b26d8bf8457f143fabf8ed86c7'
expected: '1375ebdbe04df03bf5f21a576885a7a7e7caf3a0191d68eef513ec1fb2921512'
actual: '${actual_value}'")
else()
set("${hash_is_good}" TRUE PARENT_SCOPE)
Expand Down Expand Up @@ -71,32 +71,32 @@ function(sleep_before_download attempt)
execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep "${sleep_seconds}")
endfunction()

if(EXISTS "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz")
if(EXISTS "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz")
check_file_hash(has_hash hash_is_good)
if(has_hash)
if(hash_is_good)
message(VERBOSE "File already exists and hash match (skip download):
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz'
SHA256='cbf1647acbd340c62b9c342dae43290762efa1b26d8bf8457f143fabf8ed86c7'"
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz'
SHA256='1375ebdbe04df03bf5f21a576885a7a7e7caf3a0191d68eef513ec1fb2921512'"
)
return()
else()
message(VERBOSE "File already exists but hash mismatch. Removing...")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz")
endif()
else()
message(VERBOSE "File already exists but no hash specified (use URL_HASH):
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz'
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz'
Old file will be removed and new file downloaded from URL."
)
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz")
endif()
endif()

set(retry_number 5)

message(VERBOSE "Downloading...
dst='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz'
dst='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz'
timeout='none'
inactivity timeout='none'"
)
Expand All @@ -107,7 +107,7 @@ foreach(i RANGE ${retry_number})
if(status_code IN_LIST download_retry_codes)
sleep_before_download(${i})
endif()
foreach(url IN ITEMS [====[https://github.com/LuaJIT/LuaJIT/archive/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz]====])
foreach(url IN ITEMS [====[https://github.com/LuaJIT/LuaJIT/archive/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz]====])
if(NOT url IN_LIST skip_url_list)
message(VERBOSE "Using src='${url}'")

Expand All @@ -119,7 +119,7 @@ foreach(i RANGE ${retry_number})

file(
DOWNLOAD
"${url}" "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz"
"${url}" "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz"

# no TIMEOUT
# no INACTIVITY_TIMEOUT
Expand All @@ -136,7 +136,7 @@ foreach(i RANGE ${retry_number})
check_file_hash(has_hash hash_is_good)
if(has_hash AND NOT hash_is_good)
message(VERBOSE "Hash mismatch, removing...")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz")
else()
message(VERBOSE "Downloading... done")
return()
Expand Down
2 changes: 1 addition & 1 deletion src/luajit-stamp/extract-luajit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.5)

# Make file names absolute:
#
get_filename_component(filename "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz" ABSOLUTE)
get_filename_component(filename "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz" ABSOLUTE)
get_filename_component(directory "/home/runner/work/deps/deps/neovim/deps/build/src/luajit" ABSOLUTE)

message(VERBOSE "extracting...
Expand Down
4 changes: 2 additions & 2 deletions src/luajit-stamp/luajit-urlinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ method=url
command=/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/luajit-stamp/download-luajit.cmake;COMMAND;/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/luajit-stamp/verify-luajit.cmake;COMMAND;/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/luajit-stamp/extract-luajit.cmake
source_dir=/home/runner/work/deps/deps/neovim/deps/build/src/luajit
work_dir=/home/runner/work/deps/deps/neovim/deps/build/src
url(s)=https://github.com/LuaJIT/LuaJIT/archive/97813fb924edf822455f91a5fbbdfdb349e5984f.tar.gz
hash=SHA256=cbf1647acbd340c62b9c342dae43290762efa1b26d8bf8457f143fabf8ed86c7
url(s)=https://github.com/LuaJIT/LuaJIT/archive/69bbf3c1b01de8239444b0c430a89fa868978fea.tar.gz
hash=SHA256=1375ebdbe04df03bf5f21a576885a7a7e7caf3a0191d68eef513ec1fb2921512
no_extract=

2 changes: 1 addition & 1 deletion src/luajit/.relver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1727870382
1731485912
2 changes: 1 addition & 1 deletion src/luajit/src/lib_bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ LJLIB_ASM(bit_lshift) LJLIB_REC(bit_shift IR_BSHL)
x = lj_carith_shift64(x, sh, curr_func(L)->c.ffid - (int)FF_bit_lshift);
return bit_result64(L, id, x);
}
if (id2) setintV(L->base+1, sh);
setintV(L->base+1, sh);
return FFH_RETRY;
#else
lj_lib_checknumber(L, 1);
Expand Down
30 changes: 15 additions & 15 deletions src/treesitter-stamp/download-treesitter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ function(check_file_hash has_hash hash_is_good)
set("${has_hash}" TRUE PARENT_SCOPE)

message(VERBOSE "verifying file...
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz'")
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz'")

file("SHA256" "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz" actual_value)
file("SHA256" "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz" actual_value)

if(NOT "${actual_value}" STREQUAL "d704832a6bfaac8b3cbca3b5d773cad613183ba8c04166638af2c6e5dfb9e2d2")
if(NOT "${actual_value}" STREQUAL "61a21f5d83cfe256472bfa941123a6941fb45073784ee7ec0bc32fdd52f7a4e4")
set("${hash_is_good}" FALSE PARENT_SCOPE)
message(VERBOSE "SHA256 hash of
/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz
/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz
does not match expected value
expected: 'd704832a6bfaac8b3cbca3b5d773cad613183ba8c04166638af2c6e5dfb9e2d2'
expected: '61a21f5d83cfe256472bfa941123a6941fb45073784ee7ec0bc32fdd52f7a4e4'
actual: '${actual_value}'")
else()
set("${hash_is_good}" TRUE PARENT_SCOPE)
Expand Down Expand Up @@ -71,32 +71,32 @@ function(sleep_before_download attempt)
execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep "${sleep_seconds}")
endfunction()

if(EXISTS "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz")
if(EXISTS "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz")
check_file_hash(has_hash hash_is_good)
if(has_hash)
if(hash_is_good)
message(VERBOSE "File already exists and hash match (skip download):
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz'
SHA256='d704832a6bfaac8b3cbca3b5d773cad613183ba8c04166638af2c6e5dfb9e2d2'"
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz'
SHA256='61a21f5d83cfe256472bfa941123a6941fb45073784ee7ec0bc32fdd52f7a4e4'"
)
return()
else()
message(VERBOSE "File already exists but hash mismatch. Removing...")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz")
endif()
else()
message(VERBOSE "File already exists but no hash specified (use URL_HASH):
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz'
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz'
Old file will be removed and new file downloaded from URL."
)
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz")
endif()
endif()

set(retry_number 5)

message(VERBOSE "Downloading...
dst='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz'
dst='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz'
timeout='none'
inactivity timeout='none'"
)
Expand All @@ -107,7 +107,7 @@ foreach(i RANGE ${retry_number})
if(status_code IN_LIST download_retry_codes)
sleep_before_download(${i})
endif()
foreach(url IN ITEMS [====[https://github.com/tree-sitter/tree-sitter/archive/v0.24.4.tar.gz]====])
foreach(url IN ITEMS [====[https://github.com/tree-sitter/tree-sitter/archive/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz]====])
if(NOT url IN_LIST skip_url_list)
message(VERBOSE "Using src='${url}'")

Expand All @@ -119,7 +119,7 @@ foreach(i RANGE ${retry_number})

file(
DOWNLOAD
"${url}" "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz"
"${url}" "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz"

# no TIMEOUT
# no INACTIVITY_TIMEOUT
Expand All @@ -136,7 +136,7 @@ foreach(i RANGE ${retry_number})
check_file_hash(has_hash hash_is_good)
if(has_hash AND NOT hash_is_good)
message(VERBOSE "Hash mismatch, removing...")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz")
else()
message(VERBOSE "Downloading... done")
return()
Expand Down
2 changes: 1 addition & 1 deletion src/treesitter-stamp/extract-treesitter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.5)

# Make file names absolute:
#
get_filename_component(filename "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.4.tar.gz" ABSOLUTE)
get_filename_component(filename "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz" ABSOLUTE)
get_filename_component(directory "/home/runner/work/deps/deps/neovim/deps/build/src/treesitter" ABSOLUTE)

message(VERBOSE "extracting...
Expand Down
4 changes: 2 additions & 2 deletions src/treesitter-stamp/treesitter-urlinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ method=url
command=/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/treesitter-stamp/download-treesitter.cmake;COMMAND;/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/treesitter-stamp/verify-treesitter.cmake;COMMAND;/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/treesitter-stamp/extract-treesitter.cmake
source_dir=/home/runner/work/deps/deps/neovim/deps/build/src/treesitter
work_dir=/home/runner/work/deps/deps/neovim/deps/build/src
url(s)=https://github.com/tree-sitter/tree-sitter/archive/v0.24.4.tar.gz
hash=SHA256=d704832a6bfaac8b3cbca3b5d773cad613183ba8c04166638af2c6e5dfb9e2d2
url(s)=https://github.com/tree-sitter/tree-sitter/archive/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz
hash=SHA256=61a21f5d83cfe256472bfa941123a6941fb45073784ee7ec0bc32fdd52f7a4e4
no_extract=

27 changes: 27 additions & 0 deletions src/treesitter/cli/src/tests/node_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,33 @@ fn test_parent_of_zero_width_node() {
assert_eq!(parent, script_element);
}

#[test]
fn test_next_sibling_of_zero_width_node() {
let grammar_json = load_grammar_file(
&fixtures_dir()
.join("test_grammars")
.join("next_sibling_from_zwt")
.join("grammar.js"),
None,
)
.unwrap();

let (parser_name, parser_code) = generate_parser_for_grammar(&grammar_json).unwrap();

let mut parser = Parser::new();
let language = get_test_language(&parser_name, &parser_code, None);
parser.set_language(&language).unwrap();

let tree = parser.parse("abdef", None).unwrap();

let root_node = tree.root_node();
let missing_c = root_node.child(2).unwrap();
assert!(missing_c.is_missing());
assert_eq!(missing_c.kind(), "c");
let node_d = root_node.child(3).unwrap();
assert_eq!(missing_c.next_sibling().unwrap(), node_d);
}

#[test]
fn test_node_field_name_for_child() {
let mut parser = Parser::new();
Expand Down
8 changes: 4 additions & 4 deletions src/treesitter/lib/src/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ static inline TSNode ts_node__next_sibling(TSNode self, bool include_anonymous)
TSNode child;
NodeChildIterator iterator = ts_node_iterate_children(&node);
while (ts_node_child_iterator_next(&iterator, &child)) {
if (iterator.position.bytes < target_end_byte) continue;
if (ts_node_start_byte(child) <= ts_node_start_byte(self)) {
if (iterator.position.bytes <= target_end_byte) continue;
if (ts_node_start_byte(child) < ts_node_start_byte(self)) {
if (ts_node__subtree(child).ptr != ts_node__subtree(self).ptr) {
child_containing_target = child;
}
Expand Down Expand Up @@ -534,8 +534,8 @@ TSNode ts_node_parent(TSNode self) {
if (node.id == self.id) return ts_node__null();

while (true) {
TSNode next_node = ts_node_child_containing_descendant(node, self);
if (ts_node_is_null(next_node)) break;
TSNode next_node = ts_node_child_with_descendant(node, self);
if (next_node.id == self.id || ts_node_is_null(next_node)) break;
node = next_node;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===========================
missing c node
===========================

abdef

---

(source
(MISSING "c"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = grammar({
name: "next_sibling_from_zwt",
extras: $ => [
/\s|\\\r?\n/,
],

rules: {
source: $ => seq(
'a',
$._bc,
'd',
'e',
'f',
),

_bc: $ => seq(
'b',
'c',
),
}
});

0 comments on commit d115017

Please sign in to comment.