Staging
v0.5.1
https://github.com/python/cpython
Revision b5f20ea91ec4d9dc7e1c31629903888c651bd02c authored by Victor Stinner on 20 July 2017, 18:04:49 UTC, committed by Ned Deily on 20 July 2017, 18:04:49 UTC
* Backport Travis CI config from master

Add .travis.yml for Travis CI.

* bpo-30231: Remove skipped test_imaplib tests (#1419) (#2193)

The public cyrus.andrew.cmu.edu IMAP server (port 993) doesn't accept
TLS connection using our self-signed x509 certificate. Remove the two
tests which are already skipped.
(cherry picked from commit 7895a0585b4b6a1c8082d17227307c6ce2c8bb8b)
1 parent e46f1c1
Raw File
Tip revision: b5f20ea91ec4d9dc7e1c31629903888c651bd02c authored by Victor Stinner on 20 July 2017, 18:04:49 UTC
[3.3] Backport CI config from master and remove skipped imaplib tests (#2481)
Tip revision: b5f20ea
listnode.c

/* List a node on a file */

#include "pgenheaders.h"
#include "token.h"
#include "node.h"

/* Forward */
static void list1node(FILE *, node *);
static void listnode(FILE *, node *);

void
PyNode_ListTree(node *n)
{
    listnode(stdout, n);
}

static int level, atbol;

static void
listnode(FILE *fp, node *n)
{
    level = 0;
    atbol = 1;
    list1node(fp, n);
}

static void
list1node(FILE *fp, node *n)
{
    if (n == 0)
        return;
    if (ISNONTERMINAL(TYPE(n))) {
        int i;
        for (i = 0; i < NCH(n); i++)
            list1node(fp, CHILD(n, i));
    }
    else if (ISTERMINAL(TYPE(n))) {
        switch (TYPE(n)) {
        case INDENT:
            ++level;
            break;
        case DEDENT:
            --level;
            break;
        default:
            if (atbol) {
                int i;
                for (i = 0; i < level; ++i)
                    fprintf(fp, "\t");
                atbol = 0;
            }
            if (TYPE(n) == NEWLINE) {
                if (STR(n) != NULL)
                    fprintf(fp, "%s", STR(n));
                fprintf(fp, "\n");
                atbol = 1;
            }
            else
                fprintf(fp, "%s ", STR(n));
            break;
        }
    }
    else
        fprintf(fp, "? ");
}
back to top