From owner-svn-src-all@freebsd.org Sun Jun 3 19:05:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91EA0FEE134; Sun, 3 Jun 2018 19:05:22 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42F4C75E4B; Sun, 3 Jun 2018 19:05:22 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2069A22A2E; Sun, 3 Jun 2018 19:05:22 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53J5L7t063220; Sun, 3 Jun 2018 19:05:21 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53J5LWg063216; Sun, 3 Jun 2018 19:05:21 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031905.w53J5LWg063216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 19:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334583 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 334583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 19:05:22 -0000 Author: pstef Date: Sun Jun 3 19:05:20 2018 New Revision: 334583 URL: https://svnweb.freebsd.org/changeset/base/334583 Log: indent(1): if an identifier can be either a typedef name or as a struct member, it is taken as the latter Modified: head/usr.bin/indent/lexi.c head/usr.bin/indent/tests/parens.0 head/usr.bin/indent/tests/parens.0.pro head/usr.bin/indent/tests/parens.0.stdout Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 18:39:13 2018 (r334582) +++ head/usr.bin/indent/lexi.c Sun Jun 3 19:05:20 2018 (r334583) @@ -321,6 +321,10 @@ lexi(struct parser_state *state) /* inside parens: cast, param list, offsetof or sizeof */ state->cast_mask |= (1 << state->p_l_follow) & ~state->not_cast_mask; } + if (state->last_token == period || state->last_token == unary_op) { + state->keyword = 0; + break; + } if (p != NULL && p->rwcode == 3) return (structure); if (state->p_l_follow) Modified: head/usr.bin/indent/tests/parens.0 ============================================================================== --- head/usr.bin/indent/tests/parens.0 Sun Jun 3 18:39:13 2018 (r334582) +++ head/usr.bin/indent/tests/parens.0 Sun Jun 3 19:05:20 2018 (r334583) @@ -21,4 +21,7 @@ test(void) char *xxx = firstf(secondf2(p1, p2)); } + + rb->allocfunc(1); + rb2.allocfunc(7); } Modified: head/usr.bin/indent/tests/parens.0.pro ============================================================================== --- head/usr.bin/indent/tests/parens.0.pro Sun Jun 3 18:39:13 2018 (r334582) +++ head/usr.bin/indent/tests/parens.0.pro Sun Jun 3 19:05:20 2018 (r334583) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ --ts4 -i4 -di12 +-ts4 -i4 -di12 -Tallocfunc Modified: head/usr.bin/indent/tests/parens.0.stdout ============================================================================== --- head/usr.bin/indent/tests/parens.0.stdout Sun Jun 3 18:39:13 2018 (r334582) +++ head/usr.bin/indent/tests/parens.0.stdout Sun Jun 3 19:05:20 2018 (r334583) @@ -21,4 +21,7 @@ test(void) char *xxx = firstf(secondf2(p1, p2)); } + + rb->allocfunc(1); + rb2.allocfunc(7); }