@@ 38,12 38,13 @@ the following code:
```perl
my $r = join '-', @arr + 2 - 1;
```
-The sexps would be:
+The sexps (circle bracket), and sentence[square bracker] would be:
```
-((my) ($r) = ((join) '-', (((@arr) + (2)) - (1))));
+[((my) ($r)) = ((join) '-', (((@arr) + (2)) - (1)));]
```
-Commands like `C-M-b` and `C-M-f` will reflect on this.
+Commands like `C-M-b`, `C-M-f`, `M-e`, `M-a` will reflect on this. It
+makes moving around seem more fun and cool.
## Imenu
@@ 75,3 76,7 @@ issues](https://github.com/tree-sitter-p
with the grammer, it is not advisable to use this if you will be
working on large files. As of 2025-01-21, these are being worked on
rapidly.
+
+# TODO
+
+- Set `list` in `perl-ts-thing-settings`.
@@ 384,11 384,21 @@ Argument STR is either a string, or a li
(defun perl-ts-sexp (node)
"Returns non-nil when NODE is a sexp."
- (let ((nt (treesit-node-text node 1)))
- (and
- (not (member nt '( "{" "}" "[" "]" "(" ")" ";")))
- (not (and (string= "operator" (treesit-node-field-name node))
- (= 1 (length nt)))))))
+ (let ((type (treesit-node-type node)))
+ (not
+ (or
+ ;; Expression statements are technically sexps, but this really
+ ;; makes navigation annoying. Plus sentence commands already
+ ;; exist to work on these statements.
+ (string-match (regexp-opt
+ (cons "expression_statement"
+ (split-string "[{(;)}]" "" t)))
+ type
+ 0 t)
+ (string= "expression_statement"
+ (treesit-node-type (treesit-node-parent node)))
+ (and (string= "operator" (treesit-node-field-name node))
+ (= 1 (length (treesit-node-text node t))))))))
(defvar perl-ts-thing-settings
`((perl