Lichen

Changeset

915:c9c7a7167691
5 months ago Paul Boddie raw files shortlog changelog graph Merged changes from the default branch. trailing-data
templates/types.h (file)
     1.1 --- a/common.py	Sat Jun 08 17:55:55 2019 +0200
     1.2 +++ b/common.py	Tue Jun 22 22:39:35 2021 +0200
     1.3 @@ -598,24 +598,47 @@
     1.4                  [compiler.ast.AssName(t2, "OP_ASSIGN")],
     1.5                  compiler.ast.Getattr(compiler.ast.Name(t1), "next")),
     1.6  
     1.7 +            # try:
     1.8 +
     1.9              compiler.ast.TryExcept(
    1.10 +
    1.11 +                # while True:
    1.12 +
    1.13                  compiler.ast.While(
    1.14                      compiler.ast.Name("True"),
    1.15                      compiler.ast.Stmt([
    1.16 +
    1.17 +                        # try:
    1.18 +
    1.19                          compiler.ast.TryExcept(
    1.20 +
    1.21 +                            # <t3> = <t2>()
    1.22 +
    1.23                              compiler.ast.Assign(
    1.24                                  [compiler.ast.AssName(t3, "OP_ASSIGN")],
    1.25                                  compiler.ast.CallFunc(
    1.26                                      compiler.ast.Name(t2),
    1.27                                      [])),
    1.28 +
    1.29 +                        # except StopIteration:
    1.30 +                        #     raise LoopExit
    1.31 +
    1.32                              [(compiler.ast.Name("StopIteration"), None,
    1.33                                compiler.ast.Raise(compiler.ast.Name("LoopExit")))],
    1.34                              None),
    1.35 +
    1.36 +                        # <var>... = <t3>
    1.37 +
    1.38                          compiler.ast.Assign(
    1.39                              [n.assign],
    1.40                              compiler.ast.Name(t3)),
    1.41                          n.body]),
    1.42                      None),
    1.43 +
    1.44 +            # except LoopExit:
    1.45 +            #     {n.else_}
    1.46 +            #     pass
    1.47 +
    1.48                  [(compiler.ast.Name("LoopExit"), None, n.else_ or compiler.ast.Pass())],
    1.49                  None)
    1.50              ])
     2.1 --- a/docs/wiki/Deduction	Sat Jun 08 17:55:55 2019 +0200
     2.2 +++ b/docs/wiki/Deduction	Tue Jun 22 22:39:35 2021 +0200
     2.3 @@ -89,7 +89,7 @@
     2.4  //format=svg
     2.5  //transform=notugly
     2.6  digraph indexes {
     2.7 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Indexes"];
     2.8 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Indexes"];
     2.9    edge [tooltip="Indexes"];
    2.10    rankdir=LR;
    2.11  
    2.12 @@ -142,7 +142,7 @@
    2.13  //format=svg
    2.14  //transform=notugly
    2.15  digraph deduction {
    2.16 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Deduction"];
    2.17 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Deduction"];
    2.18    edge [tooltip="Deduction"];
    2.19    rankdir=LR;
    2.20  
    2.21 @@ -192,7 +192,7 @@
    2.22  //format=svg
    2.23  //transform=notugly
    2.24  digraph usage_to_types {
    2.25 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Usage to types"];
    2.26 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Usage to types"];
    2.27    edge [tooltip="Usage to types"];
    2.28    rankdir=LR;
    2.29  
    2.30 @@ -249,7 +249,7 @@
    2.31  //format=svg
    2.32  //transform=notugly
    2.33  digraph instance_providers {
    2.34 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Instance providers"];
    2.35 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Instance providers"];
    2.36    edge [tooltip="Instance providers"];
    2.37    rankdir=LR;
    2.38  
    2.39 @@ -310,7 +310,7 @@
    2.40  //format=svg
    2.41  //transform=notugly
    2.42  digraph assignments {
    2.43 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Attribute assignments"];
    2.44 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Attribute assignments"];
    2.45    edge [tooltip="Attribute assignments"];
    2.46    rankdir=LR;
    2.47  
     3.1 --- a/docs/wiki/Imports	Sat Jun 08 17:55:55 2019 +0200
     3.2 +++ b/docs/wiki/Imports	Tue Jun 22 22:39:35 2021 +0200
     3.3 @@ -95,7 +95,7 @@
     3.4  //format=svg
     3.5  //transform=notugly
     3.6  digraph mutual {
     3.7 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Mutually-dependent modules"];
     3.8 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Mutually-dependent modules"];
     3.9    edge [tooltip="Mutually-dependent modules"];
    3.10    rankdir=LR;
    3.11  
    3.12 @@ -209,7 +209,7 @@
    3.13  //format=svg
    3.14  //transform=notugly
    3.15  digraph imports {
    3.16 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Import dependencies"];
    3.17 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Import dependencies"];
    3.18    edge [tooltip="Import dependencies"];
    3.19    rankdir=LR;
    3.20  
     4.1 --- a/docs/wiki/Inspection	Sat Jun 08 17:55:55 2019 +0200
     4.2 +++ b/docs/wiki/Inspection	Tue Jun 22 22:39:35 2021 +0200
     4.3 @@ -179,7 +179,7 @@
     4.4  //format=svg
     4.5  //transform=notugly
     4.6  digraph accesses {
     4.7 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Names and accesses"];
     4.8 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Names and accesses"];
     4.9    edge [tooltip="Names and accesses"];
    4.10    rankdir=TB;
    4.11  
    4.12 @@ -316,7 +316,7 @@
    4.13  //format=svg
    4.14  //transform=notugly
    4.15  digraph usage {
    4.16 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Name and attribute tracking"];
    4.17 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Name and attribute tracking"];
    4.18    edge [tooltip="Name and attribute tracking"];
    4.19    rankdir=TB;
    4.20  
     5.1 --- a/docs/wiki/Representations	Sat Jun 08 17:55:55 2019 +0200
     5.2 +++ b/docs/wiki/Representations	Tue Jun 22 22:39:35 2021 +0200
     5.3 @@ -16,8 +16,8 @@
     5.4  //format=svg
     5.5  //transform=notugly
     5.6  digraph attributes {
     5.7 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Attributes"];
     5.8 -  edge [fontsize="13.0",fontname="Helvetica",tooltip="Attributes"];
     5.9 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Attributes"];
    5.10 +  edge [fontsize="13.0",fontname="sans-serif",tooltip="Attributes"];
    5.11    rankdir=TB;
    5.12  
    5.13    attrA [label="attribute | { value |<value> reference to object }",shape=record];
    5.14 @@ -77,8 +77,8 @@
    5.15  //format=svg
    5.16  //transform=notugly
    5.17  digraph wrappers {
    5.18 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Wrappers"];
    5.19 -  edge [fontsize="13.0",fontname="Helvetica",tooltip="Wrappers"];
    5.20 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Wrappers"];
    5.21 +  edge [fontsize="13.0",fontname="sans-serif",tooltip="Wrappers"];
    5.22    rankdir=TB;
    5.23  
    5.24    inst [label="<main> instance | { attr1 |<attr1> reference to method } | { attr2 | value } | ...",shape=record];
    5.25 @@ -104,8 +104,8 @@
    5.26  //format=svg
    5.27  //transform=notugly
    5.28  digraph objects {
    5.29 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Objects"];
    5.30 -  edge [fontsize="13.0",fontname="Helvetica",tooltip="Objects"];
    5.31 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Objects"];
    5.32 +  edge [fontsize="13.0",fontname="sans-serif",tooltip="Objects"];
    5.33    rankdir=TB;
    5.34  
    5.35    instC [label="<main> instance of C | { 0 | reference to\ninstance table } | { __class__ |<cls> reference\nto C } | { a | value } | { b | value } | ...",shape=record];
     6.1 --- a/docs/wiki/Restarted	Sat Jun 08 17:55:55 2019 +0200
     6.2 +++ b/docs/wiki/Restarted	Tue Jun 22 22:39:35 2021 +0200
     6.3 @@ -262,8 +262,8 @@
     6.4  //format=svg
     6.5  //transform=notugly
     6.6  digraph structures {
     6.7 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Instance and class structures"];
     6.8 -  edge [fontsize="13.0",fontname="Helvetica",tooltip="Instance and class structures"];
     6.9 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Instance and class structures"];
    6.10 +  edge [fontsize="13.0",fontname="sans-serif",tooltip="Instance and class structures"];
    6.11    rankdir=TB;
    6.12  
    6.13    instanceC [label="<main> instance of C |{ context of a | value of a }|{context of b | value of b }",shape=record];
    6.14 @@ -285,8 +285,8 @@
    6.15  //format=svg
    6.16  //transform=notugly
    6.17  digraph methods {
    6.18 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Method structures"];
    6.19 -  edge [fontsize="13.0",fontname="Helvetica",tooltip="Method structures"];
    6.20 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Method structures"];
    6.21 +  edge [fontsize="13.0",fontname="sans-serif",tooltip="Method structures"];
    6.22    rankdir=TB;
    6.23  
    6.24    classC [label="<main> class C | { context of m | <mvalue> uncallable for m } | ...",shape=record];
     7.1 --- a/docs/wiki/Structure	Sat Jun 08 17:55:55 2019 +0200
     7.2 +++ b/docs/wiki/Structure	Tue Jun 22 22:39:35 2021 +0200
     7.3 @@ -29,7 +29,7 @@
     7.4  //format=svg
     7.5  //transform=notugly
     7.6  digraph program {
     7.7 -  node [shape=box,fontsize="13.0",fontname="Helvetica",tooltip="Program structure"];
     7.8 +  node [shape=box,fontsize="13.0",fontname="sans-serif",tooltip="Program structure"];
     7.9    edge [tooltip="Program structure"];
    7.10    rankdir=LR;
    7.11  
     8.1 --- a/templates/native/locale.c	Sat Jun 08 17:55:55 2019 +0200
     8.2 +++ b/templates/native/locale.c	Tue Jun 22 22:39:35 2021 +0200
     8.3 @@ -1,6 +1,6 @@
     8.4  /* Native functions for locale handling.
     8.5  
     8.6 -Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
     8.7 +Copyright (C) 2016, 2017, 2021 Paul Boddie <paul@boddie.org.uk>
     8.8  
     8.9  This program is free software; you can redistribute it and/or modify it under
    8.10  the terms of the GNU General Public License as published by the Free Software
    8.11 @@ -43,7 +43,7 @@
    8.12  
    8.13      length = strlen(result);
    8.14      out = __ALLOCATE(length + 1, sizeof(char));
    8.15 -    strncpy(out, result, length);
    8.16 +    strcpy(out, result);
    8.17  
    8.18      return __new_str(result, length);
    8.19  }
    8.20 @@ -64,7 +64,7 @@
    8.21  
    8.22      length = strlen(result);
    8.23      out = __ALLOCATE(length + 1, sizeof(char));
    8.24 -    strncpy(out, result, length);
    8.25 +    strcpy(out, result);
    8.26  
    8.27      return __new_str(result, length);
    8.28  }
     9.1 --- a/templates/types.h	Sat Jun 08 17:55:55 2019 +0200
     9.2 +++ b/templates/types.h	Tue Jun 22 22:39:35 2021 +0200
     9.3 @@ -131,8 +131,8 @@
     9.4  
     9.5  #define __INTVALUE(VALUE)   ((__attr) {.intvalue=((VALUE) << __NUM_TAG_BITS) | __TAG_INT})
     9.6  #define __TOINT(ATTR)       ((ATTR).intvalue >> __NUM_TAG_BITS)
     9.7 -#define __MAXINT            ((1 << ((sizeof(__attr) * 8) - 1 - __NUM_TAG_BITS)) - 1)
     9.8 -#define __MININT            (-(1 << ((sizeof(__attr) * 8) - 1 - __NUM_TAG_BITS)))
     9.9 +#define __MAXINT            ((1 << ((sizeof(int) * 8) - 1 - __NUM_TAG_BITS)) - 1)
    9.10 +#define __MININT            (-(1 << ((sizeof(int) * 8) - 1 - __NUM_TAG_BITS)))
    9.11  
    9.12  /* Argument lists. */
    9.13