Escape backslashes in Python comments.

The latest version of flake8 diagnoses these as invalid escape
sequences, so properly escape them.
This commit is contained in:
Dan Gohman
2018-10-24 10:00:42 -07:00
parent 6a234893eb
commit a2fcb32245
7 changed files with 10 additions and 10 deletions

View File

@@ -1134,7 +1134,7 @@ srem_imm = Instruction(
irsub_imm = Instruction( irsub_imm = Instruction(
'irsub_imm', """ 'irsub_imm', """
Immediate reverse wrapping subtraction: :math:`a := Y - x \pmod{2^B}`. Immediate reverse wrapping subtraction: :math:`a := Y - x \\pmod{2^B}`.
Also works as integer negation when :math:`Y = 0`. Use :inst:`iadd_imm` Also works as integer negation when :math:`Y = 0`. Use :inst:`iadd_imm`
with a negative immediate operand for the reverse immediate with a negative immediate operand for the reverse immediate

View File

@@ -345,7 +345,7 @@ class Instruction(object):
`(inst, typevars)` pair. `(inst, typevars)` pair.
This version in `Instruction` itself allows non-polymorphic This version in `Instruction` itself allows non-polymorphic
instructions to duck-type as `BoundInstruction`\s. instructions to duck-type as `BoundInstruction`\\s.
""" """
assert not self.is_polymorphic, self assert not self.is_polymorphic, self
return (self, ()) return (self, ())

View File

@@ -98,7 +98,7 @@ def check_concrete_typing_rtl(var_types, rtl):
Check that a concrete type assignment var_types (Dict[Var, TypeVar]) is Check that a concrete type assignment var_types (Dict[Var, TypeVar]) is
valid for an Rtl rtl. Specifically check that: valid for an Rtl rtl. Specifically check that:
1) For each Var v \in rtl, v is defined in var_types 1) For each Var v \\in rtl, v is defined in var_types
2) For all v, var_types[v] is a singleton type 2) For all v, var_types[v] is a singleton type

View File

@@ -419,7 +419,7 @@ class TypeEnv(object):
E.g. if we have a root of the tree that looks like: E.g. if we have a root of the tree that looks like:
typeof_a typeof_b typeof_a typeof_b
\ / \\ /
typeof_x typeof_x
| |
half_width(1) half_width(1)
@@ -430,7 +430,7 @@ class TypeEnv(object):
resulting graph is: resulting graph is:
typeof_a typeof_b typeof_a typeof_b
\ / \\ /
typeof_x typeof_x
""" """
source_tvs = set([v.get_typevar() for v in self.vars]) source_tvs = set([v.get_typevar() for v in self.vars])

View File

@@ -120,7 +120,7 @@ def legal_bool(bits):
# type: (int) -> bool # type: (int) -> bool
""" """
True iff bits is a legal bit width for a bool type. True iff bits is a legal bit width for a bool type.
bits == 1 || bits \in { 8, 16, .. MAX_BITS } bits == 1 || bits \\in { 8, 16, .. MAX_BITS }
""" """
return bits == 1 or \ return bits == 1 or \
(bits >= 8 and bits <= MAX_BITS and is_power_of_two(bits)) (bits >= 8 and bits <= MAX_BITS and is_power_of_two(bits))

View File

@@ -113,7 +113,7 @@ class Rtl(object):
# type: (Rtl) -> None # type: (Rtl) -> None
""" """
Given that there is only 1 possible concrete typing T for self, assign Given that there is only 1 possible concrete typing T for self, assign
a singleton TV with type t=T[v] for each Var v \in self. Its an error a singleton TV with type t=T[v] for each Var v \\in self. Its an error
to call this on an Rtl with more than 1 possible typing. This modifies to call this on an Rtl with more than 1 possible typing. This modifies
the Rtl in-place. the Rtl in-place.
""" """

View File

@@ -19,11 +19,11 @@ def verify_semantics(inst, src, xforms):
Verify that the semantics transforms in xforms correctly describe the Verify that the semantics transforms in xforms correctly describe the
instruction described by the src Rtl. This involves checking that: instruction described by the src Rtl. This involves checking that:
0) src is a single instance of inst 0) src is a single instance of inst
1) For all x\in xforms x.src is a single instance of inst 1) For all x \\in xforms x.src is a single instance of inst
2) For any concrete values V of Literals in inst: 2) For any concrete values V of Literals in inst:
For all concrete typing T of inst: For all concrete typing T of inst:
Exists single x \in xforms that applies to src conretazied to V Exists single x \\in xforms that applies to src conretazied to
and T V and T
""" """
# 0) The source rtl is always a single instance of inst # 0) The source rtl is always a single instance of inst
assert len(src.rtl) == 1 and src.rtl[0].expr.inst == inst assert len(src.rtl) == 1 and src.rtl[0].expr.inst == inst