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

rustdoc: Rename @has FILE PATTERN to @hasraw FILE PATTERN #100355

Merged
merged 7 commits into from
Aug 14, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix line lengths
camelid committed Aug 13, 2022
commit 9db6061d64fbec7470f4e4419d16c47fe9aeb322
10 changes: 7 additions & 3 deletions src/etc/htmldocck.py
Original file line number Diff line number Diff line change
@@ -544,17 +544,21 @@ def check_command(c, cache):
cerr = ""
if c.cmd in ['has', 'hasraw', 'matches', 'matchesraw']: # string test
regexp = c.cmd.startswith('matches')
if len(c.args) == 1 and not regexp and 'raw' not in c.cmd: # @has <path> = file existence

# @has <path> = file existence
if len(c.args) == 1 and not regexp and 'raw' not in c.cmd:
try:
cache.get_file(c.args[0])
ret = True
except FailedCheck as err:
cerr = str(err)
ret = False
elif len(c.args) == 2 and 'raw' in c.cmd: # @hasraw/matchesraw <path> <pat> = string test
# @hasraw/matchesraw <path> <pat> = string test
elif len(c.args) == 2 and 'raw' in c.cmd:
cerr = "`PATTERN` did not match"
ret = check_string(cache.get_file(c.args[0]), c.args[1], regexp)
elif len(c.args) == 3 and 'raw' not in c.cmd: # @has/matches <path> <pat> <match> = XML tree test
# @has/matches <path> <pat> <match> = XML tree test
elif len(c.args) == 3 and 'raw' not in c.cmd:
cerr = "`XPATH PATTERN` did not match"
ret = get_nb_matching_elements(cache, c, regexp, True) != 0
else: