Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feed.news.qwest.net!mpls-nntp-06.inet.qwest.net!216.196.98.145.MISMATCH!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end From: Stefan Monnier Newsgroups: comp.compilers Subject: Re: Ignore break line sometimes Date: Sun, 12 Feb 2012 10:48:20 -0500 Organization: Compilers Central Lines: 10 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <12-02-016@comp.compilers> References: <12-02-010@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1329081285 18205 64.57.183.58 (12 Feb 2012 21:14:45 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sun, 12 Feb 2012 21:14:45 +0000 (UTC) Keywords: parse Posted-Date: 12 Feb 2012 16:14:45 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:456 > So, in the first line, the '\n' after 'then' isn't important, but in the > second "foo();" could replace the need of the semicolon to conclude the > statement, or still, in the 'end'. A simple approach is to treat every newline as a semi-colon, and then to adapt your grammar so as to accept (and ignore) extra semi-colons. I.e. accept "if true then; foo(); ; end; ;" Stefan