Mercurial > emacs
comparison src/syntax.c @ 10457:2ab3bd0288a9
Change all occurences of SWITCH_ENUM_BUG to use SWITCH_ENUM_CAST instead.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 18 Jan 1995 20:52:48 +0000 |
parents | f918fd077a9f |
children | e805ef6b931c |
comparison
equal
deleted
inserted
replaced
10456:9c6110615166 | 10457:2ab3bd0288a9 |
---|---|
1 /* GNU Emacs routines to deal with syntax tables; also word and list parsing. | 1 /* GNU Emacs routines to deal with syntax tables; also word and list parsing. |
2 Copyright (C) 1985, 1987, 1993, 1994 Free Software Foundation, Inc. | 2 Copyright (C) 1985, 1987, 1993, 1994, 1995 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GNU Emacs. | 4 This file is part of GNU Emacs. |
5 | 5 |
6 GNU Emacs is free software; you can redistribute it and/or modify | 6 GNU Emacs is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
399 if (comstyle) | 399 if (comstyle) |
400 insert ("b", 1); | 400 insert ("b", 1); |
401 | 401 |
402 insert_string ("\twhich means: "); | 402 insert_string ("\twhich means: "); |
403 | 403 |
404 #ifdef SWITCH_ENUM_BUG | 404 switch (SWITCH_ENUM_CAST (code)) |
405 switch ((int) code) | |
406 #else | |
407 switch (code) | |
408 #endif | |
409 { | 405 { |
410 case Swhitespace: | 406 case Swhitespace: |
411 insert_string ("whitespace"); break; | 407 insert_string ("whitespace"); break; |
412 case Spunct: | 408 case Spunct: |
413 insert_string ("punctuation"); break; | 409 insert_string ("punctuation"); break; |
903 } | 899 } |
904 | 900 |
905 if (SYNTAX_PREFIX (c)) | 901 if (SYNTAX_PREFIX (c)) |
906 continue; | 902 continue; |
907 | 903 |
908 #ifdef SWITCH_ENUM_BUG | 904 switch (SWITCH_ENUM_CAST (code)) |
909 switch ((int) code) | |
910 #else | |
911 switch (code) | |
912 #endif | |
913 { | 905 { |
914 case Sescape: | 906 case Sescape: |
915 case Scharquote: | 907 case Scharquote: |
916 if (from == stop) goto lose; | 908 if (from == stop) goto lose; |
917 from++; | 909 from++; |
920 case Ssymbol: | 912 case Ssymbol: |
921 if (depth || !sexpflag) break; | 913 if (depth || !sexpflag) break; |
922 /* This word counts as a sexp; return at end of it. */ | 914 /* This word counts as a sexp; return at end of it. */ |
923 while (from < stop) | 915 while (from < stop) |
924 { | 916 { |
925 #ifdef SWITCH_ENUM_BUG | 917 switch (SWITCH_ENUM_CAST (SYNTAX (FETCH_CHAR (from)))) |
926 switch ((int) SYNTAX (FETCH_CHAR (from))) | |
927 #else | |
928 switch (SYNTAX (FETCH_CHAR (from))) | |
929 #endif | |
930 { | 918 { |
931 case Scharquote: | 919 case Scharquote: |
932 case Sescape: | 920 case Sescape: |
933 from++; | 921 from++; |
934 if (from == stop) goto lose; | 922 if (from == stop) goto lose; |
999 stringterm = FETCH_CHAR (from - 1); | 987 stringterm = FETCH_CHAR (from - 1); |
1000 while (1) | 988 while (1) |
1001 { | 989 { |
1002 if (from >= stop) goto lose; | 990 if (from >= stop) goto lose; |
1003 if (FETCH_CHAR (from) == stringterm) break; | 991 if (FETCH_CHAR (from) == stringterm) break; |
1004 #ifdef SWITCH_ENUM_BUG | 992 switch (SWITCH_ENUM_CAST (SYNTAX (FETCH_CHAR (from)))) |
1005 switch ((int) SYNTAX (FETCH_CHAR (from))) | |
1006 #else | |
1007 switch (SYNTAX (FETCH_CHAR (from))) | |
1008 #endif | |
1009 { | 993 { |
1010 case Scharquote: | 994 case Scharquote: |
1011 case Sescape: | 995 case Sescape: |
1012 from++; | 996 from++; |
1013 } | 997 } |
1057 } | 1041 } |
1058 | 1042 |
1059 if (SYNTAX_PREFIX (c)) | 1043 if (SYNTAX_PREFIX (c)) |
1060 continue; | 1044 continue; |
1061 | 1045 |
1062 #ifdef SWITCH_ENUM_BUG | 1046 switch (SWITCH_ENUM_CAST (quoted ? Sword : code)) |
1063 switch ((int) (quoted ? Sword : code)) | |
1064 #else | |
1065 switch (quoted ? Sword : code) | |
1066 #endif | |
1067 { | 1047 { |
1068 case Sword: | 1048 case Sword: |
1069 case Ssymbol: | 1049 case Ssymbol: |
1070 if (depth || !sexpflag) break; | 1050 if (depth || !sexpflag) break; |
1071 /* This word counts as a sexp; count object finished after passing it. */ | 1051 /* This word counts as a sexp; count object finished after passing it. */ |
1464 from++; | 1444 from++; |
1465 } | 1445 } |
1466 | 1446 |
1467 if (SYNTAX_PREFIX (FETCH_CHAR (from - 1))) | 1447 if (SYNTAX_PREFIX (FETCH_CHAR (from - 1))) |
1468 continue; | 1448 continue; |
1469 #ifdef SWITCH_ENUM_BUG | 1449 switch (SWITCH_ENUM_CAST (code)) |
1470 switch ((int) code) | |
1471 #else | |
1472 switch (code) | |
1473 #endif | |
1474 { | 1450 { |
1475 case Sescape: | 1451 case Sescape: |
1476 case Scharquote: | 1452 case Scharquote: |
1477 if (stopbefore) goto stop; /* this arg means stop at sexp start */ | 1453 if (stopbefore) goto stop; /* this arg means stop at sexp start */ |
1478 curlevel->last = from - 1; | 1454 curlevel->last = from - 1; |
1486 if (stopbefore) goto stop; /* this arg means stop at sexp start */ | 1462 if (stopbefore) goto stop; /* this arg means stop at sexp start */ |
1487 curlevel->last = from - 1; | 1463 curlevel->last = from - 1; |
1488 symstarted: | 1464 symstarted: |
1489 while (from < end) | 1465 while (from < end) |
1490 { | 1466 { |
1491 #ifdef SWITCH_ENUM_BUG | 1467 switch (SWITCH_ENUM_CAST (SYNTAX (FETCH_CHAR (from)))) |
1492 switch ((int) SYNTAX (FETCH_CHAR (from))) | |
1493 #else | |
1494 switch (SYNTAX (FETCH_CHAR (from))) | |
1495 #endif | |
1496 { | 1468 { |
1497 case Scharquote: | 1469 case Scharquote: |
1498 case Sescape: | 1470 case Sescape: |
1499 from++; | 1471 from++; |
1500 if (from == end) goto endquoted; | 1472 if (from == end) goto endquoted; |
1581 startinstring: | 1553 startinstring: |
1582 while (1) | 1554 while (1) |
1583 { | 1555 { |
1584 if (from >= end) goto done; | 1556 if (from >= end) goto done; |
1585 if (FETCH_CHAR (from) == state.instring) break; | 1557 if (FETCH_CHAR (from) == state.instring) break; |
1586 #ifdef SWITCH_ENUM_BUG | 1558 switch (SWITCH_ENUM_CAST (SYNTAX (FETCH_CHAR (from)))) |
1587 switch ((int) SYNTAX (FETCH_CHAR (from))) | |
1588 #else | |
1589 switch (SYNTAX (FETCH_CHAR (from))) | |
1590 #endif | |
1591 { | 1559 { |
1592 case Scharquote: | 1560 case Scharquote: |
1593 case Sescape: | 1561 case Sescape: |
1594 from++; | 1562 from++; |
1595 startquotedinstring: | 1563 startquotedinstring: |