summaryrefslogtreecommitdiffabout
path: root/libkcal/versit/vcc.c
Unidiff
Diffstat (limited to 'libkcal/versit/vcc.c') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/versit/vcc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libkcal/versit/vcc.c b/libkcal/versit/vcc.c
index 9be752d..5413813 100644
--- a/libkcal/versit/vcc.c
+++ b/libkcal/versit/vcc.c
@@ -1741,49 +1741,50 @@ static void lexAppendc(int c)
1741 if (lexBuf.strsLen > lexBuf.maxToken) { 1741 if (lexBuf.strsLen > lexBuf.maxToken) {
1742 /* double the token string size */ 1742 /* double the token string size */
1743 lexBuf.maxToken <<= 1; 1743 lexBuf.maxToken <<= 1;
1744 lexBuf.strs = (char*) realloc(lexBuf.strs,(size_t)lexBuf.maxToken); 1744 lexBuf.strs = (char*) realloc(lexBuf.strs,(size_t)lexBuf.maxToken);
1745 } 1745 }
1746 } 1746 }
1747 1747
1748static char* lexStr() { 1748static char* lexStr() {
1749 return dupStr(lexBuf.strs,(size_t)lexBuf.strsLen+1); 1749 return dupStr(lexBuf.strs,(size_t)lexBuf.strsLen+1);
1750 } 1750 }
1751 1751
1752static void lexSkipWhite() { 1752static void lexSkipWhite() {
1753 int c = lexLookahead(); 1753 int c = lexLookahead();
1754 while (c == ' ' || c == '\t') { 1754 while (c == ' ' || c == '\t') {
1755 lexSkipLookahead(); 1755 lexSkipLookahead();
1756 c = lexLookahead(); 1756 c = lexLookahead();
1757 } 1757 }
1758 } 1758 }
1759 1759
1760static char* lexGetWord() { 1760static char* lexGetWord() {
1761 int c; 1761 int c;
1762 lexSkipWhite(); 1762 lexSkipWhite();
1763 lexClearToken(); 1763 lexClearToken();
1764 c = lexLookahead(); 1764 c = lexLookahead();
1765 while (c != EOF && !strchr("\t\n ;:=",c)) { 1765 // LR while (c != EOF && !strchr("\t\n ;:=",c)) {
1766 while (c != EOF && !strchr("\t\n;:=",c)) {
1766 lexAppendc(c); 1767 lexAppendc(c);
1767 lexSkipLookahead(); 1768 lexSkipLookahead();
1768 c = lexLookahead(); 1769 c = lexLookahead();
1769 } 1770 }
1770 lexAppendc(0); 1771 lexAppendc(0);
1771 return lexStr(); 1772 return lexStr();
1772 } 1773 }
1773 1774
1774static void lexPushLookaheadc(int c) { 1775static void lexPushLookaheadc(int c) {
1775 int putptr; 1776 int putptr;
1776 /* can't putback EOF, because it never leaves lookahead buffer */ 1777 /* can't putback EOF, because it never leaves lookahead buffer */
1777 if (c == EOF) return; 1778 if (c == EOF) return;
1778 putptr = (int)lexBuf.getPtr - 1; 1779 putptr = (int)lexBuf.getPtr - 1;
1779 if (putptr < 0) putptr += MAX_LEX_LOOKAHEAD; 1780 if (putptr < 0) putptr += MAX_LEX_LOOKAHEAD;
1780 lexBuf.getPtr = putptr; 1781 lexBuf.getPtr = putptr;
1781 lexBuf.buf[putptr] = c; 1782 lexBuf.buf[putptr] = c;
1782 lexBuf.len += 1; 1783 lexBuf.len += 1;
1783 } 1784 }
1784 1785
1785static char* lexLookaheadWord() { 1786static char* lexLookaheadWord() {
1786 /* this function can lookahead word with max size of MAX_LEX_LOOKAHEAD_0 1787 /* this function can lookahead word with max size of MAX_LEX_LOOKAHEAD_0
1787 / and thing bigger than that will stop the lookahead and return 0; 1788 / and thing bigger than that will stop the lookahead and return 0;
1788 / leading white spaces are not recoverable. 1789 / leading white spaces are not recoverable.
1789 */ 1790 */