Skip to content

Commit 6a117bd

Browse files
committed
feat(LEXER): support function names containing the at sign
1 parent 8962653 commit 6a117bd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.2.2

lib/bashcov/lexer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def relevant?(line)
104104
line.start_with?(*IGNORE_START_WITH) ||
105105
line.end_with?(*IGNORE_END_WITH)
106106

107-
return false if line =~ /\A[a-zA-Z_][a-zA-Z0-9_\-:\.]*\(\)/ # function declared without the `function` keyword
107+
return false if line =~ /\A[a-zA-Z_@][a-zA-Z0-9_@\-:\.]*\(\)/ # function declared without the `function` keyword
108108
return false if line =~ /\A[^)]+\)\Z/ # case statement selector, e.g. `--help)`
109109

110110
true

spec/test_app/scripts/function.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ put-team-key() {
1818
echo put-team-key # 0
1919
}
2020

21-
abc::def.fn() {
21+
abc::def.@fn() {
2222
echo "${FUNCNAME[0]}" # 1
2323
}
2424

0 commit comments

Comments
 (0)