1 1.5 rillig /* $NetBSD: opt_T.c,v 1.5 2023/06/17 22:09:24 rillig Exp $ */ 2 1.1 rillig 3 1.2 rillig /* 4 1.2 rillig * Tests for the option '-T', which specifies a single identifier that indent 5 1.2 rillig * will recognize as a type name. This affects the formatting of 6 1.2 rillig * syntactically ambiguous expressions that could be casts or multiplications, 7 1.2 rillig * among others. 8 1.2 rillig */ 9 1.2 rillig 10 1.4 rillig //indent input 11 1.2 rillig int cast = (custom_type_name) * arg; 12 1.2 rillig 13 1.2 rillig int mult = (unknown_type_name) * arg; 14 1.2 rillig 15 1.2 rillig /* See the option -ta for handling these types. */ 16 1.2 rillig int suff = (unknown_type_name_t) * arg; 17 1.4 rillig //indent end 18 1.1 rillig 19 1.4 rillig //indent run -Tcustom_type_name -di0 20 1.2 rillig int cast = (custom_type_name)*arg; 21 1.2 rillig 22 1.2 rillig int mult = (unknown_type_name) * arg; 23 1.2 rillig 24 1.2 rillig /* See the option -ta for handling these types. */ 25 1.2 rillig int suff = (unknown_type_name_t) * arg; 26 1.4 rillig //indent end 27 1.2 rillig 28 1.4 rillig //indent run -Tcustom_type_name -di0 -cs 29 1.2 rillig int cast = (custom_type_name) *arg; 30 1.2 rillig 31 1.2 rillig int mult = (unknown_type_name) * arg; 32 1.2 rillig 33 1.2 rillig /* See the option -ta for handling these types. */ 34 1.2 rillig int suff = (unknown_type_name_t) * arg; 35 1.4 rillig //indent end 36 1.5 rillig 37 1.5 rillig 38 1.5 rillig /* 39 1.5 rillig * The keyword table has precedence over the custom-specified types; otherwise, 40 1.5 rillig * the following lines would be declarations, and the declarators would be 41 1.5 rillig * indented by 16. 42 1.5 rillig */ 43 1.5 rillig //indent input 44 1.5 rillig { 45 1.5 rillig break x; 46 1.5 rillig continue x; 47 1.5 rillig goto x; 48 1.5 rillig return x; 49 1.5 rillig } 50 1.5 rillig //indent end 51 1.5 rillig 52 1.5 rillig //indent run-equals-input -Tbreak -Tcontinue -Tgoto -Treturn 53