11.5Srillig/* $NetBSD: lsym_period.c,v 1.5 2023/05/11 09:28:53 rillig Exp $ */ 21.1Srillig 31.1Srillig/* 41.1Srillig * Tests for the token lsym_period, which represents '.' in these contexts: 51.1Srillig * 61.1Srillig * In an initializer, '.' starts a named designator (since C99). 71.1Srillig * 81.1Srillig * In an expression, 'sou.member' accesses the member 'member' in the struct 91.1Srillig * or union 'sou'. 101.1Srillig * 111.1Srillig * In a function prototype declaration, the sequence '.' '.' '.' marks the 121.3Srillig * start of a variable number of arguments. It would have been more intuitive 131.3Srillig * to model them as a single token, but it doesn't make any difference for 141.3Srillig * formatting the code. 151.1Srillig * 161.1Srillig * See also: 171.1Srillig * lsym_word.c for '.' inside numeric constants 181.1Srillig */ 191.1Srillig 201.3Srillig/* Designators in an initialization */ 211.4Srillig//indent input 221.3Srilligstruct point { 231.3Srillig int x; 241.3Srillig int y; 251.3Srillig} p = { 261.3Srillig .x = 3, 271.3Srillig .y = 4, 281.3Srillig}; 291.4Srillig//indent end 301.1Srillig 311.4Srillig//indent run-equals-input -di0 321.3Srillig 331.3Srillig 341.3Srillig/* Accessing struct members */ 351.4Srillig//indent input 361.3Srilligtime_t 371.3Srilligget_time(struct stat st) 381.3Srillig{ 391.3Srillig return st.st_mtime > 0 ? st . st_atime : st.st_ctime; 401.3Srillig} 411.4Srillig//indent end 421.3Srillig 431.4Srillig//indent run 441.3Srilligtime_t 451.3Srilligget_time(struct stat st) 461.3Srillig{ 471.3Srillig return st.st_mtime > 0 ? st.st_atime : st.st_ctime; 481.3Srillig} 491.4Srillig//indent end 501.3Srillig 511.5Srillig//indent run-equals-prev-output -Ttime_t 521.5Srillig 531.3Srillig 541.3Srillig/* Varargs in a function declaration */ 551.4Srillig//indent input 561.3Srilligvoid my_printf(const char *, ...); 571.4Srillig//indent end 581.3Srillig 591.4Srillig//indent run-equals-input -di0 60