fix!(parser): handling of line breaks in enclosures

This commit is contained in:
Shunsuke Shibayama 2023-09-23 23:50:28 +09:00
parent a33f9ab928
commit 25d143b04a
10 changed files with 155 additions and 94 deletions

View file

@ -4,12 +4,12 @@
.is_dataclass: (obj: Obj) -> Bool
_MISSING_TYPE: ClassType
.MISSING: _MISSING_TYPE
._MISSING_TYPE: ClassType
.MISSING: ._MISSING_TYPE
_KW_ONLY_TYPE: ClassType
._KW_ONLY_TYPE: ClassType
.KW_ONLY: _KW_ONLY_TYPE
.field: (default := _MISSING_TYPE, default_factory := _MISSING_TYPE, init := Bool, repr := Bool, hash := Bool, compare := Bool, metadata := GenericDict, kw_only := _MISSING_TYPE) -> (Obj -> Obj)
.field: (default := ._MISSING_TYPE, default_factory := ._MISSING_TYPE, init := Bool, repr := Bool, hash := Bool, compare := Bool, metadata := GenericDict, kw_only := ._MISSING_TYPE) -> (Obj -> Obj)
.Field: ClassType

View file

@ -60,11 +60,11 @@ The name of the operating system dependent module imported. The following names
# posix = pyimport "posix"
# .uname!: () => posix.UnameResult
.uname!: () => {
sysname = Str
nodename = Str
release = Str
version = Str
machine = Str
sysname = Str;
nodename = Str;
release = Str;
version = Str;
machine = Str;
}
.getrandom!: (size: Nat) => Bytes

View file

@ -7,9 +7,9 @@ logging = pyimport "logging"
.copy2!: (src: PathLike, dst: PathLike,) => NoneType
.copytree!: (src: PathLike, dst: PathLike,) => NoneType
.disk_usage!: (path: PathLike,) => NamedTuple {
.total = Nat
.used = Nat
.free = Nat
.total = Nat;
.used = Nat;
.free = Nat;
}
.get_archive_formats!: () => [(Str, Str); _]
.get_unpack_formats!: () => [(Str, [Str; _], Str); _]

View file

@ -12,49 +12,49 @@ io = pyimport "io"
.exec_prefix: Str
.executable: Str
.flags: NamedTuple {
.debug = Nat
.inspect = Nat
.interactive = Nat
.optimize = Nat
.dont_write_bytecode = Nat
.no_user_site = Nat
.no_site = Nat
.ignore_environment = Nat
.verbose = Nat
.bytes_warning = Nat
.quiet = Nat
.hash_randomization = Nat
.isolated = Nat
.dev_mode = Nat
.utf8_mode = Nat
.warn_default_encoding = Nat
.safe_path = Bool
.int_max_str_digits = Int
.debug = Nat;
.inspect = Nat;
.interactive = Nat;
.optimize = Nat;
.dont_write_bytecode = Nat;
.no_user_site = Nat;
.no_site = Nat;
.ignore_environment = Nat;
.verbose = Nat;
.bytes_warning = Nat;
.quiet = Nat;
.hash_randomization = Nat;
.isolated = Nat;
.dev_mode = Nat;
.utf8_mode = Nat;
.warn_default_encoding = Nat;
.safe_path = Bool;
.int_max_str_digits = Int;
}
.float_indo: NamedTuple {
.max = Float
.max_exp = Nat
.max_10_exp = Nat
.min = Float
.min_exp = Int
.min_10_exp = Int
.dig = Nat
.mant_dig = Nat
.epsilon = Float
.radix = Nat
.rounds = Nat
.max = Float;
.max_exp = Nat;
.max_10_exp = Nat;
.min = Float;
.min_exp = Int;
.min_10_exp = Int;
.dig = Nat;
.mant_dig = Nat;
.epsilon = Float;
.radix = Nat;
.rounds = Nat;
}
.float_repr_style: Str
.hash_info: NamedTuple {
.width = Nat
.modulus = Int
.inf = Int
.nan = Int
.imag = Int
.algorithm = Str
.hash_bits = Nat
.seed_bits = Nat
.cutoff = Int
.width = Nat;
.modulus = Int;
.inf = Int;
.nan = Int;
.imag = Int;
.algorithm = Str;
.hash_bits = Nat;
.seed_bits = Nat;
.cutoff = Int;
}
.path: Array!(Str, _)
'''
@ -79,11 +79,11 @@ io = pyimport "io"
.stdlib_module_names: [Str; _]
.version: Str
.version_info: NamedTuple {
.major = Nat
.minor = Nat
.micro = Nat
.releaselevel = Str
.serial = Nat
.major = Nat;
.minor = Nat;
.micro = Nat;
.releaselevel = Str;
.serial = Nat;
}
.addaudithook!: (hook: (Str, *Obj) => NoneType) => NoneType

View file

@ -31,25 +31,25 @@ GtForOrd.
`>`(self, other: Self): Bool = self.cmp(other) == Ordering.Greater
Add(R := Self) = Trait {
.Output = Type
.`_+_` = (self: Self, R) -> Self.Output
.Output = Type;
.`_+_` = (self: Self, R) -> Self.Output;
}
Sub(R := Self) = Trait {
.Output = Type
.`-` = (self: Self, R) -> Self.Output
.Output = Type;
.`_-_` = (self: Self, R) -> Self.Output;
}
Mul(R := Self) = Trait {
.Output = Type
.Output = Type;
.`*` = (self: Self, R) -> Self.Output
}
Div(R := Self) = Trait {
.Output = Type
.Output = Type;
.`/` = (self: Self, R) -> Self.Output or Panic
}
Num = Add and Sub and Mul
Seq T = Trait {
.__len__ = (self: Ref(Self)) -> Nat
.__len__ = (self: Ref(Self)) -> Nat;
.get = (self: Ref(Self), Nat) -> T
}