From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q8ReZ-0004u6-Vt for garchives@archives.gentoo.org; Sat, 09 Apr 2011 06:28:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1A1361C01F; Sat, 9 Apr 2011 06:27:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D77961C01F for ; Sat, 9 Apr 2011 06:27:37 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6C6461B4063 for ; Sat, 9 Apr 2011 06:27:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C379D8006A for ; Sat, 9 Apr 2011 06:27:36 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: <149d235bfa4aff7fdbdca9b8a5f1b3fc5b493f34.betelgeuse@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: bashast/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/bashast.g X-VCS-Directories: bashast/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 149d235bfa4aff7fdbdca9b8a5f1b3fc5b493f34 Date: Sat, 9 Apr 2011 06:27:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 717b5f6d2e152f7d2bb430f822d5ede2 commit: 149d235bfa4aff7fdbdca9b8a5f1b3fc5b493f34 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Fri Apr 8 19:07:54 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Sat Apr 9 06:13:53 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D149d235b Remove backtracking for arg rule Add syntactic predicates to remove the need to backtrack when evaluation the arg rule. --- bashast/bashast.g | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 5214b65..ec04917 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -109,11 +109,12 @@ simple_command bash_command : fname_no_res_word (BLANK+ arg)* -> ^(COMMAND fname_no_res_word arg*); //An argument to a command +//fname can also match var_ref and command_sub but that gives a noisier = AST arg - : var_ref - | fname - | command_sub - | var_ref; +options{backtrack=3Dfalse;} + : (var_ref) =3D> var_ref + | (command_sub) =3D> command_sub + | fname; redirect: BLANK!* here_string_op^ BLANK!* fname | BLANK!* here_doc_op^ BLANK!* fname EOL! heredoc | BLANK* redir_op BLANK* redir_dest -> ^(REDIR redir_op redir_dest)