added exit code of 1 when parsing failed and support for more characters in company names
This commit is contained in:
parent
61c608b44d
commit
8ba46ca3cf
@ -1,6 +1,7 @@
|
||||
from dataclasses import dataclass
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from typing import Dict, Tuple
|
||||
from math import ceil, log10
|
||||
import datetime
|
||||
@ -205,7 +206,7 @@ class MarkdownBlogParser:
|
||||
|
||||
def parse(self):
|
||||
line, span = self.read_until('\n', inclusive=True)
|
||||
result = re.fullmatch(r'### ([\w\s]+)\s+("[^"]+")[ \t]*(\([^)]+\))?\n', line)
|
||||
result = re.fullmatch(r'### ([\w\s&-/]+)\s+("[^"]+")[ \t]*(\([^)]+\))?\n', line)
|
||||
if not result:
|
||||
raise ParseError("Expected review heading of form '### Company \"pesto name\" (variant)\n'", span.transform(end=-1))
|
||||
# now we get the first bit of info!
|
||||
@ -329,5 +330,6 @@ if __name__ == '__main__':
|
||||
}, f, indent=2)
|
||||
except ParseError as err:
|
||||
err.print_context_message()
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user