MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxGetNextEntity

Function fxGetNextEntity

xs/sources/xsLexical.c:1651–1695  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1649}
1650
1651txString fxGetNextEntity(txParser* parser, txString p, txString q)
1652{
1653 txString r = p;
1654 txU4 t = 0;
1655 if (p < q) *p++ = '&';
1656 fxGetNextCharacter(parser);
1657 if (parser->character == '#') {
1658 if (p < q) *p++ = '#';
1659 fxGetNextCharacter(parser);
1660 if (parser->character == 'x') {
1661 if (p < q) *p++ = 'x';
1662 fxGetNextCharacter(parser);
1663 while (fxGetNextStringX(parser->character, &t)) {
1664 if (p < q) *p++ = parser->character;
1665 fxGetNextCharacter(parser);
1666 }
1667 }
1668 else {
1669 while (fxGetNextStringD(parser->character, &t)) {
1670 if (p < q) *p++ = parser->character;
1671 fxGetNextCharacter(parser);
1672 }
1673 }
1674 }
1675 else {
1676 txEntity* entity = C_NULL;
1677 int c = parser->character;
1678 while ((p < q) && ((('0' <= c) && (c <= '9')) || (('A' <= c) && (c <= 'Z')) || (('a' <= c) && (c <= 'z')))) {
1679 if (p < q) *p++ = c;
1680 fxGetNextCharacter(parser);
1681 c = parser->character;
1682 }
1683 *p = 0;
1684 if (r < q)
1685 entity = (txEntity*)c_bsearch(r + 1, gxEntities, XS_ENTITIES_COUNT, sizeof(txEntity), fxCompareEntities);
1686 t = entity ? entity->value : 0;
1687 }
1688 if (parser->character == ';') {
1689 if (p < q) *p++ = ';';
1690 fxGetNextCharacter(parser);
1691 if (t)
1692 p = fxUTF8Buffer(parser, t, r, q);
1693 }
1694 return p;
1695}
1696
1697void fxGetNextTokenJSXAttribute(txParser* parser)
1698{

Callers 2

fxGetNextTokenJSXChildFunction · 0.85

Calls 4

fxGetNextCharacterFunction · 0.85
fxGetNextStringXFunction · 0.85
fxGetNextStringDFunction · 0.85
fxUTF8BufferFunction · 0.85

Tested by

no test coverage detected