lsym_rparen_or_rbracket.c revision 1.7
1/* $NetBSD: lsym_rparen_or_rbracket.c,v 1.7 2023/06/16 14:12:10 rillig Exp $ */ 2 3/* 4 * Tests for the token lsym_rparen_or_lbracket, which represents ')' or ']', 5 * the counterparts for '(' and '['. 6 * 7 * See also: 8 * lsym_lparen_or_lbracket.c 9 */ 10 11//indent input 12int var = (3); 13int cast = (int)3; 14int cast = (int)(3); 15int call = function(3); 16int array[3] = {1, 2, 3}; 17int array[3] = {[2] = 3}; 18//indent end 19 20//indent run-equals-input -di0 21 22 23//indent input 24int a = array[ 253 26]; 27{ 28int a = array[ 293 30]; 31} 32//indent end 33 34//indent run -di0 35int a = array[ 36 3 37]; 38{ 39 int a = array[ 40 3 41// $ FIXME: Should be one level to the left since it is the outermost bracket. 42 ]; 43} 44//indent end 45 46//indent run -di0 -nlp 47int a = array[ 48 3 49]; 50{ 51 int a = array[ 52 3 53// $ FIXME: Should be one level to the left since it is the outermost bracket. 54 ]; 55} 56//indent end 57 58 59//indent input 60{ 61 dcs_align((u_int)dcs); 62 mpools.pools[i] = (memory_pool){NULL, 0, 0}; 63 list_add(l, (const char[3]){'-', (char)c, '\0'}); 64} 65//indent end 66 67//indent run -ci4 -di0 -nlp 68{ 69 dcs_align((u_int)dcs); 70// $ FIXME: Don't add newlines. 71 mpools.pools[i] = (memory_pool) { 72 NULL, 0, 0 73 }; 74 list_add(l, (const char[3]){'-', (char)c, '\0'}); 75} 76//indent end 77