Mercurial > emacs
comparison src/syntax.c @ 110533:b799d38f522a
Merge changes from emacs-23 branch
| author | Chong Yidong <cyd@stupidchicken.com> |
|---|---|
| date | Thu, 23 Sep 2010 15:00:31 -0400 |
| parents | 818e325e0469 2d0eee1a24b9 |
| children | f28cc7ff91f9 |
comparison
equal
deleted
inserted
replaced
| 110506:2cac83f5f8bc | 110533:b799d38f522a |
|---|---|
| 557 that determines quote parity to the comment-end. */ | 557 that determines quote parity to the comment-end. */ |
| 558 while (from != stop) | 558 while (from != stop) |
| 559 { | 559 { |
| 560 int temp_byte, prev_syntax; | 560 int temp_byte, prev_syntax; |
| 561 int com2start, com2end; | 561 int com2start, com2end; |
| 562 int comstart; | |
| 562 | 563 |
| 563 /* Move back and examine a character. */ | 564 /* Move back and examine a character. */ |
| 564 DEC_BOTH (from, from_byte); | 565 DEC_BOTH (from, from_byte); |
| 565 UPDATE_SYNTAX_TABLE_BACKWARD (from); | 566 UPDATE_SYNTAX_TABLE_BACKWARD (from); |
| 566 | 567 |
| 576 == SYNTAX_FLAGS_COMMENT_STYLE (prev_syntax, syntax)) | 577 == SYNTAX_FLAGS_COMMENT_STYLE (prev_syntax, syntax)) |
| 577 && (SYNTAX_FLAGS_COMMENT_NESTED (prev_syntax) | 578 && (SYNTAX_FLAGS_COMMENT_NESTED (prev_syntax) |
| 578 || SYNTAX_FLAGS_COMMENT_NESTED (syntax)) == comnested); | 579 || SYNTAX_FLAGS_COMMENT_NESTED (syntax)) == comnested); |
| 579 com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax) | 580 com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax) |
| 580 && SYNTAX_FLAGS_COMEND_SECOND (prev_syntax)); | 581 && SYNTAX_FLAGS_COMEND_SECOND (prev_syntax)); |
| 581 | 582 comstart = (com2start || code == Scomment); |
| 583 | |
| 582 /* Nasty cases with overlapping 2-char comment markers: | 584 /* Nasty cases with overlapping 2-char comment markers: |
| 583 - snmp-mode: -- c -- foo -- c -- | 585 - snmp-mode: -- c -- foo -- c -- |
| 584 --- c -- | 586 --- c -- |
| 585 ------ c -- | 587 ------ c -- |
| 586 - c-mode: *||* | 588 - c-mode: *||* |
| 587 |* *|* *| | 589 |* *|* *| |
| 588 |*| |* |*| | 590 |*| |* |*| |
| 589 /// */ | 591 /// */ |
| 590 | 592 |
| 591 /* If a 2-char comment sequence partly overlaps with another, | 593 /* If a 2-char comment sequence partly overlaps with another, |
| 592 we don't try to be clever. */ | 594 we don't try to be clever. E.g. |*| in C, or }% in modes that |
| 593 if (from > stop && (com2end || com2start)) | 595 have %..\n and %{..}%. */ |
| 596 if (from > stop && (com2end || comstart)) | |
| 594 { | 597 { |
| 595 int next = from, next_byte = from_byte, next_c, next_syntax; | 598 int next = from, next_byte = from_byte, next_c, next_syntax; |
| 596 DEC_BOTH (next, next_byte); | 599 DEC_BOTH (next, next_byte); |
| 597 UPDATE_SYNTAX_TABLE_BACKWARD (next); | 600 UPDATE_SYNTAX_TABLE_BACKWARD (next); |
| 598 next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte); | 601 next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte); |
| 599 next_syntax = SYNTAX_WITH_FLAGS (next_c); | 602 next_syntax = SYNTAX_WITH_FLAGS (next_c); |
| 600 if (((com2start || comnested) | 603 if (((comstart || comnested) |
| 601 && SYNTAX_FLAGS_COMEND_SECOND (syntax) | 604 && SYNTAX_FLAGS_COMEND_SECOND (syntax) |
| 602 && SYNTAX_FLAGS_COMEND_FIRST (next_syntax)) | 605 && SYNTAX_FLAGS_COMEND_FIRST (next_syntax)) |
| 603 || ((com2end || comnested) | 606 || ((com2end || comnested) |
| 604 && SYNTAX_FLAGS_COMSTART_SECOND (syntax) | 607 && SYNTAX_FLAGS_COMSTART_SECOND (syntax) |
| 605 && (comstyle | 608 && (comstyle |
