-
Notifications
You must be signed in to change notification settings - Fork 28
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 a parent directive to @section #97
Changes from all commits
e7af55d
e16b610
c8d779f
0aaa5d0
ec7bffe
a270fbc
23521ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,10 @@ | |
>>> section_args.match('The Beginning, beg').groups() | ||
('The Beginning', 'beg') | ||
|
||
>>> parent_section_args.match('123') | ||
>>> parent_section_args.match('foo').groups() | ||
('foo',) | ||
|
||
>>> backmatter_args.match('123') | ||
>>> backmatter_args.match('foo').groups() | ||
('foo',) | ||
|
@@ -211,7 +215,8 @@ def _DelimitedRegex(pattern): | |
# MATCH GROUP 1: The Name | ||
( | ||
# Non-commas or escaped commas or escaped escapes. | ||
(?:[^\\,]|\\.)+ | ||
# Must not end with a space. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this change leftover from the other approach, or valuable in itself? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. valuable in itself - it prevents problems with trailing spaces being changed to dashes. |
||
(?:[^\\,]|\\.)+\S | ||
) | ||
# Optional identifier | ||
(?: | ||
|
@@ -222,6 +227,7 @@ def _DelimitedRegex(pattern): | |
)? | ||
$ | ||
""", re.VERBOSE) | ||
parent_section_args = re.compile(r'([a-zA-Z_-][a-zA-Z0-9_-]*)') | ||
backmatter_args = re.compile(r'([a-zA-Z_-][a-zA-Z0-9_-]*)') | ||
dict_args = re.compile(r""" | ||
^([a-zA-Z_][a-zA-Z0-9]*)(?:\.([a-zA-Z_][a-zA-Z0-9_]*))?$ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to use
+= 1
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they're two different objects :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, so they are…