XML-ED

 view release on metacpan or  search on metacpan

lib/XML/ED/parser.c  view on Meta::CPAN

	goto comment_2dash;
    goto comment_x;

  comment_2dash:
    cpos++;
    let = *cpos;
    if (let == '>') {
        curnode->vallen = cpos - curnode->value - 2;
	cpos++;
	curnode = curnode->parent;
	goto val_1;
    }
    goto comment_x;

  comment:
    let = *cpos;
    switch (let) {
    case '\0':
	goto done;
    case '-':
	goto comment_1dash;
    }
    cpos++;

  comment_x:
    let = *cpos;
    switch (let) {
    case 0:
	goto done;
    case '-':
	goto comment_1dash;
    }
    cpos++;
    goto comment_x;

  pi:
    let = *cpos;
    if (!let)
	goto done;
    if (let == '?' && *(cpos + 1) == '>') {
	cpos += 2;
	goto val_1;
    }
    cpos++;
    goto pi;

  bang:
    let = *cpos;
    if (!let)
	goto done;
    if (let == '>') {
	curnode->vallen = cpos - curnode->value;
	cpos++;
	curnode = curnode->parent;

	goto val_1;
    }
    cpos++;
    goto bang;

  cdata:
    let = *cpos;
    if (!let)
	goto done;
    if (let == ']' && *(cpos + 1) == ']' && *(cpos + 2) == '>') {
	cpos += 3;
	goto val_1;
    }
    cpos++;
    goto cdata;

// looking for name after <

  name_1:
#ifdef DEBUG
    printf("name_1: %c\n", *cpos);
#endif
    let = *cpos;
    switch (let) {
    case '\0':
	goto done;
    case ' ':
    case '\r':
    case '\n':
	cpos++;
	goto name_1;
    case '/':			// regular closing tag
	tagname_len = 0;	// needed to reset
	cpos++;
	goto ename_1;
    }
    tagname = cpos;
    tagname_len = 1;
    cpos++;
    goto name_x;

// have a name 

  name_x:
#ifdef DEBUG
    printf("name_x: %c\n", *cpos);
#endif
    let = *cpos;
    switch (let) {
    case '\0':
	goto done;
    case '/':			// self closing
    case '?':			// self closing

    case ' ':
    case '\n':
    case '\r':
    case '>':
	curnode =
	    nodec_addchildr(curnode, tagname, tagname_len, tagname_type);
	attname_len = 0;
	goto name_gap;
    }

    tagname_len++;
    cpos++;
    goto name_x;

// look for attributes

  name_gap:
    let = *cpos;
    switch (*cpos) {
    case '\0':
	goto done;



( run in 0.501 second using v1.01-cache-2.11-cpan-39bf76dae61 )