Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9c8d62a17 | |||
| 6fc6f63980 | |||
| 2bff817f5a |
+3
-4
@@ -652,11 +652,10 @@ class ATLTransformBase(renpy.object.Object):
|
||||
# if name in (args_param_name, kwargs_param_name):
|
||||
# pass
|
||||
|
||||
## when positional-only parameters are enabled
|
||||
# elif passed and (pkind == param.POSITIONAL_ONLY):
|
||||
# continue
|
||||
if passed and (pkind == param.POSITIONAL_ONLY): # turn into elif when possible
|
||||
continue
|
||||
|
||||
if passed: # turn into elif when possible
|
||||
elif passed:
|
||||
param = ValuedParameter(name, param.KEYWORD_ONLY, scope[name])
|
||||
|
||||
elif param.has_default:
|
||||
|
||||
@@ -298,7 +298,6 @@ init -1100 python:
|
||||
if _compat_versions(version, (7, 6, 99), (8, 1, 99)):
|
||||
config.simple_box_reverse = True
|
||||
build.itch_channels = list(build.itch_channels.items())
|
||||
config.atl_pos_only = True
|
||||
config.atl_pos_only_as_pos_or_kw = True
|
||||
style.default.shaper = "freetype"
|
||||
config.mixed_position = False
|
||||
|
||||
+1
-1
@@ -1415,7 +1415,7 @@ simple_box_reverse = False
|
||||
box_reverse_align = False
|
||||
|
||||
# If True, positional-only parameters are allowed in ATL transform signatures.
|
||||
atl_pos_only = False
|
||||
atl_pos_only = True
|
||||
|
||||
# If True, positional-only parameters in ATL transform signatures are treated as pos-or-keyword.
|
||||
atl_pos_only_as_pos_or_kw = False
|
||||
|
||||
+2
-9
@@ -1036,12 +1036,8 @@ def transform_statement(l, loc):
|
||||
parameters = parse_parameters(l)
|
||||
|
||||
if parameters:
|
||||
found_pos_only = False
|
||||
for p in parameters.parameters.values():
|
||||
if p.kind == p.POSITIONAL_ONLY and not found_pos_only:
|
||||
found_pos_only = True
|
||||
l.deferred_error("atl_pos_only", "the transform statement does not take positional-only parameters ({} is not allowed)".format(p))
|
||||
elif p.kind == p.VAR_POSITIONAL:
|
||||
if p.kind == p.VAR_POSITIONAL:
|
||||
l.error("the transform statement does not take *args ({} is not allowed)".format(p))
|
||||
elif p.kind == p.VAR_KEYWORD:
|
||||
l.error("the transform statement does not take **kwargs ({} is not allowed)".format(p))
|
||||
@@ -1728,10 +1724,7 @@ def release_deferred_errors():
|
||||
else:
|
||||
pop("duplicate_id")
|
||||
|
||||
if renpy.config.atl_pos_only:
|
||||
pop("atl_pos_only")
|
||||
else:
|
||||
release("atl_pos_only")
|
||||
pop("atl_pos_only")
|
||||
|
||||
if deferred_parse_errors:
|
||||
raise Exception("Unknown deferred error label(s) : {}".format(tuple(deferred_parse_errors)))
|
||||
|
||||
Reference in New Issue
Block a user