Skip to content

Commit

Permalink
Remove the now unnecessary functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Mar 19, 2024
1 parent 2490617 commit 0b4e1de
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
1 change: 0 additions & 1 deletion bikeshed/shorthands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

def run(doc: t.SpecT) -> None:
oldShorthands.transformShorthandElements(doc)
oldShorthands.transformProductionPlaceholders(doc)
oldShorthands.transformMaybePlaceholders(doc)
oldShorthands.transformAutolinkShortcuts(doc)
oldShorthands.transformProductionGrammars(doc)
31 changes: 0 additions & 31 deletions bikeshed/shorthands/oldShorthands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,6 @@
from .. import messages as m


def transformProductionPlaceholders(doc: t.SpecT) -> None:
return


def parseRangeComponent(val: str) -> tuple[str | None, float | int]:
sign = ""
signVal = 1
num: float | int
val = val.strip()
if val[0] in ["-", "−"]:
sign = "-"
signVal = -1
val = val[1:]

if val.lower() == "infinity":
val = "∞"
if val.lower() == "∞":
val = "∞"
if val == "∞":
return sign + val, signVal * float("inf")

match = re.match(r"(\d+)([\w-]*)", val)
if match is None:
return None, 0
(digits, unit) = match.groups()
num = int(digits) * signVal
val = str(num)

return val + unit, num


def transformMaybePlaceholders(doc: t.SpecT) -> None:
propRe = re.compile(r"^([\w-]+): .+")
valRe = re.compile(r"^(?:(\S*)/)?(\S[^!]*)(?:!!([\w-]+))?$")
Expand Down

0 comments on commit 0b4e1de

Please sign in to comment.