From: Wei Liu Subject: Re: [PATCH v6 20/23] libxlu: record line and column number when parsing values Date: Fri, 6 Mar 2015 16:11:53 +0000 Message-ID: <20150306161153.GA12103@zion.uk.xensource.com> References: <1424966166-2388-1-git-send-email-wei.liu2@citrix.com> <1424966166-2388-21-git-send-email-wei.liu2@citrix.com> <21753.37155.743889.586465@mariner.uk.xensource.com> <20150306120313.GK12103@zion.uk.xensource.com> <21753.47619.246050.202800@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <21753.47619.246050.202800@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Wei Liu , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Mar 06, 2015 at 02:30:27PM +0000, Ian Jackson wrote: > Wei Liu writes ("Re: [PATCH v6 20/23] libxlu: record line and column number when parsing values"): > > Ack. This is how it looks like now. The changes are > > > > 1. Use YYLTYPE instead of line and column. > > This is better but why not have YYLTYPE inside XLU_ConfigValue ? > That appears to cause some kind of circular inclusion problem. I will see what I can do. > > 2. Handle empty rule inside list_mk and string_mk (that is when YYLTYPE > > points to NULL) > > I hadn't spotted this in the previous patch. Why not use `yyloc', the > location of the lookahead token ? > I think you mean yylloc. yyloc is internal variable. > > + if (loc) { > > + value->line = loc->first_line; > > + value->column = loc->first_column; > > + } else > > + value->line = value->column = 0; > > This code appears twice. > If I use yylloc (or yyloc) this hunk will just be gone. Wei. > Thanks, > Ian.