4c4 < * $Id: tclparser.pmc 7926 2005-04-25 16:17:41Z coke $ --- > * $Id: tclparser.pmc 8055 2005-05-10 21:14:59Z mdiep $ 601c601 < goto backslash_escape_octal; --- > goto backslash_escape_not; 606,683c606,607 < backslash_escape_octal: < /* Octal Escape (XXX: Too ASCII?) */ < /* We can take one to three digits. */ < if (I0 >= 48 && I0 <= 57) { < I0 -= 48; < I1 = string_index(INTERP, buffer, start_word+1); < if (I1 >=48 && I1 <=57) { < escape_length++; < I0 = 8*I0 + I1-48; < I1 = string_index(INTERP, buffer, start_word+2); < if (I1 >=48 && I1 <=57) { < escape_length++; < I0 = 8*I0 + I1 - 48; < } < } < Parrot_call_method(INTERP, P1, word, ConcatChar, "vI", I0); < goto escape_done; < } < < backslash_escape_hex: < /* < * Hex Excape: < * Take as many hex digit as we can get, but only the last < * two are used to generate the character. < */ < if (I0 == 120) { < /* loop, getting characters. Keep a running total in I0 */ < I0 = 0; < while (1) { < I1 = string_index(INTERP, buffer, start_word + escape_length); < if (I1 >=48 && I1 <=57) { /* 0-9 */ < I0 = I0 * 16 + I1-48; < } else if (I1>=65 && I1<=70) { /* A-Z */ < I0 = I0 * 16 + I1 - 65 + 10; < } else if (I1>=97 && I1<=102) { /* a-z */ < I0 = I0 * 16 + I1 - 97 + 10; < } else { < break; < } < I0 = I0 % 256; /* Toss away anything bigger than two digits. */ < escape_length++; < } < if (escape_length == 1) { < Parrot_call_method(INTERP, P1, word, ConcatChar, "vI", 120); < } else { < Parrot_call_method(INTERP, P1, word, ConcatChar, "vI", I0); < } < goto escape_done; < } < < backslash_escape_unicode: < /* < * Unicode Excape: < * Take 1-4 hex digits. < */ < if (I0 == 117) { < /* loop, getting characters. Keep a running total in I0 */ < I0 = 0; < while (escape_length <= 4) { < I1 = string_index(INTERP, buffer, start_word + escape_length); < if (I1 >=48 && I1 <=57) { /* 0-9 */ < I0 = I0 * 16 + I1-48; < } else if (I1>=65 && I1<=70) { /* A-Z */ < I0 = I0 * 16 + I1 - 65 + 10; < } else if (I1>=97 && I1<=102) { /* a-z */ < I0 = I0 * 16 + I1 - 97 + 10; < } else { < break; < } < escape_length++; < } < if (escape_length == 1) { < Parrot_call_method(INTERP, P1, word, ConcatChar, "vI", 117); < } else { < Parrot_call_method(INTERP, P1, word, ConcatChar, "vI", I0); < } < goto escape_done; < } --- > /* XXX - here is where the \o, \x, \u escapes will go, pending more > trans-charset joy */ 685c609 < /* A backslash that didn't have any special meaning */ --- > backslash_escape_not: 689c613 < /* skip the escaped char(s)*/ --- > /* skip the escaped char*/