Changeset 324
- Timestamp:
- 02/02/07 16:35:22 (2 years ago)
- Files:
-
- trunk/Perian.xcodeproj/project.pbxproj (modified) (1 diff)
- trunk/SSATagParsing.m.rl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Perian.xcodeproj/project.pbxproj
r315 r324 257 257 "$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).dot", 258 258 ); 259 script = "RAGEL=${PROJECT_DIR}/ragel\nRLCODEGEN=${PROJECT_DIR}/rlcodegen\n${RAGEL} -o ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.ragel ${INPUT_FILE_PATH} || exit\n${RLCODEGEN} -T1 -o ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE} ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.ragel || exit\n${RLCODEGEN} -V ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.ragel > ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.dot";259 script = "RAGEL=${PROJECT_DIR}/ragel\nRLCODEGEN=${PROJECT_DIR}/rlcodegen\n${RAGEL} ${INPUT_FILE_PATH} | ${RLCODEGEN} -T1 -o ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE} || exit\n#${RLCODEGEN} -V ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.ragel > ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.dot"; 260 260 }; 261 261 /* End PBXBuildRule section */ trunk/SSATagParsing.m.rl
r317 r324 75 75 76 76 return (ATSURGBAlphaColor){r/255.,g/255.,b/255.,a}; 77 } 78 79 static void PruneEmptyStyleSpans(SSARenderEntity *re) 80 { 81 SSAStyleSpan *styles_new[re->style_count]; 82 size_t style_count_new = 0; 83 int i; 84 85 for (i = 0; i < re->style_count; i++) { 86 if (re->styles[i]->range.length == 0) { 87 [re->styles[i] release]; 88 } else { 89 styles_new[style_count_new++] = re->styles[i]; 90 } 91 } 92 93 if (style_count_new != re->style_count) { 94 re->styles = realloc(re->styles, sizeof(SSAStyleSpan*) * style_count_new); 95 memcpy(re->styles, styles_new, sizeof(SSAStyleSpan*) * style_count_new); 96 97 re->style_count = style_count_new; 98 } 77 99 } 78 100 … … 374 396 } 375 397 376 flag = [01]? > {flag = 1;} % {flag = *(p-1) - '0';};398 flag = ([01] % {unichar fl = *(p-1); if (flag == '0' || flag == '1') flag = fl - '0';})? > {flag = 1;}; 377 399 num_ = digit+ ('.' digit*)?; 378 400 num = num_ > {numbegin = p;} % {num = [[NSString stringWithCharacters:numbegin length:p-numbegin] doubleValue];}; … … 400 422 ); 401 423 402 cmd = "\\" cmd_specific;403 404 tag = "{" cmd*"}";424 cmd = "\\" cmd_specific ; 425 426 tag = "{" ((cmd*) | ([^\\}]*)) "}"; 405 427 406 428 nl = "\\" [Nn]; … … 417 439 %%write eof; 418 440 441 if (re->text[len-1] == '}') skipbegin = p; // make up for how exit_tag isn't called if the } is the last char in the line 442 419 443 end_re; 420 for (j=0;j < re->style_count; j++) 421 if (re->styles[j]->range.length == 0) { 422 [re->styles[j] release]; 423 if (j != re->style_count-1) re->styles[j] = re->styles[j+1]; 424 re->style_count--; 425 } 444 445 PruneEmptyStyleSpans(re); 426 446 427 447 free(pb);
