diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-29 08:51:35 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-29 15:11:01 +0100 |
commit | 912f45e2b28b1904b3187d7bca39dcecbfd3e601 (patch) | |
tree | 382c408c0b3b5180a89249cf4cee15773ca28028 /tests/html5lib-tests/encoding/scripted | |
parent | a0c75cde8a0680047bc4e9bc0a2bb24099e271fe (diff) |
refactor: move return out of go! to clarify flow
#!/usr/bin/env python3
import re
text = ''
for line in open('src/tokenizer/mod.rs'):
if '$me.emit_current' in line:
text += re.sub('return (\$me.emit_current_tag\(\));', lambda x: x.group(1), line)
elif '$me:ident' in line:
text += re.sub('return (ProcessResult::Continue);', lambda x: x.group(1), line)
else:
text += re.sub('go!\(self: (to|consume_char_ref|emit_tag)', lambda x: 'return ' + x.group(), line)
with open('src/tokenizer/mod.rs', 'w') as f:
f.write(text)
Diffstat (limited to 'tests/html5lib-tests/encoding/scripted')
0 files changed, 0 insertions, 0 deletions