Skip to content

Commit

Permalink
Update python syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
remisalmon committed Aug 31, 2023
1 parent 9a12bb2 commit 2939163
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python.nanorc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ color red "^ *#.*"
color red "#[^"']*$"
# Multiline strings.
icolor green start="[bfr]?"""([^"]?|$)" end="(^|[^\]?)""""
icolor green start="[bfr]?'''([^']?|$)" end="(^|[^\]?)'''"
icolor green start="[bfr]?"""" end="""""
icolor green start="[bfr]?'''" end="'''"
# Trailing whitespaces.
color ,green " +$"
14 changes: 12 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class Test(Test):

test 'string' test

test "" test

test "\\" test

test """multiline string""" test

test """
Expand All @@ -34,6 +38,12 @@ class Test(Test):
multiline string
''' test

test """""" test

test """""""" test

test """\\""" test

# comment

test # comment
Expand All @@ -45,6 +55,6 @@ class Test(Test):
# not a comment
""" test

bug # comment "string"
bug # comment "not a string"

bug "'''" test
bug "'''" not a string

0 comments on commit 2939163

Please sign in to comment.