Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pokey committed Jan 19, 2024
1 parent 215e1ab commit b90eb03
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 85 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
local local_var="hello"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare local_var="hello"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
local local_var
---
79 changes: 21 additions & 58 deletions queries/shellscript.scm
Original file line number Diff line number Diff line change
Expand Up @@ -267,82 +267,45 @@
;; Names, values, and types
;;

;;!! foo="bar"
;;! ^^^
;;! xxxx
;;! ---------
;;!! for ((i = 1; i <= 5; i++)); do
;;! ^
;;! xxxx
;;! -----
(
(variable_assignment
name: (_) @name @_.trailing.start.startOf
.
"=" @_.trailing.end.endOf
name: (_) @name @value.leading.endOf
value: (_) @value @name.trailing.startOf
) @dummy @_.domain
(#not-parent-type? @dummy declaration_command)
)

;;!! for ((i = 1; i <= 5; i++)); do
;;! ^
;;! xxxx
;;! -----
(variable_assignment
!name
(variable_name) @name @_.trailing.start.startOf
"="
(_) @_.trailing.end.startOf
) @_.domain

;;!! local foo="bar"
;;! ^^^
;;! xxxxxxxxxx
;;! ---------------
(declaration_command
"local" @_.domain.start.startOf @_.trailing.start.startOf
(variable_assignment
name: (_) @name
.
"=" @_.trailing.end.endOf
) @_.domain.end.endOf
)

;;!! foo="bar"
;;! ^^^^^
;;! xxxxxx
;;! ---------
(
(variable_assignment
"=" @value.leading.start.startOf
.
value: (_) @value @value.leading.end.endOf
) @dummy @_.domain
(#not-parent-type? @dummy declaration_command)
)
value: (_) @_.removal.end.startOf
)
) @_.domain @_.removal.start.startOf

;;!! local foo="bar"
;;! ^^^^^
;;! xxxxxx
;;! ^^^
;;! xxxxxxxxxx
;;! ---------------
(declaration_command
"local" @_.domain.start.startOf
(variable_assignment
"=" @value.leading.start.startOf
.
value: (_) @value @value.leading.end.endOf
) @_.domain.end.endOf
)
name: (_) @_.leading.endOf
value: (_) @value
)
) @_.domain

;;!! for ((i = 1; i <= 5; i++)); do
;;! ^
;;! xxxx
;;! -----
(
(variable_assignment
!name
!value
(_) @_.leading.start.endOf
"="
.
(_) @value @_.leading.end.endOf
) @_.domain
)
;;!! local foo
;;! ^^^
;;! ---------
(declaration_command
(variable_name) @name
) @_.domain

(regex) @regularExpression @textFragment

0 comments on commit b90eb03

Please sign in to comment.