Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ref to regex pattern that matches proc signature for formatting #68

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sphinxcontrib/chapeldomain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
chpl_sig_pattern = re.compile(
r"""^ ((?:\w+\s+)* # opt: prefixes
(?:proc|iter|class|record|operator)\s+ # must end with keyword
(?:type\s+|param\s+)? # opt: type or param method
(?:type\s+|param\s+|ref\s+)? # opt: 'this' intent
# (type, param, ref)
)?
([\w$.]*\.)? # class name(s)
([\w\+\-/\*$\<\=\>\!]+) \s* # function or method name
Expand Down
4 changes: 4 additions & 0 deletions test/test_chapeldomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ def test_get_proc_like_prefix__proc(self):
('proc foo', 'proc '),
('inline proc foo', 'inline proc '),
('proc foo() ref', 'proc '),
('proc ref foo() ref', 'proc ref '),
('proc ref foo()', 'proc ref '),
('iter foo() ref', 'iter '),
('inline iter foo(x, y): int(32)', 'inline iter '),
('proc proc proc proc proc proc', 'proc proc proc proc proc '),
Expand All @@ -479,6 +481,8 @@ def test_get_proc_like_prefix__iter(self):
('proc foo', 'proc '),
('inline proc foo', 'inline proc '),
('proc foo() ref', 'proc '),
('proc ref foo() ref', 'proc ref '),
('proc ref foo()', 'proc ref '),
('iter foo() ref', 'iter '),
('inline iter foo(x, y): int(32)', 'inline iter '),
('iter iter iter iter iter iter', 'iter iter iter iter iter '),
Expand Down