1.1 --- a/docs/tools/sign_releases.sh Tue Aug 29 19:29:31 2023 +0200
1.2 +++ b/docs/tools/sign_releases.sh Fri Sep 01 22:22:37 2023 +0200
1.3 @@ -31,9 +31,18 @@
1.4 fi
1.5
1.6 for FILENAME in "$OUTDIR/"*".tar.bz2" ; do
1.7 +
1.8 + # Handle an absence of archives.
1.9 +
1.10 + if [ ! -e "$FILENAME" ] ; then
1.11 + break
1.12 + fi
1.13 +
1.14 OUTFILE="$FILENAME.asc"
1.15 if [ ! -e "$OUTFILE" ] || [ "$FORCE" ]; then
1.16 gpg --sign -a -b "$FILENAME"
1.17 echo "$OUTFILE"
1.18 fi
1.19 done
1.20 +
1.21 +# vim: tabstop=4 expandtab shiftwidth=4
3.1 --- a/templates/native/limits.c Tue Aug 29 19:29:31 2023 +0200
3.2 +++ b/templates/native/limits.c Fri Sep 01 22:22:37 2023 +0200
3.3 @@ -1,6 +1,6 @@
3.4 /* Native functions for limit definition.
3.5
3.6 -Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
3.7 +Copyright (C) 2016, 2017, 2021 Paul Boddie <paul@boddie.org.uk>
3.8
3.9 This program is free software; you can redistribute it and/or modify it under
3.10 the terms of the GNU General Public License as published by the Free Software
3.11 @@ -27,6 +27,8 @@
3.12
3.13 /* Limit definition. */
3.14
3.15 +/* NOTE: Could have statically allocated limits. */
3.16 +
3.17 __attr __fn_native_limits_get_maxint(__attr __self)
3.18 {
3.19 return __new_int(__MAXINT);
4.1 --- a/templates/native/list.c Tue Aug 29 19:29:31 2023 +0200
4.2 +++ b/templates/native/list.c Fri Sep 01 22:22:37 2023 +0200
4.3 @@ -88,7 +88,7 @@
4.4 return __builtins___none_None;
4.5 }
4.6
4.7 -__attr __fn_native_list_list_len(__attr self, __attr _data)
4.8 +__attr __fn_native_list_list_len(__attr __self, __attr _data)
4.9 {
4.10 /* _data interpreted as list.__data__ */
4.11 __int size = _data.seqvalue->size;
5.1 --- a/templates/native/list.h Tue Aug 29 19:29:31 2023 +0200
5.2 +++ b/templates/native/list.h Fri Sep 01 22:22:37 2023 +0200
5.3 @@ -1,6 +1,6 @@
5.4 /* Native functions for list operations.
5.5
5.6 -Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
5.7 +Copyright (C) 2016, 2017, 2021 Paul Boddie <paul@boddie.org.uk>
5.8
5.9 This program is free software; you can redistribute it and/or modify it under
5.10 the terms of the GNU General Public License as published by the Free Software
5.11 @@ -27,7 +27,7 @@
5.12 __attr __fn_native_list_list_setsize(__attr __self, __attr _data, __attr size);
5.13 __attr __fn_native_list_list_append(__attr __self, __attr self, __attr value);
5.14 __attr __fn_native_list_list_concat(__attr __self, __attr self, __attr other);
5.15 -__attr __fn_native_list_list_len(__attr self, __attr _data);
5.16 +__attr __fn_native_list_list_len(__attr __self, __attr _data);
5.17 __attr __fn_native_list_list_nonempty(__attr __self, __attr _data);
5.18 __attr __fn_native_list_list_element(__attr __self, __attr _data, __attr index);
5.19 __attr __fn_native_list_list_setelement(__attr __self, __attr _data, __attr index, __attr value);
6.1 --- a/translator.py Tue Aug 29 19:29:31 2023 +0200
6.2 +++ b/translator.py Fri Sep 01 22:22:37 2023 +0200
6.3 @@ -1293,6 +1293,7 @@
6.4 context_arg = "__NULL"
6.5
6.6 args = [context_arg]
6.7 + reserved_args = 1
6.8
6.9 # Complete the array with null values, permitting tests for a complete
6.10 # set of arguments.
6.11 @@ -1337,7 +1338,7 @@
6.12 except ValueError:
6.13 raise TranslateError("Argument %s is not recognised." % arg.name,
6.14 self.get_namespace_path(), n)
6.15 - args[argnum+1] = str(argexpr)
6.16 + args[argnum + reserved_args] = str(argexpr)
6.17
6.18 # Otherwise, store the details in a separate collection.
6.19
6.20 @@ -1351,7 +1352,7 @@
6.21
6.22 else:
6.23 try:
6.24 - args[i+1] = str(argexpr)
6.25 + args[i + reserved_args] = str(argexpr)
6.26 except IndexError:
6.27 raise TranslateError("Too many arguments specified.",
6.28 self.get_namespace_path(), n)
6.29 @@ -1375,8 +1376,8 @@
6.30
6.31 for i, (argname, default) in enumerate(function_defaults):
6.32 argnum = parameters.index(argname)
6.33 - if not args[argnum+1]:
6.34 - args[argnum+1] = "__GETDEFAULT(%s, %d)" % (target_structure, i)
6.35 + if not args[argnum + reserved_args]:
6.36 + args[argnum + reserved_args] = "__GETDEFAULT(%s, %d)" % (target_structure, i)
6.37
6.38 elif known_parameters:
6.39
6.40 @@ -1387,7 +1388,7 @@
6.41 i = len(n.args)
6.42 pos = i - (num_parameters - num_defaults)
6.43 while i < num_parameters:
6.44 - args[i+1] = "__GETDEFAULT(%s.value, %d)" % (target_var, pos)
6.45 + args[i + reserved_args] = "__GETDEFAULT(%s.value, %d)" % (target_var, pos)
6.46 i += 1
6.47 pos += 1
6.48
6.49 @@ -1403,7 +1404,7 @@
6.50 # the number of values. The context is excluded.
6.51
6.52 if literal_instantiation:
6.53 - argstr = "%d, %s" % (len(args) - 1, ", ".join(args[1:]))
6.54 + argstr = "%d, %s" % (len(args) - reserved_args, ", ".join(args[reserved_args:]))
6.55 else:
6.56 argstr = ", ".join(args)
6.57
7.1 --- a/transresults.py Tue Aug 29 19:29:31 2023 +0200
7.2 +++ b/transresults.py Fri Sep 01 22:22:37 2023 +0200
7.3 @@ -3,7 +3,7 @@
7.4 """
7.5 Translation result abstractions.
7.6
7.7 -Copyright (C) 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk>
7.8 +Copyright (C) 2016, 2017, 2018, 2021 Paul Boddie <paul@boddie.org.uk>
7.9
7.10 This program is free software; you can redistribute it and/or modify it under
7.11 the terms of the GNU General Public License as published by the Free Software
7.12 @@ -67,6 +67,20 @@
7.13 ResolvedNameRef.__init__(self, name, ref, expr, is_global)
7.14 self.location = location
7.15
7.16 + # For sources, any identified static origin will be constant and thus
7.17 + # usable directly. For targets, no constant should be assigned and thus
7.18 + # the alias (or any plain name) will be used.
7.19 +
7.20 + self.static_ref = self.static()
7.21 + origin = self.static_ref and self.get_origin()
7.22 + self.static_name = origin and encode_path(origin)
7.23 +
7.24 + # Determine whether a qualified name is involved.
7.25 +
7.26 + t = (not self.is_constant_alias() and self.get_name() or self.name).rsplit(".", 1)
7.27 + self.parent = len(t) > 1 and t[0] or None
7.28 + self.attrname = t[-1] and encode_path(t[-1])
7.29 +
7.30 def access_location(self):
7.31 return self.location
7.32
7.33 @@ -82,57 +96,41 @@
7.34 else:
7.35 return encode_path(self.name)
7.36
7.37 - # For sources, any identified static origin will be constant and thus
7.38 - # usable directly. For targets, no constant should be assigned and thus
7.39 - # the alias (or any plain name) will be used.
7.40 -
7.41 - ref = self.static()
7.42 - origin = ref and self.get_origin()
7.43 - static_name = origin and encode_path(origin)
7.44 -
7.45 - # Determine whether a qualified name is involved.
7.46 -
7.47 - t = (not self.is_constant_alias() and self.get_name() or self.name).rsplit(".", 1)
7.48 - parent = len(t) > 1 and t[0] or None
7.49 - attrname = t[-1] and encode_path(t[-1])
7.50 -
7.51 # Assignments.
7.52
7.53 if self.expr:
7.54
7.55 # Eliminate assignments between constants.
7.56
7.57 - if ref and self.expr.static():
7.58 + if self.static_ref and self.expr.static():
7.59 return ""
7.60
7.61 # Qualified names must be converted into parent-relative assignments.
7.62
7.63 - elif parent:
7.64 + elif self.parent:
7.65 return "__store_via_object(&%s, %s, %s)" % (
7.66 - encode_path(parent), attrname, self.expr)
7.67 + encode_path(self.parent), self.attrname, self.expr)
7.68
7.69 # All other assignments involve the names as they were given.
7.70
7.71 else:
7.72 - return "%s = %s" % (attrname, self.expr)
7.73 + return "%s = %s" % (self.attrname, self.expr)
7.74
7.75 # Expressions.
7.76
7.77 - elif static_name:
7.78 - parent = ref.parent()
7.79 - context = ref.has_kind("<function>") and encode_path(parent) or None
7.80 - return "__ATTRVALUE(&%s)" % static_name
7.81 + elif self.static_name:
7.82 + return "__ATTRVALUE(&%s)" % self.static_name
7.83
7.84 # Qualified names must be converted into parent-relative accesses.
7.85
7.86 - elif parent:
7.87 + elif self.parent:
7.88 return "__load_via_object(&%s, %s)" % (
7.89 - encode_path(parent), attrname)
7.90 + encode_path(self.parent), self.attrname)
7.91
7.92 # All other accesses involve the names as they were given.
7.93
7.94 else:
7.95 - return "(%s)" % attrname
7.96 + return "(%s)" % self.attrname
7.97
7.98 class TrConstantValueRef(ConstantValueRef):
7.99