# HG changeset patch # User Paul Boddie # Date 1624394375 -7200 # Node ID c9c7a7167691d7c6843aeea8e95278eab2e3a7d5 # Parent 8b0c4d9b2c9991f6fdaef80c8761c7cd89baaee3# Parent deae281b59ec5e8bb909de09a3076acb5b7c03aa Merged changes from the default branch. diff -r 8b0c4d9b2c99 -r c9c7a7167691 common.py --- a/common.py Sat Jun 08 17:55:55 2019 +0200 +++ b/common.py Tue Jun 22 22:39:35 2021 +0200 @@ -598,24 +598,47 @@ [compiler.ast.AssName(t2, "OP_ASSIGN")], compiler.ast.Getattr(compiler.ast.Name(t1), "next")), + # try: + compiler.ast.TryExcept( + + # while True: + compiler.ast.While( compiler.ast.Name("True"), compiler.ast.Stmt([ + + # try: + compiler.ast.TryExcept( + + # = () + compiler.ast.Assign( [compiler.ast.AssName(t3, "OP_ASSIGN")], compiler.ast.CallFunc( compiler.ast.Name(t2), [])), + + # except StopIteration: + # raise LoopExit + [(compiler.ast.Name("StopIteration"), None, compiler.ast.Raise(compiler.ast.Name("LoopExit")))], None), + + # ... = + compiler.ast.Assign( [n.assign], compiler.ast.Name(t3)), n.body]), None), + + # except LoopExit: + # {n.else_} + # pass + [(compiler.ast.Name("LoopExit"), None, n.else_ or compiler.ast.Pass())], None) ]) diff -r 8b0c4d9b2c99 -r c9c7a7167691 docs/wiki/Deduction --- a/docs/wiki/Deduction Sat Jun 08 17:55:55 2019 +0200 +++ b/docs/wiki/Deduction Tue Jun 22 22:39:35 2021 +0200 @@ -89,7 +89,7 @@ //format=svg //transform=notugly digraph indexes { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Indexes"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Indexes"]; edge [tooltip="Indexes"]; rankdir=LR; @@ -142,7 +142,7 @@ //format=svg //transform=notugly digraph deduction { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Deduction"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Deduction"]; edge [tooltip="Deduction"]; rankdir=LR; @@ -192,7 +192,7 @@ //format=svg //transform=notugly digraph usage_to_types { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Usage to types"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Usage to types"]; edge [tooltip="Usage to types"]; rankdir=LR; @@ -249,7 +249,7 @@ //format=svg //transform=notugly digraph instance_providers { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Instance providers"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Instance providers"]; edge [tooltip="Instance providers"]; rankdir=LR; @@ -310,7 +310,7 @@ //format=svg //transform=notugly digraph assignments { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Attribute assignments"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Attribute assignments"]; edge [tooltip="Attribute assignments"]; rankdir=LR; diff -r 8b0c4d9b2c99 -r c9c7a7167691 docs/wiki/Imports --- a/docs/wiki/Imports Sat Jun 08 17:55:55 2019 +0200 +++ b/docs/wiki/Imports Tue Jun 22 22:39:35 2021 +0200 @@ -95,7 +95,7 @@ //format=svg //transform=notugly digraph mutual { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Mutually-dependent modules"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Mutually-dependent modules"]; edge [tooltip="Mutually-dependent modules"]; rankdir=LR; @@ -209,7 +209,7 @@ //format=svg //transform=notugly digraph imports { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Import dependencies"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Import dependencies"]; edge [tooltip="Import dependencies"]; rankdir=LR; diff -r 8b0c4d9b2c99 -r c9c7a7167691 docs/wiki/Inspection --- a/docs/wiki/Inspection Sat Jun 08 17:55:55 2019 +0200 +++ b/docs/wiki/Inspection Tue Jun 22 22:39:35 2021 +0200 @@ -179,7 +179,7 @@ //format=svg //transform=notugly digraph accesses { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Names and accesses"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Names and accesses"]; edge [tooltip="Names and accesses"]; rankdir=TB; @@ -316,7 +316,7 @@ //format=svg //transform=notugly digraph usage { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Name and attribute tracking"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Name and attribute tracking"]; edge [tooltip="Name and attribute tracking"]; rankdir=TB; diff -r 8b0c4d9b2c99 -r c9c7a7167691 docs/wiki/Representations --- a/docs/wiki/Representations Sat Jun 08 17:55:55 2019 +0200 +++ b/docs/wiki/Representations Tue Jun 22 22:39:35 2021 +0200 @@ -16,8 +16,8 @@ //format=svg //transform=notugly digraph attributes { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Attributes"]; - edge [fontsize="13.0",fontname="Helvetica",tooltip="Attributes"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Attributes"]; + edge [fontsize="13.0",fontname="sans-serif",tooltip="Attributes"]; rankdir=TB; attrA [label="attribute | { value | reference to object }",shape=record]; @@ -77,8 +77,8 @@ //format=svg //transform=notugly digraph wrappers { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Wrappers"]; - edge [fontsize="13.0",fontname="Helvetica",tooltip="Wrappers"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Wrappers"]; + edge [fontsize="13.0",fontname="sans-serif",tooltip="Wrappers"]; rankdir=TB; inst [label="
instance | { attr1 | reference to method } | { attr2 | value } | ...",shape=record]; @@ -104,8 +104,8 @@ //format=svg //transform=notugly digraph objects { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Objects"]; - edge [fontsize="13.0",fontname="Helvetica",tooltip="Objects"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Objects"]; + edge [fontsize="13.0",fontname="sans-serif",tooltip="Objects"]; rankdir=TB; instC [label="
instance of C | { 0 | reference to\ninstance table } | { __class__ | reference\nto C } | { a | value } | { b | value } | ...",shape=record]; diff -r 8b0c4d9b2c99 -r c9c7a7167691 docs/wiki/Restarted --- a/docs/wiki/Restarted Sat Jun 08 17:55:55 2019 +0200 +++ b/docs/wiki/Restarted Tue Jun 22 22:39:35 2021 +0200 @@ -262,8 +262,8 @@ //format=svg //transform=notugly digraph structures { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Instance and class structures"]; - edge [fontsize="13.0",fontname="Helvetica",tooltip="Instance and class structures"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Instance and class structures"]; + edge [fontsize="13.0",fontname="sans-serif",tooltip="Instance and class structures"]; rankdir=TB; instanceC [label="
instance of C |{ context of a | value of a }|{context of b | value of b }",shape=record]; @@ -285,8 +285,8 @@ //format=svg //transform=notugly digraph methods { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Method structures"]; - edge [fontsize="13.0",fontname="Helvetica",tooltip="Method structures"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Method structures"]; + edge [fontsize="13.0",fontname="sans-serif",tooltip="Method structures"]; rankdir=TB; classC [label="
class C | { context of m | uncallable for m } | ...",shape=record]; diff -r 8b0c4d9b2c99 -r c9c7a7167691 docs/wiki/Structure --- a/docs/wiki/Structure Sat Jun 08 17:55:55 2019 +0200 +++ b/docs/wiki/Structure Tue Jun 22 22:39:35 2021 +0200 @@ -29,7 +29,7 @@ //format=svg //transform=notugly digraph program { - node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Program structure"]; + node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Program structure"]; edge [tooltip="Program structure"]; rankdir=LR; diff -r 8b0c4d9b2c99 -r c9c7a7167691 templates/native/locale.c --- a/templates/native/locale.c Sat Jun 08 17:55:55 2019 +0200 +++ b/templates/native/locale.c Tue Jun 22 22:39:35 2021 +0200 @@ -1,6 +1,6 @@ /* Native functions for locale handling. -Copyright (C) 2016, 2017 Paul Boddie +Copyright (C) 2016, 2017, 2021 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -43,7 +43,7 @@ length = strlen(result); out = __ALLOCATE(length + 1, sizeof(char)); - strncpy(out, result, length); + strcpy(out, result); return __new_str(result, length); } @@ -64,7 +64,7 @@ length = strlen(result); out = __ALLOCATE(length + 1, sizeof(char)); - strncpy(out, result, length); + strcpy(out, result); return __new_str(result, length); } diff -r 8b0c4d9b2c99 -r c9c7a7167691 templates/types.h --- a/templates/types.h Sat Jun 08 17:55:55 2019 +0200 +++ b/templates/types.h Tue Jun 22 22:39:35 2021 +0200 @@ -131,8 +131,8 @@ #define __INTVALUE(VALUE) ((__attr) {.intvalue=((VALUE) << __NUM_TAG_BITS) | __TAG_INT}) #define __TOINT(ATTR) ((ATTR).intvalue >> __NUM_TAG_BITS) -#define __MAXINT ((1 << ((sizeof(__attr) * 8) - 1 - __NUM_TAG_BITS)) - 1) -#define __MININT (-(1 << ((sizeof(__attr) * 8) - 1 - __NUM_TAG_BITS))) +#define __MAXINT ((1 << ((sizeof(int) * 8) - 1 - __NUM_TAG_BITS)) - 1) +#define __MININT (-(1 << ((sizeof(int) * 8) - 1 - __NUM_TAG_BITS))) /* Argument lists. */