Changeset 1409
- Timestamp:
- Apr 30, 2004, 10:39:38 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/emxomf/stabshll.c
-
Property cvs2svn:cvs-rev
changed from
1.31
to1.32
r1408 r1409 19 19 the Free Software Foundation, 59 Temple Place - Suite 330, 20 20 Boston, MA 02111-1307, USA. */ 21 21 //#define HLL_DEBUG 1 22 22 23 23 /******************************************************************************* … … 30 30 #include <time.h> 31 31 #include <alloca.h> 32 #include <ctype.h> 32 33 #include "defs.h" 33 34 #include "emxomf.h" … … 407 408 { 408 409 if (parse_pindex && *parse_pindex >= 0 && *parse_pindex < sym_count) 409 fprintf (stderr, "emxomf info: parsing sym no.%d type=%d at char '%c' in position % ld:\n%s\n",410 fprintf (stderr, "emxomf info: parsing sym no.%d type=%d at char '%c' in position %d:\n%s\n", 410 411 *parse_pindex, sym_ptr[*parse_pindex].n_type, 411 412 *parse_ptr, parse_ptr - parse_start, parse_start); 412 413 else 413 fprintf (stderr, "emxomf info: parsing '%c' at position % ld:\n%s\n",414 fprintf (stderr, "emxomf info: parsing '%c' at position %d:\n%s\n", 414 415 *parse_ptr, parse_ptr - parse_start, parse_start); 415 416 } … … 1556 1557 * @returns Pointer to next colon within psz. 1557 1558 * @returns NULL if not found. 1558 * @param psz String to search. 1559 * @param pszString String to search. 1560 * @param chType Type we're parsing. Use '\0' if unknown or it 1561 * should be ignored 1562 * @remark Still a bad hack this. 1559 1563 */ 1560 static const char *nextcolon(const char *psz) 1561 { 1562 int cNesting = 0; /* <> level */ 1563 1564 for (;;psz++) 1565 switch (*psz) 1566 { 1567 case '<': 1568 if (psz[1] == ':') 1569 return psz + 1; 1570 if (psz[1] == '<') /* hack for operators. */ 1564 #ifdef COLON_DEBUG 1565 static const char *nextcolon2(const char *pszString, char chType) 1566 { 1567 static const char *_nextcolon2(const char *pszString, char chType); 1568 const char *psz = _nextcolon2(pszString, chType); 1569 fprintf(stderr, "COLON: %.100s\n%.32s\n", pszString, psz); 1570 return psz; 1571 } 1572 static const char *_nextcolon2(const char *pszString, char chType) 1573 #else 1574 static const char *nextcolon2(const char *pszString, char chType) 1575 #endif 1576 { 1577 const char *pszColon; 1578 const char *psz; 1579 1580 /* permanent operator hack */ 1581 if ( pszString[0] == 'o' 1582 && pszString[1] == 'p' 1583 && pszString[2] == 'e' 1584 && pszString[3] == 'r' 1585 && pszString[4] == 'a' 1586 && pszString[5] == 't' 1587 && pszString[6] == 'o' 1588 && pszString[7] == 'r') 1589 { 1590 psz = pszString + 8; 1591 while (*psz && !isalnum(*psz) && *psz != '_') /* potential operator chars */ 1592 { 1593 if (*psz == ':') 1571 1594 { 1572 psz++; 1573 break; 1595 if ( psz - pszString >= 1 + 8 1596 && psz - pszString <= 3 + 8) 1597 return psz; 1598 break; 1574 1599 } 1575 cNesting++; 1576 break; 1577 case '>': 1578 if (psz[1] == ':') 1579 return psz + 1; 1580 if (psz[1] == '>') /* hack for operators. */ 1600 psz++; 1601 } 1602 1603 } 1604 1605 /* normal life */ 1606 pszColon = strchr(pszString, ':'); 1607 if (!pszColon) 1608 return NULL; 1609 psz = strchr(pszString, '<'); 1610 1611 if (psz && psz < pszColon && pszColon[1] == ':') 1612 { 1613 int cNesting = 0; /* <> level */ 1614 1615 for (;;psz++) 1616 { 1617 switch (*psz) 1581 1618 { 1582 psz++; 1583 break; 1619 case '<': cNesting++; break; 1620 case '>': cNesting--; break; 1621 case ':': 1622 if (cNesting > 0) 1623 break; 1624 /* hack: continue on ">::" (but not on "operator...") */ 1625 if ( psz[1] == ':' 1626 && psz > pszString && psz[-1] == '>' 1627 ) 1628 { 1629 psz++; 1630 break; 1631 } 1632 return psz; 1633 case '\0': 1634 return NULL; 1584 1635 } 1585 cNesting--; 1586 break; 1587 case ':': 1588 if (cNesting <= 0) 1589 return psz; 1590 break; 1591 case '\0': 1592 return NULL; 1593 } 1594 return NULL; 1595 } 1636 } 1637 } 1638 else 1639 { 1640 if (chType != 'x') 1641 { 1642 /* skip '::' (hack:) if not followed by number. */ 1643 while (*pszColon && pszColon[1] == ':' && (pszColon[2] > '9' || pszColon[2] < '0')) 1644 { 1645 pszColon += 2; 1646 while (*pszColon != ':' && *pszColon) 1647 pszColon++; 1648 } 1649 } 1650 } 1651 1652 return pszColon; 1653 } 1654 1655 /* old version */ 1656 static inline const char *nextcolon(const char *pszString) 1657 { 1658 return nextcolon2(pszString, '\0'); 1659 } 1660 1596 1661 1597 1662 … … 1621 1686 if (!parse_number (&num1)) 1622 1687 goto syntax; 1688 1623 1689 /* Special case: self reference => void */ 1624 1690 is_void = FALSE; … … 1968 2034 ++parse_ptr; 1969 2035 ch = *parse_ptr++; 1970 p1 = nextcolon (parse_ptr);2036 p1 = nextcolon2 (parse_ptr, 'x'); 1971 2037 if (p1 == NULL) 1972 2038 { -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.