diff options
Diffstat (limited to '')
-rw-r--r-- | sys/nixpkgs/pkgs/plgs-pkgs/README.md | 10 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/plgs-pkgs/plugins/plugins.md | 2 | ||||
-rwxr-xr-x | sys/nixpkgs/pkgs/plgs-pkgs/update.sh | 7 | ||||
-rwxr-xr-x | sys/nixpkgs/pkgs/snap-sync-forked/snap-sync-forked.sh | 182 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/tree-sitter-yts/Cargo.toml | 7 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/tree-sitter-yts/bindings/node/binding.cc | 35 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/tree-sitter-yts/src/parser.c | 1245 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/tree-sitter-yts/src/tree_sitter/parser.h | 385 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/tree-sitter-yts/treefmt.toml | 22 | ||||
-rwxr-xr-x | sys/nixpkgs/pkgs/update_pkgs.sh | 8 | ||||
-rwxr-xr-x | sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh | 18 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml | 2 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py | 4 | ||||
-rwxr-xr-x | sys/nixpkgs/pkgs/yt/update.sh | 1 | ||||
-rwxr-xr-x | sys/svcs/xdg/scripts/lf_wrapper.sh | 2 | ||||
-rwxr-xr-x | sys/svcs/xdg/scripts/ranger-wrapper.sh | 4 |
16 files changed, 1044 insertions, 890 deletions
diff --git a/sys/nixpkgs/pkgs/plgs-pkgs/README.md b/sys/nixpkgs/pkgs/plgs-pkgs/README.md index ed05f4b2..e8169951 100644 --- a/sys/nixpkgs/pkgs/plgs-pkgs/README.md +++ b/sys/nixpkgs/pkgs/plgs-pkgs/README.md @@ -1,6 +1,8 @@ # Fork + All files in this repository where forked form [here](https://github.com/NixNeovim/NixNeovimPlugins) on commit `5010b91eb03696574c3c293f072a090618227e87`. Below the original README. They were licensed under the MIT license. + # All vim plugins, ready to go This repo auto generates nix packages for vim/neovim plugins. @@ -51,12 +53,6 @@ Finally, you can add the packages to your vim/neovim config. For example you can More info on using neovim with nix can be found here: [NixOS Neovim](https://nixos.wiki/wiki/Neovim) -[0]: https://github.com/rockerBOO/awesome-neovim -[1]: https://nixos.org/manual/nix/stable/release-notes/rl-2.4.html?highlight=builtins.getFlake#other-features -[2]: https://nur.nix-community.org/ -[3]: https://nur.nix-community.org/repos/m15a/ - - ## Contribution ### How to add a new plugin @@ -92,3 +88,5 @@ The GitHub Actions will do the rest, including removing the entry from manifest. ## Credits This is originally based on work by [m15a](https://github.com/m15a/nixpkgs-vim-extra-plugins) + +[0]: https://github.com/rockerBOO/awesome-neovim diff --git a/sys/nixpkgs/pkgs/plgs-pkgs/plugins/plugins.md b/sys/nixpkgs/pkgs/plgs-pkgs/plugins/plugins.md index bb4f6537..b990c877 100644 --- a/sys/nixpkgs/pkgs/plgs-pkgs/plugins/plugins.md +++ b/sys/nixpkgs/pkgs/plgs-pkgs/plugins/plugins.md @@ -1,4 +1,4 @@ - - Plugin count: 4 +- Plugin count: 4 | Repo | Last Update | Nix package name | Last checked | |:---|:---|:---|:---| diff --git a/sys/nixpkgs/pkgs/plgs-pkgs/update.sh b/sys/nixpkgs/pkgs/plgs-pkgs/update.sh index ea71c6fa..6a0d3452 100755 --- a/sys/nixpkgs/pkgs/plgs-pkgs/update.sh +++ b/sys/nixpkgs/pkgs/plgs-pkgs/update.sh @@ -9,11 +9,13 @@ cd "$BASE_DIR" || (echo "BUG: No '$BASE_DIR'" && exit 1) sort -o "$BASE_DIR/manifest.txt" "$BASE_DIR/manifest.txt" sort -o "$BASE_DIR/blacklist.txt" "$BASE_DIR/blacklist.txt" ## Remove all plugins, which are on the blacklist -echo "$(comm -23 "$BASE_DIR/manifest.txt" "$BASE_DIR/blacklist.txt")" > "$BASE_DIR/manifest.txt" +# The same file is read and written to +# shellcheck disable=SC2005 +echo "$(comm -23 "$BASE_DIR/manifest.txt" "$BASE_DIR/blacklist.txt")" >"$BASE_DIR/manifest.txt" # Backup vim-plugins.nix mv "$BASE_DIR/default.nix" "$BASE_DIR/default.nix.bak" -echo "{...} : {}" > "$BASE_DIR/default.nix" +echo "{...} : {}" >"$BASE_DIR/default.nix" # Generate derivations for new plugins (this binary is provided by the dev-environment) update-vim-plugins cleanup "$BASE_DIR" @@ -21,6 +23,5 @@ update-vim-plugins cleanup "$BASE_DIR" # Restore vim-plugins.nix mv "$BASE_DIR/default.nix.bak" "$BASE_DIR/default.nix" - # Update new plugins update-vim-plugins update "$BASE_DIR" --all diff --git a/sys/nixpkgs/pkgs/snap-sync-forked/snap-sync-forked.sh b/sys/nixpkgs/pkgs/snap-sync-forked/snap-sync-forked.sh index a66f31ae..47230667 100755 --- a/sys/nixpkgs/pkgs/snap-sync-forked/snap-sync-forked.sh +++ b/sys/nixpkgs/pkgs/snap-sync-forked/snap-sync-forked.sh @@ -37,12 +37,12 @@ printf "snap-sync comes with ABSOLUTELY NO WARRANTY. This is free software, and SNAPPER_CONFIG=/etc/sysconfig/snapper donotify=0 -if ! command -v notify-send &> /dev/null; then +if ! command -v notify-send &>/dev/null; then donotify=1 fi doprogress=0 -if ! command -v pv &> /dev/null; then +if ! command -v pv &>/dev/null; then doprogress=1 fi @@ -73,7 +73,7 @@ trap 'traperror ${LINENO} $? "$BASH_COMMAND" $BASH_LINENO "${FUNCNAME[@]}"' ERR trap trapkill SIGTERM SIGINT usage() { - cat <<EOF + cat <<EOF $name $version Usage: $name [options] @@ -100,52 +100,52 @@ sudo=0 while [[ $# -gt 0 ]]; do key="$1" case $key in - -d|--description) - description="$2" - shift 2 + -d | --description) + description="$2" + shift 2 ;; - -c|--config) - selected_configs="$2" - shift 2 + -c | --config) + selected_configs="$2" + shift 2 ;; - -u|--UUID) - uuid_cmdline="$2" - shift 2 + -u | --UUID) + uuid_cmdline="$2" + shift 2 ;; - -s|--subvolid) - subvolid_cmdline="$2" - shift 2 + -s | --subvolid) + subvolid_cmdline="$2" + shift 2 ;; - -k|--keepold) - keep="yes" - shift + -k | --keepold) + keep="yes" + shift ;; - -n|--noconfirm) - noconfirm="yes" - shift + -n | --noconfirm) + noconfirm="yes" + shift ;; - -h|--help) - usage - exit 1 + -h | --help) + usage + exit 1 ;; - -q|--quiet) - donotify=1 - shift + -q | --quiet) + donotify=1 + shift ;; - -r|--remote) - remote=$2 - shift 2 - ;; - -p|--port) - port=$2 - shift 2 - ;; - --sudo) - sudo=1 - shift + -r | --remote) + remote=$2 + shift 2 ;; - *) - die "Unknown option: '$key'. Run '$name -h' for valid options." + -p | --port) + port=$2 + shift 2 + ;; + --sudo) + sudo=1 + shift + ;; + *) + die "Unknown option: '$key'. Run '$name -h' for valid options." ;; esac done @@ -153,8 +153,8 @@ done notify() { for u in $(users | tr ' ' '\n' | sort -u); do sudo -u "$u" DISPLAY=:0 \ - DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(sudo -u "$u" id -u)/bus" \ - notify-send -a $name "$1" "$2" --icon="dialog-$3" + DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(sudo -u "$u" id -u)/bus" \ + notify-send -a $name "$1" "$2" --icon="dialog-$3" done } @@ -183,12 +183,12 @@ subvolid_cmdline=${subvolid_cmdline:-"5"} noconfirm=${noconfirm:-"no"} if [[ -z $remote ]]; then - if ! command -v rsync &> /dev/null; then + if ! command -v rsync &>/dev/null; then die "--remote specified but rsync command not found" fi fi -if [[ "$uuid_cmdline" != "none" ]]; then +if [[ $uuid_cmdline != "none" ]]; then if [[ -z $remote ]]; then notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid=$subvolid_cmdline..." else @@ -227,34 +227,34 @@ declare -a SUBVOLIDS_ARRAY i=0 for x in $TARGETS; do - SUBVOLIDS_ARRAY[$i]=$($ssh btrfs subvolume show "$x" | awk '/Subvolume ID:/ { print $3 }') - TARGETS_ARRAY[$i]=$x - i=$((i+1)) + SUBVOLIDS_ARRAY[i]=$($ssh btrfs subvolume show "$x" | awk '/Subvolume ID:/ { print $3 }') + TARGETS_ARRAY[i]=$x + i=$((i + 1)) done i=0 disk=-1 disk_count=0 for x in $UUIDS; do - UUIDS_ARRAY[$i]=$x - if [[ "$x" == "$uuid_cmdline" && ${SUBVOLIDS_ARRAY[$((i))]} == "$subvolid_cmdline" ]]; then + UUIDS_ARRAY[i]=$x + if [[ $x == "$uuid_cmdline" && ${SUBVOLIDS_ARRAY[$((i))]} == "$subvolid_cmdline" ]]; then disk=$i - disk_count=$((disk_count+1)) + disk_count=$((disk_count + 1)) fi - i=$((i+1)) + i=$((i + 1)) done -if [[ "${#UUIDS_ARRAY[$@]}" -eq 0 ]]; then +if [[ ${#UUIDS_ARRAY[$@]} -eq 0 ]]; then die "No external btrfs subvolumes found to backup to. Run '$name -h' for more options." fi -if [[ "$disk_count" -gt 1 ]]; then +if [[ $disk_count -gt 1 ]]; then printf "Multiple mount points were found with UUID %s and subvolid %s.\n" "$uuid_cmdline" "$subvolid_cmdline" disk="-1" fi -if [[ "$disk" == -1 ]]; then - if [[ "$disk_count" == 0 && "$uuid_cmdline" != "none" ]]; then +if [[ $disk == -1 ]]; then + if [[ $disk_count == 0 && $uuid_cmdline != "none" ]]; then error "A device with UUID $uuid_cmdline and subvolid $subvolid_cmdline was not found to be mounted, or it is not a BTRFS device." fi if [[ -z $ssh ]]; then @@ -264,7 +264,7 @@ if [[ "$disk" == -1 ]]; then fi while [[ $disk -lt 0 || $disk -gt $i ]]; do for x in "${!TARGETS_ARRAY[@]}"; do - printf "%4s) %s (uuid=%s, subvolid=%s)\n" "$((x+1))" "${TARGETS_ARRAY[$x]}" "${UUIDS_ARRAY[$x]}" "${SUBVOLIDS_ARRAY[$x]}" + printf "%4s) %s (uuid=%s, subvolid=%s)\n" "$((x + 1))" "${TARGETS_ARRAY[$x]}" "${UUIDS_ARRAY[$x]}" "${SUBVOLIDS_ARRAY[$x]}" done printf "%4s) Exit\n" "0" read -e -r -p "Enter a number: " disk @@ -276,7 +276,7 @@ if [[ "$disk" == -1 ]]; then if [[ $disk == 0 ]]; then exit 0 fi - disk=$((disk-1)) + disk=$((disk - 1)) fi selected_subvolid="${SUBVOLIDS_ARRAY[$((disk))]}" @@ -289,7 +289,7 @@ else printf "The disk is mounted at '%s:%s'.\n" "$remote" "$selected_mnt" fi -# shellcheck source=/etc/default/snapper +# shellcheck source=/dev/null source "$SNAPPER_CONFIG" if [[ -z $selected_configs ]]; then @@ -322,17 +322,17 @@ for x in $selected_configs; do printf "'noconfirm' option passed. Failed backups will not be deleted.\n" else read -e -r -p "Delete failed backup snapshot(s)? (These local snapshots from failed backups are not used.) [y/N]? " delete_failed - while [[ -n "$delete_failed" && "$delete_failed" != [Yy]"es" && - "$delete_failed" != [Yy] && "$delete_failed" != [Nn]"o" && - "$delete_failed" != [Nn] ]]; do + while [[ -n $delete_failed && $delete_failed != [Yy]"es" && + $delete_failed != [Yy] && $delete_failed != [Nn]"o" && + $delete_failed != [Nn] ]]; do read -e -r -p "Delete failed backup snapshot(s)? (These local snapshots from failed backups are not used.) [y/N] " delete_failed - if [[ -n "$delete_failed" && "$delete_failed" != [Yy]"es" && - "$delete_failed" != [Yy] && "$delete_failed" != [Nn]"o" && - "$delete_failed" != [Nn] ]]; then + if [[ -n $delete_failed && $delete_failed != [Yy]"es" && + $delete_failed != [Yy] && $delete_failed != [Nn]"o" && + $delete_failed != [Nn] ]]; then printf "Select 'y' or 'N'.\n" fi done - if [[ "$delete_failed" == [Yy]"es" || "$delete_failed" == [Yy] ]]; then + if [[ $delete_failed == [Yy]"es" || $delete_failed == [Yy] ]]; then # explicit split list of snapshots (on whitespace) into multiple arguments # shellcheck disable=SC2046 snapper -c "$x" delete $(snapper -c "$x" list --disable-used-space | awk '/'$name' backup in progress/ {print $1}') @@ -343,7 +343,7 @@ for x in $selected_configs; do SNAP_SYNC_EXCLUDE=no if [[ -f "/etc/snapper/configs/$x" ]]; then - # shellcheck source=/etc/snapper/config-templates/default + # shellcheck source=/dev/null source "/etc/snapper/configs/$x" else die "Selected snapper configuration $x does not exist." @@ -358,10 +358,10 @@ for x in $selected_configs; do old_num=$(snapper -c "$x" list --disable-used-space -t single | awk '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {print $1}') old_snap=$SUBVOLUME/.snapshots/$old_num/snapshot - OLD_NUM_ARRAY[$i]=$old_num - OLD_SNAP_ARRAY[$i]=$old_snap + OLD_NUM_ARRAY[i]=$old_num + OLD_SNAP_ARRAY[i]=$old_snap - if [[ -z "$old_num" ]]; then + if [[ -z $old_num ]]; then printf "No backups have been performed for '%s' on this disk.\n" "$x" read -e -r -p "Enter name of subvolume to store backups, relative to $selected_mnt (to be created if not existing): " mybackupdir printf "This will be the initial backup for snapper configuration '%s' to this disk. This could take awhile.\n" "$x" @@ -372,8 +372,8 @@ for x in $selected_configs; do BACKUPDIR="$selected_mnt/$mybackupdir" $ssh test -d "$BACKUPDIR" || die "%s is not a directory on %s.\n" "$BACKUPDIR" "$selected_uuid" fi - BACKUPDIRS_ARRAY[$i]="$BACKUPDIR" - MYBACKUPDIR_ARRAY[$i]="$mybackupdir" + BACKUPDIRS_ARRAY[i]="$BACKUPDIR" + MYBACKUPDIR_ARRAY[i]="$mybackupdir" printf "Creating new local snapshot for '%s' configuration...\n" "$x" new_num=$(snapper -c "$x" create --print-number -d "$name backup in progress") @@ -387,40 +387,40 @@ for x in $selected_configs; do printf "Will backup %s to %s\n" "$new_snap" "$remote":"$backup_location/snapshot" fi - if ($ssh test -d "$backup_location/snapshot") ; then + if ($ssh test -d "$backup_location/snapshot"); then printf "WARNING: Backup directory '%s' already exists. This configuration will be skipped!\n" "$backup_location/snapshot" printf "Move or delete destination directory and try backup again.\n" fi - NEW_NUM_ARRAY[$i]="$new_num" - NEW_SNAP_ARRAY[$i]="$new_snap" - NEW_INFO_ARRAY[$i]="$new_info" - BACKUPLOC_ARRAY[$i]="$backup_location" + NEW_NUM_ARRAY[i]="$new_num" + NEW_SNAP_ARRAY[i]="$new_snap" + NEW_INFO_ARRAY[i]="$new_info" + BACKUPLOC_ARRAY[i]="$backup_location" cont_backup="K" - CONT_BACKUP_ARRAY[$i]="yes" + CONT_BACKUP_ARRAY[i]="yes" if [[ $noconfirm == "yes" ]]; then cont_backup="yes" else - while [[ -n "$cont_backup" && "$cont_backup" != [Yy]"es" && - "$cont_backup" != [Yy] && "$cont_backup" != [Nn]"o" && - "$cont_backup" != [Nn] ]]; do + while [[ -n $cont_backup && $cont_backup != [Yy]"es" && + $cont_backup != [Yy] && $cont_backup != [Nn]"o" && + $cont_backup != [Nn] ]]; do read -e -r -p "Proceed with backup of '$x' configuration [Y/n]? " cont_backup - if [[ -n "$cont_backup" && "$cont_backup" != [Yy]"es" && - "$cont_backup" != [Yy] && "$cont_backup" != [Nn]"o" && - "$cont_backup" != [Nn] ]]; then + if [[ -n $cont_backup && $cont_backup != [Yy]"es" && + $cont_backup != [Yy] && $cont_backup != [Nn]"o" && + $cont_backup != [Nn] ]]; then printf "Select 'Y' or 'n'.\n" fi done fi - if [[ "$cont_backup" != [Yy]"es" && "$cont_backup" != [Yy] && -n "$cont_backup" ]]; then - CONT_BACKUP_ARRAY[$i]="no" + if [[ $cont_backup != [Yy]"es" && $cont_backup != [Yy] && -n $cont_backup ]]; then + CONT_BACKUP_ARRAY[i]="no" printf "Not backing up '%s' configuration.\n" "$x" snapper -c "$x" delete "$new_num" fi - i=$((i+1)) + i=$((i + 1)) done @@ -429,12 +429,12 @@ printf "\nPerforming backups...\n" i=-1 for x in $selected_configs; do - i=$((i+1)) + i=$((i + 1)) SNAP_SYNC_EXCLUDE=no if [[ -f "/etc/snapper/configs/$x" ]]; then - # shellcheck source=/etc/snapper/config-templates/default + # shellcheck source=/dev/null source "/etc/snapper/configs/$x" else die "Selected snapper configuration $x does not exist." @@ -459,14 +459,14 @@ for x in $selected_configs; do new_info="${NEW_INFO_ARRAY[$i]}" backup_location="${BACKUPLOC_ARRAY[$i]}" - if ($ssh test -d "$backup_location/snapshot") ; then + if ($ssh test -d "$backup_location/snapshot"); then printf "ERROR: Backup directory '%s' already exists. Skipping backup of this configuration!\n" "$backup_location/snapshot" continue fi $ssh mkdir -p "$backup_location" - if [[ -z "$old_num" ]]; then + if [[ -z $old_num ]]; then printf "Sending first snapshot for '%s' configuration...\n" "$x" if [[ $doprogress -eq 0 ]]; then btrfs send "$new_snap" | pv | $ssh btrfs receive "$backup_location" &>/dev/null @@ -522,7 +522,7 @@ done printf "\nDone!\n" -if [[ "$uuid_cmdline" != "none" ]]; then +if [[ $uuid_cmdline != "none" ]]; then notify_info "Finished" "Backups to $uuid_cmdline complete!" else notify_info "Finished" "Backups complete!" diff --git a/sys/nixpkgs/pkgs/tree-sitter-yts/Cargo.toml b/sys/nixpkgs/pkgs/tree-sitter-yts/Cargo.toml index 9756d2fe..5287c420 100644 --- a/sys/nixpkgs/pkgs/tree-sitter-yts/Cargo.toml +++ b/sys/nixpkgs/pkgs/tree-sitter-yts/Cargo.toml @@ -9,12 +9,7 @@ edition = "2018" license = "MIT" build = "bindings/rust/build.rs" -include = [ - "bindings/rust/*", - "grammar.js", - "queries/*", - "src/*", -] +include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"] [lib] path = "bindings/rust/lib.rs" diff --git a/sys/nixpkgs/pkgs/tree-sitter-yts/bindings/node/binding.cc b/sys/nixpkgs/pkgs/tree-sitter-yts/bindings/node/binding.cc index de7d0497..a042be54 100644 --- a/sys/nixpkgs/pkgs/tree-sitter-yts/bindings/node/binding.cc +++ b/sys/nixpkgs/pkgs/tree-sitter-yts/bindings/node/binding.cc @@ -1,28 +1,33 @@ +#include "nan.h" #include "tree_sitter/parser.h" #include <node.h> -#include "nan.h" using namespace v8; -extern "C" TSLanguage * tree_sitter_yts(); +extern "C" TSLanguage *tree_sitter_yts (); -namespace { +namespace +{ -NAN_METHOD(New) {} +NAN_METHOD (New) {} -void Init(Local<Object> exports, Local<Object> module) { - Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New); - tpl->SetClassName(Nan::New("Language").ToLocalChecked()); - tpl->InstanceTemplate()->SetInternalFieldCount(1); +void +Init (Local<Object> exports, Local<Object> module) +{ + Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate> (New); + tpl->SetClassName (Nan::New ("Language").ToLocalChecked ()); + tpl->InstanceTemplate ()->SetInternalFieldCount (1); - Local<Function> constructor = Nan::GetFunction(tpl).ToLocalChecked(); - Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked(); - Nan::SetInternalFieldPointer(instance, 0, tree_sitter_yts()); + Local<Function> constructor = Nan::GetFunction (tpl).ToLocalChecked (); + Local<Object> instance + = constructor->NewInstance (Nan::GetCurrentContext ()).ToLocalChecked (); + Nan::SetInternalFieldPointer (instance, 0, tree_sitter_yts ()); - Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("yts").ToLocalChecked()); - Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance); + Nan::Set (instance, Nan::New ("name").ToLocalChecked (), + Nan::New ("yts").ToLocalChecked ()); + Nan::Set (module, Nan::New ("exports").ToLocalChecked (), instance); } -NODE_MODULE(tree_sitter_yts_binding, Init) +NODE_MODULE (tree_sitter_yts_binding, Init) -} // namespace +} // namespace diff --git a/sys/nixpkgs/pkgs/tree-sitter-yts/src/parser.c b/sys/nixpkgs/pkgs/tree-sitter-yts/src/parser.c index 5b02c3d0..ded5c342 100644 --- a/sys/nixpkgs/pkgs/tree-sitter-yts/src/parser.c +++ b/sys/nixpkgs/pkgs/tree-sitter-yts/src/parser.c @@ -16,7 +16,8 @@ #define MAX_ALIAS_SEQUENCE_LENGTH 8 #define PRODUCTION_ID_COUNT 1 -enum { +enum +{ anon_sym_LF = 1, anon_sym_pick = 2, anon_sym_p = 3, @@ -48,7 +49,7 @@ enum { aux_sym_source_file_repeat1 = 29, }; -static const char * const ts_symbol_names[] = { +static const char *const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", [anon_sym_LF] = "\n", [anon_sym_pick] = "pick", @@ -237,409 +238,474 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { }, }; -static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { - [0] = {0}, -}; +static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT] + [MAX_ALIAS_SEQUENCE_LENGTH] + = { + [0] = { 0 }, + }; static const uint16_t ts_non_terminal_alias_map[] = { 0, }; static const TSStateId ts_primary_state_ids[STATE_COUNT] = { - [0] = 0, - [1] = 1, - [2] = 2, - [3] = 3, - [4] = 4, - [5] = 5, - [6] = 6, - [7] = 7, - [8] = 8, - [9] = 9, - [10] = 10, - [11] = 11, - [12] = 12, - [13] = 13, - [14] = 14, - [15] = 15, - [16] = 16, - [17] = 17, - [18] = 18, - [19] = 19, - [20] = 20, - [21] = 21, - [22] = 22, - [23] = 23, - [24] = 24, - [25] = 25, - [26] = 26, - [27] = 27, - [28] = 28, - [29] = 29, - [30] = 30, + [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, + [7] = 7, [8] = 8, [9] = 9, [10] = 10, [11] = 11, [12] = 12, [13] = 13, + [14] = 14, [15] = 15, [16] = 16, [17] = 17, [18] = 18, [19] = 19, [20] = 20, + [21] = 21, [22] = 22, [23] = 23, [24] = 24, [25] = 25, [26] = 26, [27] = 27, + [28] = 28, [29] = 29, [30] = 30, }; -static bool ts_lex(TSLexer *lexer, TSStateId state) { - START_LEXER(); - eof = lexer->eof(lexer); - switch (state) { +static bool +ts_lex (TSLexer *lexer, TSStateId state) +{ + START_LEXER (); + eof = lexer->eof (lexer); + switch (state) + { case 0: - if (eof) ADVANCE(47); - if (lookahead == '"') ADVANCE(74); - if (lookahead == '#') ADVANCE(73); - if (lookahead == 'N') ADVANCE(30); - if (lookahead == '[') ADVANCE(68); - if (lookahead == '\\') SKIP(46) - if (lookahead == ']') ADVANCE(72); - if (lookahead == 'd') ADVANCE(54); - if (lookahead == 'p') ADVANCE(50); - if (lookahead == 'u') ADVANCE(56); - if (lookahead == 'w') ADVANCE(52); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') SKIP(0) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(60); - END_STATE(); + if (eof) + ADVANCE (47); + if (lookahead == '"') + ADVANCE (74); + if (lookahead == '#') + ADVANCE (73); + if (lookahead == 'N') + ADVANCE (30); + if (lookahead == '[') + ADVANCE (68); + if (lookahead == '\\') + SKIP (46) + if (lookahead == ']') + ADVANCE (72); + if (lookahead == 'd') + ADVANCE (54); + if (lookahead == 'p') + ADVANCE (50); + if (lookahead == 'u') + ADVANCE (56); + if (lookahead == 'w') + ADVANCE (52); + if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' + || lookahead == ' ') + SKIP (0) + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (60); + END_STATE (); case 1: - if (lookahead == '\n') SKIP(14) - END_STATE(); + if (lookahead == '\n') + SKIP (14) + END_STATE (); case 2: - if (lookahead == '\n') SKIP(14) - if (lookahead == '\r') SKIP(1) - END_STATE(); + if (lookahead == '\n') + SKIP (14) + if (lookahead == '\r') + SKIP (1) + END_STATE (); case 3: - if (lookahead == '\n') SKIP(16) - END_STATE(); + if (lookahead == '\n') + SKIP (16) + END_STATE (); case 4: - if (lookahead == '\n') SKIP(16) - if (lookahead == '\r') SKIP(3) - END_STATE(); + if (lookahead == '\n') + SKIP (16) + if (lookahead == '\r') + SKIP (3) + END_STATE (); case 5: - if (lookahead == '\n') SKIP(7) - END_STATE(); + if (lookahead == '\n') + SKIP (7) + END_STATE (); case 6: - if (lookahead == '\n') SKIP(7) - if (lookahead == '\r') SKIP(5) - END_STATE(); + if (lookahead == '\n') + SKIP (7) + if (lookahead == '\r') + SKIP (5) + END_STATE (); case 7: - if (lookahead == '\n') ADVANCE(48); - if (lookahead == '\\') SKIP(6) - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') SKIP(7) - END_STATE(); + if (lookahead == '\n') + ADVANCE (48); + if (lookahead == '\\') + SKIP (6) + if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') + SKIP (7) + END_STATE (); case 8: - if (lookahead == ' ') ADVANCE(13); - END_STATE(); + if (lookahead == ' ') + ADVANCE (13); + END_STATE (); case 9: - if (lookahead == ' ') ADVANCE(39); - END_STATE(); + if (lookahead == ' ') + ADVANCE (39); + END_STATE (); case 10: - if (lookahead == ' ') ADVANCE(40); - END_STATE(); + if (lookahead == ' ') + ADVANCE (40); + END_STATE (); case 11: - if (lookahead == '-') ADVANCE(43); - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(24); - END_STATE(); + if (lookahead == '-') + ADVANCE (43); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (24); + END_STATE (); case 12: - if (lookahead == '-') ADVANCE(44); - END_STATE(); + if (lookahead == '-') + ADVANCE (44); + END_STATE (); case 13: - if (lookahead == 'D') ADVANCE(38); - END_STATE(); + if (lookahead == 'D') + ADVANCE (38); + END_STATE (); case 14: - if (lookahead == 'N') ADVANCE(30); - if (lookahead == '\\') SKIP(2) - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') SKIP(14) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(23); - END_STATE(); + if (lookahead == 'N') + ADVANCE (30); + if (lookahead == '\\') + SKIP (2) + if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' + || lookahead == ' ') + SKIP (14) + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (23); + END_STATE (); case 15: - if (lookahead == '\\') ADVANCE(63); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(65); - if (lookahead != 0 && - lookahead != '"') ADVANCE(66); - END_STATE(); + if (lookahead == '\\') + ADVANCE (63); + if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' + || lookahead == ' ') + ADVANCE (65); + if (lookahead != 0 && lookahead != '"') + ADVANCE (66); + END_STATE (); case 16: - if (lookahead == '\\') SKIP(4) - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') SKIP(16) - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(62); - END_STATE(); + if (lookahead == '\\') + SKIP (4) + if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' + || lookahead == ' ') + SKIP (16) + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (62); + END_STATE (); case 17: - if (lookahead == 'a') ADVANCE(36); - END_STATE(); + if (lookahead == 'a') + ADVANCE (36); + END_STATE (); case 18: - if (lookahead == 'c') ADVANCE(26); - END_STATE(); + if (lookahead == 'c') + ADVANCE (26); + END_STATE (); case 19: - if (lookahead == 'c') ADVANCE(20); - END_STATE(); + if (lookahead == 'c') + ADVANCE (20); + END_STATE (); case 20: - if (lookahead == 'h') ADVANCE(51); - END_STATE(); + if (lookahead == 'h') + ADVANCE (51); + END_STATE (); case 21: - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(11); - END_STATE(); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (11); + END_STATE (); case 22: - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(21); - END_STATE(); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (21); + END_STATE (); case 23: - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(22); - END_STATE(); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (22); + END_STATE (); case 24: - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(24); - END_STATE(); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (24); + END_STATE (); case 25: - if (lookahead == 'i') ADVANCE(32); - END_STATE(); + if (lookahead == 'i') + ADVANCE (32); + END_STATE (); case 26: - if (lookahead == 'k') ADVANCE(49); - END_STATE(); + if (lookahead == 'k') + ADVANCE (49); + END_STATE (); case 27: - if (lookahead == 'l') ADVANCE(55); - END_STATE(); + if (lookahead == 'l') + ADVANCE (55); + END_STATE (); case 28: - if (lookahead == 'm') ADVANCE(71); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(28); - END_STATE(); + if (lookahead == 'm') + ADVANCE (71); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (28); + END_STATE (); case 29: - if (lookahead == 'n') ADVANCE(69); - END_STATE(); + if (lookahead == 'n') + ADVANCE (69); + END_STATE (); case 30: - if (lookahead == 'o') ADVANCE(8); - END_STATE(); + if (lookahead == 'o') + ADVANCE (8); + END_STATE (); case 31: - if (lookahead == 'o') ADVANCE(33); - END_STATE(); + if (lookahead == 'o') + ADVANCE (33); + END_STATE (); case 32: - if (lookahead == 'o') ADVANCE(29); - END_STATE(); + if (lookahead == 'o') + ADVANCE (29); + END_STATE (); case 33: - if (lookahead == 'p') ADVANCE(53); - END_STATE(); + if (lookahead == 'p') + ADVANCE (53); + END_STATE (); case 34: - if (lookahead == 'r') ADVANCE(17); - END_STATE(); + if (lookahead == 'r') + ADVANCE (17); + END_STATE (); case 35: - if (lookahead == 's') ADVANCE(70); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); - END_STATE(); + if (lookahead == 's') + ADVANCE (70); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (35); + END_STATE (); case 36: - if (lookahead == 't') ADVANCE(25); - END_STATE(); + if (lookahead == 't') + ADVANCE (25); + END_STATE (); case 37: - if (lookahead == 't') ADVANCE(19); - END_STATE(); + if (lookahead == 't') + ADVANCE (19); + END_STATE (); case 38: - if (lookahead == 'u') ADVANCE(34); - END_STATE(); + if (lookahead == 'u') + ADVANCE (34); + END_STATE (); case 39: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(28); - END_STATE(); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (28); + END_STATE (); case 40: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); - END_STATE(); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (35); + END_STATE (); case 41: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(12); - END_STATE(); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (12); + END_STATE (); case 42: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(67); - END_STATE(); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (67); + END_STATE (); case 43: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(41); - END_STATE(); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (41); + END_STATE (); case 44: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(42); - END_STATE(); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (42); + END_STATE (); case 45: - if (eof) ADVANCE(47); - if (lookahead == '\n') SKIP(0) - END_STATE(); + if (eof) + ADVANCE (47); + if (lookahead == '\n') + SKIP (0) + END_STATE (); case 46: - if (eof) ADVANCE(47); - if (lookahead == '\n') SKIP(0) - if (lookahead == '\r') SKIP(45) - END_STATE(); + if (eof) + ADVANCE (47); + if (lookahead == '\n') + SKIP (0) + if (lookahead == '\r') + SKIP (45) + END_STATE (); case 47: - ACCEPT_TOKEN(ts_builtin_sym_end); - END_STATE(); + ACCEPT_TOKEN (ts_builtin_sym_end); + END_STATE (); case 48: - ACCEPT_TOKEN(anon_sym_LF); - if (lookahead == '\n') ADVANCE(48); - END_STATE(); + ACCEPT_TOKEN (anon_sym_LF); + if (lookahead == '\n') + ADVANCE (48); + END_STATE (); case 49: - ACCEPT_TOKEN(anon_sym_pick); - END_STATE(); + ACCEPT_TOKEN (anon_sym_pick); + END_STATE (); case 50: - ACCEPT_TOKEN(anon_sym_p); - if (lookahead == 'i') ADVANCE(18); - END_STATE(); + ACCEPT_TOKEN (anon_sym_p); + if (lookahead == 'i') + ADVANCE (18); + END_STATE (); case 51: - ACCEPT_TOKEN(anon_sym_watch); - END_STATE(); + ACCEPT_TOKEN (anon_sym_watch); + END_STATE (); case 52: - ACCEPT_TOKEN(anon_sym_w); - if (lookahead == 'a') ADVANCE(37); - END_STATE(); + ACCEPT_TOKEN (anon_sym_w); + if (lookahead == 'a') + ADVANCE (37); + END_STATE (); case 53: - ACCEPT_TOKEN(anon_sym_drop); - END_STATE(); + ACCEPT_TOKEN (anon_sym_drop); + END_STATE (); case 54: - ACCEPT_TOKEN(anon_sym_d); - if (lookahead == 'r') ADVANCE(31); - END_STATE(); + ACCEPT_TOKEN (anon_sym_d); + if (lookahead == 'r') + ADVANCE (31); + END_STATE (); case 55: - ACCEPT_TOKEN(anon_sym_url); - END_STATE(); + ACCEPT_TOKEN (anon_sym_url); + END_STATE (); case 56: - ACCEPT_TOKEN(anon_sym_u); - if (lookahead == 'r') ADVANCE(27); - END_STATE(); + ACCEPT_TOKEN (anon_sym_u); + if (lookahead == 'r') + ADVANCE (27); + END_STATE (); case 57: - ACCEPT_TOKEN(sym_id); - if (lookahead == '-') ADVANCE(43); - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(61); - END_STATE(); + ACCEPT_TOKEN (sym_id); + if (lookahead == '-') + ADVANCE (43); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (61); + END_STATE (); case 58: - ACCEPT_TOKEN(sym_id); - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(57); - END_STATE(); + ACCEPT_TOKEN (sym_id); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (57); + END_STATE (); case 59: - ACCEPT_TOKEN(sym_id); - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(58); - END_STATE(); + ACCEPT_TOKEN (sym_id); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (58); + END_STATE (); case 60: - ACCEPT_TOKEN(sym_id); - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(59); - END_STATE(); + ACCEPT_TOKEN (sym_id); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (59); + END_STATE (); case 61: - ACCEPT_TOKEN(sym_id); - if (lookahead == 'h') ADVANCE(9); - if (lookahead == 'm') ADVANCE(10); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(61); - END_STATE(); + ACCEPT_TOKEN (sym_id); + if (lookahead == 'h') + ADVANCE (9); + if (lookahead == 'm') + ADVANCE (10); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (61); + END_STATE (); case 62: - ACCEPT_TOKEN(sym_id); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(62); - END_STATE(); + ACCEPT_TOKEN (sym_id); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE (62); + END_STATE (); case 63: - ACCEPT_TOKEN(aux_sym_title_token1); - if (lookahead == '\n') ADVANCE(65); - if (lookahead == '\r') ADVANCE(64); - if (lookahead != 0 && - lookahead != '"') ADVANCE(66); - END_STATE(); + ACCEPT_TOKEN (aux_sym_title_token1); + if (lookahead == '\n') + ADVANCE (65); + if (lookahead == '\r') + ADVANCE (64); + if (lookahead != 0 && lookahead != '"') + ADVANCE (66); + END_STATE (); case 64: - ACCEPT_TOKEN(aux_sym_title_token1); - if (lookahead == '\n') ADVANCE(65); - if (lookahead != 0 && - lookahead != '"') ADVANCE(66); - END_STATE(); + ACCEPT_TOKEN (aux_sym_title_token1); + if (lookahead == '\n') + ADVANCE (65); + if (lookahead != 0 && lookahead != '"') + ADVANCE (66); + END_STATE (); case 65: - ACCEPT_TOKEN(aux_sym_title_token1); - if (lookahead == '\\') ADVANCE(63); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(65); - if (lookahead != 0 && - lookahead != '"') ADVANCE(66); - END_STATE(); + ACCEPT_TOKEN (aux_sym_title_token1); + if (lookahead == '\\') + ADVANCE (63); + if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' + || lookahead == ' ') + ADVANCE (65); + if (lookahead != 0 && lookahead != '"') + ADVANCE (66); + END_STATE (); case 66: - ACCEPT_TOKEN(aux_sym_title_token1); - if (lookahead != 0 && - lookahead != '"') ADVANCE(66); - END_STATE(); + ACCEPT_TOKEN (aux_sym_title_token1); + if (lookahead != 0 && lookahead != '"') + ADVANCE (66); + END_STATE (); case 67: - ACCEPT_TOKEN(aux_sym_date_token1); - END_STATE(); + ACCEPT_TOKEN (aux_sym_date_token1); + END_STATE (); case 68: - ACCEPT_TOKEN(anon_sym_LBRACK); - END_STATE(); + ACCEPT_TOKEN (anon_sym_LBRACK); + END_STATE (); case 69: - ACCEPT_TOKEN(anon_sym_NoDuration); - END_STATE(); + ACCEPT_TOKEN (anon_sym_NoDuration); + END_STATE (); case 70: - ACCEPT_TOKEN(aux_sym_duration_token1); - END_STATE(); + ACCEPT_TOKEN (aux_sym_duration_token1); + END_STATE (); case 71: - ACCEPT_TOKEN(aux_sym_duration_token2); - END_STATE(); + ACCEPT_TOKEN (aux_sym_duration_token2); + END_STATE (); case 72: - ACCEPT_TOKEN(anon_sym_RBRACK); - END_STATE(); + ACCEPT_TOKEN (anon_sym_RBRACK); + END_STATE (); case 73: - ACCEPT_TOKEN(sym_comment); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(73); - END_STATE(); + ACCEPT_TOKEN (sym_comment); + if (lookahead != 0 && lookahead != '\n') + ADVANCE (73); + END_STATE (); case 74: - ACCEPT_TOKEN(sym_quote); - END_STATE(); + ACCEPT_TOKEN (sym_quote); + END_STATE (); default: return false; - } + } } static const TSLexMode ts_lex_modes[STATE_COUNT] = { - [0] = {.lex_state = 0}, - [1] = {.lex_state = 0}, - [2] = {.lex_state = 0}, - [3] = {.lex_state = 0}, - [4] = {.lex_state = 0}, - [5] = {.lex_state = 0}, - [6] = {.lex_state = 0}, - [7] = {.lex_state = 0}, - [8] = {.lex_state = 14}, - [9] = {.lex_state = 0}, - [10] = {.lex_state = 0}, - [11] = {.lex_state = 0}, - [12] = {.lex_state = 0}, - [13] = {.lex_state = 0}, - [14] = {.lex_state = 0}, - [15] = {.lex_state = 0}, - [16] = {.lex_state = 15}, - [17] = {.lex_state = 0}, - [18] = {.lex_state = 0}, - [19] = {.lex_state = 16}, - [20] = {.lex_state = 0}, - [21] = {.lex_state = 7}, - [22] = {.lex_state = 15}, - [23] = {.lex_state = 14}, - [24] = {.lex_state = 0}, - [25] = {.lex_state = 15}, - [26] = {.lex_state = 16}, - [27] = {.lex_state = 0}, - [28] = {.lex_state = 7}, - [29] = {.lex_state = 0}, - [30] = {.lex_state = 0}, + [0] = { .lex_state = 0 }, [1] = { .lex_state = 0 }, + [2] = { .lex_state = 0 }, [3] = { .lex_state = 0 }, + [4] = { .lex_state = 0 }, [5] = { .lex_state = 0 }, + [6] = { .lex_state = 0 }, [7] = { .lex_state = 0 }, + [8] = { .lex_state = 14 }, [9] = { .lex_state = 0 }, + [10] = { .lex_state = 0 }, [11] = { .lex_state = 0 }, + [12] = { .lex_state = 0 }, [13] = { .lex_state = 0 }, + [14] = { .lex_state = 0 }, [15] = { .lex_state = 0 }, + [16] = { .lex_state = 15 }, [17] = { .lex_state = 0 }, + [18] = { .lex_state = 0 }, [19] = { .lex_state = 16 }, + [20] = { .lex_state = 0 }, [21] = { .lex_state = 7 }, + [22] = { .lex_state = 15 }, [23] = { .lex_state = 14 }, + [24] = { .lex_state = 0 }, [25] = { .lex_state = 15 }, + [26] = { .lex_state = 16 }, [27] = { .lex_state = 0 }, + [28] = { .lex_state = 7 }, [29] = { .lex_state = 0 }, + [30] = { .lex_state = 0 }, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -683,279 +749,360 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { static const uint16_t ts_small_parse_table[] = { [0] = 6, - ACTIONS(11), 1, - ts_builtin_sym_end, - ACTIONS(13), 1, - sym_comment, - STATE(26), 1, - sym_command, - STATE(3), 2, - sym_line, - aux_sym_source_file_repeat1, - ACTIONS(5), 4, - anon_sym_pick, - anon_sym_watch, - anon_sym_drop, - anon_sym_url, - ACTIONS(7), 4, - anon_sym_p, - anon_sym_w, - anon_sym_d, - anon_sym_u, + ACTIONS (11), + 1, + ts_builtin_sym_end, + ACTIONS (13), + 1, + sym_comment, + STATE (26), + 1, + sym_command, + STATE (3), + 2, + sym_line, + aux_sym_source_file_repeat1, + ACTIONS (5), + 4, + anon_sym_pick, + anon_sym_watch, + anon_sym_drop, + anon_sym_url, + ACTIONS (7), + 4, + anon_sym_p, + anon_sym_w, + anon_sym_d, + anon_sym_u, [26] = 6, - ACTIONS(15), 1, - ts_builtin_sym_end, - ACTIONS(23), 1, - sym_comment, - STATE(26), 1, - sym_command, - STATE(3), 2, - sym_line, - aux_sym_source_file_repeat1, - ACTIONS(17), 4, - anon_sym_pick, - anon_sym_watch, - anon_sym_drop, - anon_sym_url, - ACTIONS(20), 4, - anon_sym_p, - anon_sym_w, - anon_sym_d, - anon_sym_u, + ACTIONS (15), + 1, + ts_builtin_sym_end, + ACTIONS (23), + 1, + sym_comment, + STATE (26), + 1, + sym_command, + STATE (3), + 2, + sym_line, + aux_sym_source_file_repeat1, + ACTIONS (17), + 4, + anon_sym_pick, + anon_sym_watch, + anon_sym_drop, + anon_sym_url, + ACTIONS (20), + 4, + anon_sym_p, + anon_sym_w, + anon_sym_d, + anon_sym_u, [52] = 2, - ACTIONS(28), 4, - anon_sym_p, - anon_sym_w, - anon_sym_d, - anon_sym_u, - ACTIONS(26), 6, - ts_builtin_sym_end, - anon_sym_pick, - anon_sym_watch, - anon_sym_drop, - anon_sym_url, - sym_comment, + ACTIONS (28), + 4, + anon_sym_p, + anon_sym_w, + anon_sym_d, + anon_sym_u, + ACTIONS (26), + 6, + ts_builtin_sym_end, + anon_sym_pick, + anon_sym_watch, + anon_sym_drop, + anon_sym_url, + sym_comment, [67] = 3, - ACTIONS(30), 1, - sym_quote, - STATE(21), 1, - sym_url, - STATE(22), 1, - sym__q, + ACTIONS (30), + 1, + sym_quote, + STATE (21), + 1, + sym_url, + STATE (22), + 1, + sym__q, [77] = 3, - ACTIONS(32), 1, - sym_quote, - STATE(7), 1, - sym_title, - STATE(25), 1, - sym__q, + ACTIONS (32), + 1, + sym_quote, + STATE (7), + 1, + sym_title, + STATE (25), + 1, + sym__q, [87] = 3, - ACTIONS(34), 1, - sym_quote, - STATE(9), 1, - sym_date, - STATE(23), 1, - sym__q, + ACTIONS (34), + 1, + sym_quote, + STATE (9), + 1, + sym_date, + STATE (23), + 1, + sym__q, [97] = 1, - ACTIONS(36), 3, - anon_sym_NoDuration, - aux_sym_duration_token1, - aux_sym_duration_token2, + ACTIONS (36), + 3, + anon_sym_NoDuration, + aux_sym_duration_token1, + aux_sym_duration_token2, [103] = 3, - ACTIONS(38), 1, - sym_quote, - STATE(10), 1, - sym_author, - STATE(16), 1, - sym__q, + ACTIONS (38), + 1, + sym_quote, + STATE (10), + 1, + sym_author, + STATE (16), + 1, + sym__q, [113] = 3, - ACTIONS(40), 1, - sym_quote, - STATE(5), 1, - sym_duration, - STATE(18), 1, - sym__q, + ACTIONS (40), + 1, + sym_quote, + STATE (5), + 1, + sym_duration, + STATE (18), + 1, + sym__q, [123] = 2, - ACTIONS(42), 1, - sym_quote, - STATE(30), 1, - sym__q, + ACTIONS (42), + 1, + sym_quote, + STATE (30), + 1, + sym__q, [130] = 2, - ACTIONS(44), 1, - sym_quote, - STATE(28), 1, - sym__q, + ACTIONS (44), + 1, + sym_quote, + STATE (28), + 1, + sym__q, [137] = 2, - ACTIONS(46), 1, - sym_quote, - STATE(24), 1, - sym__q, + ACTIONS (46), + 1, + sym_quote, + STATE (24), + 1, + sym__q, [144] = 2, - ACTIONS(48), 1, - sym_quote, - STATE(17), 1, - sym__q, + ACTIONS (48), + 1, + sym_quote, + STATE (17), + 1, + sym__q, [151] = 2, - ACTIONS(50), 1, - sym_quote, - STATE(20), 1, - sym__q, + ACTIONS (50), + 1, + sym_quote, + STATE (20), + 1, + sym__q, [158] = 1, - ACTIONS(52), 1, - aux_sym_title_token1, + ACTIONS (52), + 1, + aux_sym_title_token1, [162] = 1, - ACTIONS(54), 1, - sym_quote, + ACTIONS (54), + 1, + sym_quote, [166] = 1, - ACTIONS(56), 1, - anon_sym_LBRACK, + ACTIONS (56), + 1, + anon_sym_LBRACK, [170] = 1, - ACTIONS(58), 1, - sym_id, + ACTIONS (58), + 1, + sym_id, [174] = 1, - ACTIONS(60), 1, - sym_quote, + ACTIONS (60), + 1, + sym_quote, [178] = 1, - ACTIONS(62), 1, - anon_sym_LF, + ACTIONS (62), + 1, + anon_sym_LF, [182] = 1, - ACTIONS(64), 1, - aux_sym_title_token1, + ACTIONS (64), + 1, + aux_sym_title_token1, [186] = 1, - ACTIONS(66), 1, - aux_sym_date_token1, + ACTIONS (66), + 1, + aux_sym_date_token1, [190] = 1, - ACTIONS(68), 1, - sym_quote, + ACTIONS (68), + 1, + sym_quote, [194] = 1, - ACTIONS(70), 1, - aux_sym_title_token1, + ACTIONS (70), + 1, + aux_sym_title_token1, [198] = 1, - ACTIONS(72), 1, - sym_id, + ACTIONS (72), + 1, + sym_id, [202] = 1, - ACTIONS(74), 1, - anon_sym_RBRACK, + ACTIONS (74), + 1, + anon_sym_RBRACK, [206] = 1, - ACTIONS(76), 1, - anon_sym_LF, + ACTIONS (76), + 1, + anon_sym_LF, [210] = 1, - ACTIONS(78), 1, - ts_builtin_sym_end, + ACTIONS (78), + 1, + ts_builtin_sym_end, [214] = 1, - ACTIONS(80), 1, - sym_quote, + ACTIONS (80), + 1, + sym_quote, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(2)] = 0, - [SMALL_STATE(3)] = 26, - [SMALL_STATE(4)] = 52, - [SMALL_STATE(5)] = 67, - [SMALL_STATE(6)] = 77, - [SMALL_STATE(7)] = 87, - [SMALL_STATE(8)] = 97, - [SMALL_STATE(9)] = 103, - [SMALL_STATE(10)] = 113, - [SMALL_STATE(11)] = 123, - [SMALL_STATE(12)] = 130, - [SMALL_STATE(13)] = 137, - [SMALL_STATE(14)] = 144, - [SMALL_STATE(15)] = 151, - [SMALL_STATE(16)] = 158, - [SMALL_STATE(17)] = 162, - [SMALL_STATE(18)] = 166, - [SMALL_STATE(19)] = 170, - [SMALL_STATE(20)] = 174, - [SMALL_STATE(21)] = 178, - [SMALL_STATE(22)] = 182, - [SMALL_STATE(23)] = 186, - [SMALL_STATE(24)] = 190, - [SMALL_STATE(25)] = 194, - [SMALL_STATE(26)] = 198, - [SMALL_STATE(27)] = 202, - [SMALL_STATE(28)] = 206, - [SMALL_STATE(29)] = 210, - [SMALL_STATE(30)] = 214, + [SMALL_STATE (2)] = 0, [SMALL_STATE (3)] = 26, [SMALL_STATE (4)] = 52, + [SMALL_STATE (5)] = 67, [SMALL_STATE (6)] = 77, [SMALL_STATE (7)] = 87, + [SMALL_STATE (8)] = 97, [SMALL_STATE (9)] = 103, [SMALL_STATE (10)] = 113, + [SMALL_STATE (11)] = 123, [SMALL_STATE (12)] = 130, [SMALL_STATE (13)] = 137, + [SMALL_STATE (14)] = 144, [SMALL_STATE (15)] = 151, [SMALL_STATE (16)] = 158, + [SMALL_STATE (17)] = 162, [SMALL_STATE (18)] = 166, [SMALL_STATE (19)] = 170, + [SMALL_STATE (20)] = 174, [SMALL_STATE (21)] = 178, [SMALL_STATE (22)] = 182, + [SMALL_STATE (23)] = 186, [SMALL_STATE (24)] = 190, [SMALL_STATE (25)] = 194, + [SMALL_STATE (26)] = 198, [SMALL_STATE (27)] = 202, [SMALL_STATE (28)] = 206, + [SMALL_STATE (29)] = 210, [SMALL_STATE (30)] = 214, }; static const TSParseActionEntry ts_parse_actions[] = { - [0] = {.entry = {.count = 0, .reusable = false}}, - [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), - [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), - [11] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), - [15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [17] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(19), - [20] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(19), - [23] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(3), - [26] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_line, 8), - [28] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_line, 8), - [30] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [32] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), - [34] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [36] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [38] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [40] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [42] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), - [44] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), - [46] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [48] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), - [50] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), - [52] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), - [54] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_title, 3), - [56] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), - [58] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_command, 1), - [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_date, 3), - [62] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [64] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), - [66] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [68] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_author, 3), - [70] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), - [72] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [74] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [76] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_url, 3), - [78] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [80] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_duration, 5), + [0] = { .entry = { .count = 0, .reusable = false } }, + [1] = { .entry = { .count = 1, .reusable = false } }, + RECOVER (), + [3] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_source_file, 0), + [5] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (19), + [7] = { .entry = { .count = 1, .reusable = false } }, + SHIFT (19), + [9] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (2), + [11] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_source_file, 1), + [13] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (3), + [15] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (aux_sym_source_file_repeat1, 2), + [17] = { .entry = { .count = 2, .reusable = true } }, + REDUCE (aux_sym_source_file_repeat1, 2), + SHIFT_REPEAT (19), + [20] = { .entry = { .count = 2, .reusable = false } }, + REDUCE (aux_sym_source_file_repeat1, 2), + SHIFT_REPEAT (19), + [23] = { .entry = { .count = 2, .reusable = true } }, + REDUCE (aux_sym_source_file_repeat1, 2), + SHIFT_REPEAT (3), + [26] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_line, 8), + [28] = { .entry = { .count = 1, .reusable = false } }, + REDUCE (sym_line, 8), + [30] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (22), + [32] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (25), + [34] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (23), + [36] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (27), + [38] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (16), + [40] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (18), + [42] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (30), + [44] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (28), + [46] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (24), + [48] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (17), + [50] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (20), + [52] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (13), + [54] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_title, 3), + [56] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (8), + [58] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_command, 1), + [60] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_date, 3), + [62] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (4), + [64] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (12), + [66] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (15), + [68] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_author, 3), + [70] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (14), + [72] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (6), + [74] = { .entry = { .count = 1, .reusable = true } }, + SHIFT (11), + [76] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_url, 3), + [78] = { .entry = { .count = 1, .reusable = true } }, + ACCEPT_INPUT (), + [80] = { .entry = { .count = 1, .reusable = true } }, + REDUCE (sym_duration, 5), }; #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #ifdef _WIN32 -#define extern __declspec(dllexport) +#define extern __declspec (dllexport) #endif -extern const TSLanguage *tree_sitter_yts(void) { - static const TSLanguage language = { - .version = LANGUAGE_VERSION, - .symbol_count = SYMBOL_COUNT, - .alias_count = ALIAS_COUNT, - .token_count = TOKEN_COUNT, - .external_token_count = EXTERNAL_TOKEN_COUNT, - .state_count = STATE_COUNT, - .large_state_count = LARGE_STATE_COUNT, - .production_id_count = PRODUCTION_ID_COUNT, - .field_count = FIELD_COUNT, - .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, - .parse_table = &ts_parse_table[0][0], - .small_parse_table = ts_small_parse_table, - .small_parse_table_map = ts_small_parse_table_map, - .parse_actions = ts_parse_actions, - .symbol_names = ts_symbol_names, - .symbol_metadata = ts_symbol_metadata, - .public_symbol_map = ts_symbol_map, - .alias_map = ts_non_terminal_alias_map, - .alias_sequences = &ts_alias_sequences[0][0], - .lex_modes = ts_lex_modes, - .lex_fn = ts_lex, - .primary_state_ids = ts_primary_state_ids, - }; - return &language; -} + extern const TSLanguage * + tree_sitter_yts (void) + { + static const TSLanguage language = { + .version = LANGUAGE_VERSION, + .symbol_count = SYMBOL_COUNT, + .alias_count = ALIAS_COUNT, + .token_count = TOKEN_COUNT, + .external_token_count = EXTERNAL_TOKEN_COUNT, + .state_count = STATE_COUNT, + .large_state_count = LARGE_STATE_COUNT, + .production_id_count = PRODUCTION_ID_COUNT, + .field_count = FIELD_COUNT, + .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, + .parse_table = &ts_parse_table[0][0], + .small_parse_table = ts_small_parse_table, + .small_parse_table_map = ts_small_parse_table_map, + .parse_actions = ts_parse_actions, + .symbol_names = ts_symbol_names, + .symbol_metadata = ts_symbol_metadata, + .public_symbol_map = ts_symbol_map, + .alias_map = ts_non_terminal_alias_map, + .alias_sequences = &ts_alias_sequences[0][0], + .lex_modes = ts_lex_modes, + .lex_fn = ts_lex, + .primary_state_ids = ts_primary_state_ids, + }; + return &language; + } #ifdef __cplusplus } #endif diff --git a/sys/nixpkgs/pkgs/tree-sitter-yts/src/tree_sitter/parser.h b/sys/nixpkgs/pkgs/tree-sitter-yts/src/tree_sitter/parser.h index 2b14ac10..972913cf 100644 --- a/sys/nixpkgs/pkgs/tree-sitter-yts/src/tree_sitter/parser.h +++ b/sys/nixpkgs/pkgs/tree-sitter-yts/src/tree_sitter/parser.h @@ -2,7 +2,8 @@ #define TREE_SITTER_PARSER_H_ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #include <stdbool.h> @@ -13,158 +14,171 @@ extern "C" { #define ts_builtin_sym_end 0 #define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 -typedef uint16_t TSStateId; + typedef uint16_t TSStateId; #ifndef TREE_SITTER_API_H_ -typedef uint16_t TSSymbol; -typedef uint16_t TSFieldId; -typedef struct TSLanguage TSLanguage; + typedef uint16_t TSSymbol; + typedef uint16_t TSFieldId; + typedef struct TSLanguage TSLanguage; #endif -typedef struct { - TSFieldId field_id; - uint8_t child_index; - bool inherited; -} TSFieldMapEntry; - -typedef struct { - uint16_t index; - uint16_t length; -} TSFieldMapSlice; - -typedef struct { - bool visible; - bool named; - bool supertype; -} TSSymbolMetadata; - -typedef struct TSLexer TSLexer; - -struct TSLexer { - int32_t lookahead; - TSSymbol result_symbol; - void (*advance)(TSLexer *, bool); - void (*mark_end)(TSLexer *); - uint32_t (*get_column)(TSLexer *); - bool (*is_at_included_range_start)(const TSLexer *); - bool (*eof)(const TSLexer *); -}; - -typedef enum { - TSParseActionTypeShift, - TSParseActionTypeReduce, - TSParseActionTypeAccept, - TSParseActionTypeRecover, -} TSParseActionType; - -typedef union { - struct { + typedef struct + { + TSFieldId field_id; + uint8_t child_index; + bool inherited; + } TSFieldMapEntry; + + typedef struct + { + uint16_t index; + uint16_t length; + } TSFieldMapSlice; + + typedef struct + { + bool visible; + bool named; + bool supertype; + } TSSymbolMetadata; + + typedef struct TSLexer TSLexer; + + struct TSLexer + { + int32_t lookahead; + TSSymbol result_symbol; + void (*advance) (TSLexer *, bool); + void (*mark_end) (TSLexer *); + uint32_t (*get_column) (TSLexer *); + bool (*is_at_included_range_start) (const TSLexer *); + bool (*eof) (const TSLexer *); + }; + + typedef enum + { + TSParseActionTypeShift, + TSParseActionTypeReduce, + TSParseActionTypeAccept, + TSParseActionTypeRecover, + } TSParseActionType; + + typedef union + { + struct + { + uint8_t type; + TSStateId state; + bool extra; + bool repetition; + } shift; + struct + { + uint8_t type; + uint8_t child_count; + TSSymbol symbol; + int16_t dynamic_precedence; + uint16_t production_id; + } reduce; uint8_t type; - TSStateId state; - bool extra; - bool repetition; - } shift; - struct { - uint8_t type; - uint8_t child_count; - TSSymbol symbol; - int16_t dynamic_precedence; - uint16_t production_id; - } reduce; - uint8_t type; -} TSParseAction; - -typedef struct { - uint16_t lex_state; - uint16_t external_lex_state; -} TSLexMode; - -typedef union { - TSParseAction action; - struct { - uint8_t count; - bool reusable; - } entry; -} TSParseActionEntry; - -struct TSLanguage { - uint32_t version; - uint32_t symbol_count; - uint32_t alias_count; - uint32_t token_count; - uint32_t external_token_count; - uint32_t state_count; - uint32_t large_state_count; - uint32_t production_id_count; - uint32_t field_count; - uint16_t max_alias_sequence_length; - const uint16_t *parse_table; - const uint16_t *small_parse_table; - const uint32_t *small_parse_table_map; - const TSParseActionEntry *parse_actions; - const char * const *symbol_names; - const char * const *field_names; - const TSFieldMapSlice *field_map_slices; - const TSFieldMapEntry *field_map_entries; - const TSSymbolMetadata *symbol_metadata; - const TSSymbol *public_symbol_map; - const uint16_t *alias_map; - const TSSymbol *alias_sequences; - const TSLexMode *lex_modes; - bool (*lex_fn)(TSLexer *, TSStateId); - bool (*keyword_lex_fn)(TSLexer *, TSStateId); - TSSymbol keyword_capture_token; - struct { - const bool *states; - const TSSymbol *symbol_map; - void *(*create)(void); - void (*destroy)(void *); - bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist); - unsigned (*serialize)(void *, char *); - void (*deserialize)(void *, const char *, unsigned); - } external_scanner; - const TSStateId *primary_state_ids; -}; - -/* - * Lexer Macros - */ - -#define START_LEXER() \ - bool result = false; \ - bool skip = false; \ - bool eof = false; \ - int32_t lookahead; \ - goto start; \ - next_state: \ - lexer->advance(lexer, skip); \ - start: \ - skip = false; \ + } TSParseAction; + + typedef struct + { + uint16_t lex_state; + uint16_t external_lex_state; + } TSLexMode; + + typedef union + { + TSParseAction action; + struct + { + uint8_t count; + bool reusable; + } entry; + } TSParseActionEntry; + + struct TSLanguage + { + uint32_t version; + uint32_t symbol_count; + uint32_t alias_count; + uint32_t token_count; + uint32_t external_token_count; + uint32_t state_count; + uint32_t large_state_count; + uint32_t production_id_count; + uint32_t field_count; + uint16_t max_alias_sequence_length; + const uint16_t *parse_table; + const uint16_t *small_parse_table; + const uint32_t *small_parse_table_map; + const TSParseActionEntry *parse_actions; + const char *const *symbol_names; + const char *const *field_names; + const TSFieldMapSlice *field_map_slices; + const TSFieldMapEntry *field_map_entries; + const TSSymbolMetadata *symbol_metadata; + const TSSymbol *public_symbol_map; + const uint16_t *alias_map; + const TSSymbol *alias_sequences; + const TSLexMode *lex_modes; + bool (*lex_fn) (TSLexer *, TSStateId); + bool (*keyword_lex_fn) (TSLexer *, TSStateId); + TSSymbol keyword_capture_token; + struct + { + const bool *states; + const TSSymbol *symbol_map; + void *(*create) (void); + void (*destroy) (void *); + bool (*scan) (void *, TSLexer *, const bool *symbol_whitelist); + unsigned (*serialize) (void *, char *); + void (*deserialize) (void *, const char *, unsigned); + } external_scanner; + const TSStateId *primary_state_ids; + }; + + /* + * Lexer Macros + */ + +#define START_LEXER() \ + bool result = false; \ + bool skip = false; \ + bool eof = false; \ + int32_t lookahead; \ + goto start; \ + next_state: \ + lexer->advance (lexer, skip); \ + start: \ + skip = false; \ lookahead = lexer->lookahead; -#define ADVANCE(state_value) \ - { \ - state = state_value; \ - goto next_state; \ +#define ADVANCE(state_value) \ + { \ + state = state_value; \ + goto next_state; \ } -#define SKIP(state_value) \ - { \ - skip = true; \ - state = state_value; \ - goto next_state; \ +#define SKIP(state_value) \ + { \ + skip = true; \ + state = state_value; \ + goto next_state; \ } -#define ACCEPT_TOKEN(symbol_value) \ - result = true; \ - lexer->result_symbol = symbol_value; \ - lexer->mark_end(lexer); +#define ACCEPT_TOKEN(symbol_value) \ + result = true; \ + lexer->result_symbol = symbol_value; \ + lexer->mark_end (lexer); #define END_STATE() return result; -/* - * Parse Table Macros - */ + /* + * Parse Table Macros + */ #define SMALL_STATE(id) id - LARGE_STATE_COUNT @@ -172,53 +186,56 @@ struct TSLanguage { #define ACTIONS(id) id -#define SHIFT(state_value) \ - {{ \ - .shift = { \ - .type = TSParseActionTypeShift, \ - .state = state_value \ - } \ - }} - -#define SHIFT_REPEAT(state_value) \ - {{ \ - .shift = { \ - .type = TSParseActionTypeShift, \ - .state = state_value, \ - .repetition = true \ - } \ - }} - -#define SHIFT_EXTRA() \ - {{ \ - .shift = { \ - .type = TSParseActionTypeShift, \ - .extra = true \ - } \ - }} - -#define REDUCE(symbol_val, child_count_val, ...) \ - {{ \ - .reduce = { \ - .type = TSParseActionTypeReduce, \ - .symbol = symbol_val, \ - .child_count = child_count_val, \ - __VA_ARGS__ \ - }, \ - }} - -#define RECOVER() \ - {{ \ - .type = TSParseActionTypeRecover \ - }} - -#define ACCEPT_INPUT() \ - {{ \ - .type = TSParseActionTypeAccept \ - }} +#define SHIFT(state_value) \ + { \ + { \ + .shift = {.type = TSParseActionTypeShift, .state = state_value } \ + } \ + } + +#define SHIFT_REPEAT(state_value) \ + { \ + { \ + .shift \ + = {.type = TSParseActionTypeShift, \ + .state = state_value, \ + .repetition = true } \ + } \ + } + +#define SHIFT_EXTRA() \ + { \ + { \ + .shift = {.type = TSParseActionTypeShift, .extra = true } \ + } \ + } + +#define REDUCE(symbol_val, child_count_val, ...) \ + { \ + { \ + .reduce = { .type = TSParseActionTypeReduce, \ + .symbol = symbol_val, \ + .child_count = child_count_val, \ + __VA_ARGS__ }, \ + } \ + } + +#define RECOVER() \ + { \ + { \ + .type = TSParseActionTypeRecover \ + } \ + } + +#define ACCEPT_INPUT() \ + { \ + { \ + .type = TSParseActionTypeAccept \ + } \ + } #ifdef __cplusplus } #endif -#endif // TREE_SITTER_PARSER_H_ +#endif // TREE_SITTER_PARSER_H_ diff --git a/sys/nixpkgs/pkgs/tree-sitter-yts/treefmt.toml b/sys/nixpkgs/pkgs/tree-sitter-yts/treefmt.toml index e84ae516..3d604b40 100644 --- a/sys/nixpkgs/pkgs/tree-sitter-yts/treefmt.toml +++ b/sys/nixpkgs/pkgs/tree-sitter-yts/treefmt.toml @@ -7,15 +7,15 @@ excludes = ["test/**.nix"] command = "prettier" options = ["--write"] includes = [ - "*.css", - "*.html", - "*.js", - "*.json", - "*.jsx", - "*.md", - "*.mdx", - "*.scss", - "*.ts", + "*.css", + "*.html", + "*.js", + "*.json", + "*.jsx", + "*.md", + "*.mdx", + "*.scss", + "*.ts", ] excludes = ["src/**.json"] @@ -26,8 +26,8 @@ includes = ["*.rs"] [formatter.c] command = "clang-format" -options = [ "-i" ] -includes = [ "*.c", "*.cpp", "*.cc", "*.h", "*.hpp" ] +options = ["-i"] +includes = ["*.c", "*.cpp", "*.cc", "*.h", "*.hpp"] excludes = [ "bindings/node/binding.cc", "src/parser.c", diff --git a/sys/nixpkgs/pkgs/update_pkgs.sh b/sys/nixpkgs/pkgs/update_pkgs.sh index 8392fb1c..be1573c6 100755 --- a/sys/nixpkgs/pkgs/update_pkgs.sh +++ b/sys/nixpkgs/pkgs/update_pkgs.sh @@ -1,18 +1,17 @@ #!/usr/bin/env sh die() { - printf "\033[31;1mError: \033[0m%s" "$1"; + printf "\033[31;1mError: \033[0m%s" "$1" exit 1 } cd "$(dirname "$0")" || die "Bug: run with false dirname ('$0')!" - fd . --type directory --max-depth 1 | while read -r dir; do cd "$dir" || die "Dir '$dir' does not exist" if [ -f update.sh ]; then - printf "\033[34;1m> \033[0m\033[34;1m%s\033[0m\n" "Running '${dir}update.sh'"; + printf "\033[34;1m> \033[0m\033[34;1m%s\033[0m\n" "Running '${dir}update.sh'" [ -f flake.nix ] && nix flake update @@ -20,8 +19,7 @@ fd . --type directory --max-depth 1 | while read -r dir; do eval "$(direnv export bash 2>/dev/null)" ./update.sh "$@" fi - cd - > /dev/null || die "Bug: Last dir does not exist" + cd - >/dev/null || die "Bug: Last dir does not exist" done - # vim: ft=sh diff --git a/sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh b/sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh index dcf8b46f..781b8aeb 100755 --- a/sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh +++ b/sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh @@ -5,12 +5,10 @@ count=$(echo "$plugins" | uniq -d | wc -l) echo "duplicates count: $count" -if [ "$count" -gt 0 ] -then +if [ "$count" -gt 0 ]; then filtered_plugins=$(echo "$plugins" | uniq -d) - if [ "$1" == "check-only" ] - then + if [ "$1" == "check-only" ]; then echo "$filtered_plugins" exit 1 else @@ -21,22 +19,18 @@ then # iterate over plugins we found missing and # compare them to all open issues. # We no matching issue was found, we create a new one - for f in $filtered_plugins # do not add " " here. It would break the plugin - do + for f in $filtered_plugins; do # do not add " " here. It would break the plugin found=false - for k in $known_issues - do - if [[ "$f" == "$k" ]] - then + for k in $known_issues; do + if [[ $f == "$k" ]]; then found=true break fi done # test if matching issue was found - if ! $found - then + if ! $found; then echo "Did not find an issue for $f. Creating a new one ..." gh issue create --title "Detected broken plugin: $f" --label "bot" --body "$f" else diff --git a/sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml b/sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml index d73a63f8..38caf76d 100644 --- a/sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml +++ b/sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml @@ -3,7 +3,7 @@ name = "update_vim_plugins" version = "0.1.0" description = "" authors = ["Your Name <you@example.com>"] -packages = [{include = "update_vim_plugins"}] +packages = [{ include = "update_vim_plugins" }] [tool.poetry.scripts] update-vim-plugins = "update_vim_plugins.__main__:main" diff --git a/sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py b/sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py index 04f25ccc..edbd876b 100644 --- a/sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py +++ b/sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py @@ -35,7 +35,7 @@ class PluginSpec: branch_regex = r"(:(?P<branch>[^:]+)?)" name_regex = r"(:(?P<name>[^:]+)?)" license_regex = r"(:(?P<license>[^:]+)?)" - marked_duplicate_regex = r'(:(?P<duplicate>duplicate))' + marked_duplicate_regex = r"(:(?P<duplicate>duplicate))" spec_regex = re.compile( f"^{repository_host_regex}?{owner_regex}/{repo_regex}{branch_regex}?{name_regex}?{license_regex}?{marked_duplicate_regex}?$", @@ -60,7 +60,7 @@ class PluginSpec: branch = group_dict.get("branch") name = group_dict.get("name") license = group_dict.get("license") - marked_duplicate = bool(group_dict.get("duplicate")) # True if 'duplicate', False if None + marked_duplicate = bool(group_dict.get("duplicate")) # True if 'duplicate', False if None line = spec diff --git a/sys/nixpkgs/pkgs/yt/update.sh b/sys/nixpkgs/pkgs/yt/update.sh index 2e59aa60..c678b421 100755 --- a/sys/nixpkgs/pkgs/yt/update.sh +++ b/sys/nixpkgs/pkgs/yt/update.sh @@ -3,5 +3,4 @@ cargo update [ "$1" = "upgrade" ] && cargo upgrade - # vim: ft=sh diff --git a/sys/svcs/xdg/scripts/lf_wrapper.sh b/sys/svcs/xdg/scripts/lf_wrapper.sh index 7a508d39..d3aa3e30 100755 --- a/sys/svcs/xdg/scripts/lf_wrapper.sh +++ b/sys/svcs/xdg/scripts/lf_wrapper.sh @@ -37,7 +37,7 @@ termcmd="${TERMINAL:-$(command -v alacritty)}" if [ "$save" = "1" ]; then set -- -selection-path="$out" -command='set promptfmt "Select the file to write to %S \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m"' "$recommended_path" - cat << EOF > "$recommended_path" + cat <<EOF >"$recommended_path" xdg-desktop-portal-termfilechooser saving files tutorial !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/sys/svcs/xdg/scripts/ranger-wrapper.sh b/sys/svcs/xdg/scripts/ranger-wrapper.sh index a98cff32..46d8e045 100755 --- a/sys/svcs/xdg/scripts/ranger-wrapper.sh +++ b/sys/svcs/xdg/scripts/ranger-wrapper.sh @@ -50,7 +50,7 @@ Notes: that, for example. 2) If you quit ranger without opening a file, this file will be removed and the save operation aborted. -' > "$path" +' >"$path" elif [ "$directory" = "1" ]; then set -- --choosedir="$out" --show-only-dirs --cmd="echo Select directory (quit in dir to select it)" elif [ "$multiple" = "1" ]; then @@ -59,7 +59,7 @@ else set -- --choosefile="$out" --cmd="echo Select file (open file to select it)" fi -"$termcmd" -- $cmd "$@" +"$termcmd" -- "$cmd" "$@" if [ "$save" = "1" ] && [ ! -s "$out" ]; then rm "$path" fi |