Skip to content

Commit

Permalink
Regexp tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnNilsson committed Nov 29, 2020
1 parent e593eb6 commit e23926e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AWK.sublime-syntax
Expand Up @@ -123,7 +123,7 @@ contexts:
- match: /
scope: punctuation.definition.regex.begin.awk
push:
- meta_content_scope: string.regexp
- meta_scope: string.regexp
- match: "(/)([gimy]*)"
captures:
1: punctuation.definition.regex.end.awk
Expand Down
9 changes: 5 additions & 4 deletions syntax_test.awk
Expand Up @@ -11,10 +11,11 @@ function f(x,y){
# ^ punctuation.definition.parameters.end.awk
}

/^ab$/ {
# <- punctuation.definition.regex.begin.awk
#^^^^ string.regexp
# ^ punctuation.definition.regex.end.awk
/^ab#$#/gimy {
# <- punctuation.definition.regex.begin.awk
# ^ punctuation.definition.regex.end.awk
# ^^^^ keyword.other.awk
#^^^^^^^^^^^ string.regexp
}

BEGIN {
Expand Down
4 changes: 4 additions & 0 deletions test.awk
Expand Up @@ -39,6 +39,10 @@ $0 ~ /abc[123]/ {
print "This line shouldn't be white"
}

/^#/ { print (n ? "\n" : "")$0 }
MyVar = "The \"quick brown fox\" jumped over the lazy dogs."
gsub(/"/, "", MyVar)

/[-.]/ {

}
Expand Down

0 comments on commit e23926e

Please sign in to comment.