Skip to content

Commit

Permalink
Merge branch 'py-functions' of https://github.com/erinwild/prism into…
Browse files Browse the repository at this point in the history
… erinwild-py-functions

# Conflicts:
#	components/prism-python.js
#	components/prism-python.min.js
  • Loading branch information
Golmote committed Oct 21, 2017
2 parents 2169c99 + 317f690 commit 3badd8a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/prism-python.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Prism.languages.python = {
greedy: true
},
'function': {
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\s*\()/g,
lookbehind: true
},
'class-name': {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-python.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tests/languages/python/function_feature.test
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
def Foo(
def foo_bar_42(
def _(
def foo_ ()

----------------------------------------------------

[
["keyword", "def"], ["function", "Foo"], ["punctuation", "("],
["keyword", "def"], ["function", "foo_bar_42"], ["punctuation", "("],
["keyword", "def"], ["function", "_"], ["punctuation", "("]
["keyword", "def"], ["function", "_"], ["punctuation", "("],
["keyword", "def"], ["function", "foo_"], ["punctuation", "("], ["punctuation", ")"]
]

----------------------------------------------------
Expand Down

0 comments on commit 3badd8a

Please sign in to comment.