public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-26 13:38 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-26 13:38 UTC (permalink / raw
  To: gentoo-commits

commit:     c917cc0e1580a6f22a829e3399716197b9178608
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 22 10:59:18 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun Jun 26 14:06:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=c917cc0e

Build: relax antlr timeout limit

The CI server cannot do k=1 for some decisions in less than 1 second.
Now the limit is relaxed.

---
 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6d2c53d..689c6dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -299,7 +299,7 @@ EXTRA_DIST = bashast/bashast.g \
 coding_standard.pdf: coding_standard/coding_standard.tex
 	$(AM_V_GEN)@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
 
-ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool
+ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool -Xconversiontimeout 5000
 
 cgrammar.run: libbash.g
 	$(AM_V_at)touch $@.tmp



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2012-08-19 14:54 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2012-08-19 14:54 UTC (permalink / raw
  To: gentoo-commits

commit:     a6de545c440ed82f16ccf12cf229efc99ecd7ec7
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sun Aug 19 14:49:11 2012 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun Aug 19 14:49:11 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=a6de545c

Merge remote-tracking branch 'aparicio/multiline_string_declaration'


 bashast/bashast.g              |   10 +++++++++-
 scripts/command_execution.bash |   15 +++++++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)


^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2012-06-03  9:08 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2012-06-03  9:08 UTC (permalink / raw
  To: gentoo-commits

commit:     4a3e50aeab5a388eb552d0003a64d891db7e95a4
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  5 07:45:19 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Aug  5 07:45:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=4a3e50ae

Build: add more information to libbash.pc.in

---
 libbash.pc.in |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libbash.pc.in b/libbash.pc.in
index c312986..792e815 100644
--- a/libbash.pc.in
+++ b/libbash.pc.in
@@ -5,6 +5,9 @@ includedir=@includedir@
 
 Name: libbash
 Description: A C++ library for bash
+URL: http://www.gentoo.org/proj/en/libbash/index.xml
 Requires:
 Version: @PACKAGE_VERSION@
 Cflags: -I${includedir}/libbash-@PACKAGE_VERSION@
+Libs: -L${libdir} -lbash
+Libs.private: -L${libdir} -lantlr3c



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-08-04 14:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-08-04 14:24 UTC (permalink / raw
  To: gentoo-commits

commit:     734bcb7e60bb83a75e0542ebeaac28f00bf03f97
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  4 08:39:29 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 14:15:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=734bcb7e

Doc: remove useless doxample.am

---
 doxample.am |  186 -----------------------------------------------------------
 1 files changed, 0 insertions(+), 186 deletions(-)

diff --git a/doxample.am b/doxample.am
deleted file mode 100644
index 420049e..0000000
--- a/doxample.am
+++ /dev/null
@@ -1,186 +0,0 @@
-# Copyright (C) 2004 Oren Ben-Kiki
-# This file is distributed under the same terms as the Automake macro files.
-
-# Generate automatic documentation using Doxygen. Goals and variables values
-# are controlled by the various DX_COND_??? conditionals set by autoconf.
-#
-# The provided goals are:
-# doxygen-doc: Generate all doxygen documentation.
-# doxygen-run: Run doxygen, which will generate some of the documentation
-#              (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post
-#              processing required for the rest of it (PS, PDF, and some MAN).
-# doxygen-man: Rename some doxygen generated man pages.
-# doxygen-ps: Generate doxygen PostScript documentation.
-# doxygen-pdf: Generate doxygen PDF documentation.
-#
-# Note that by default these are not integrated into the automake goals. If
-# doxygen is used to generate man pages, you can achieve this integration by
-# setting man3_MANS to the list of man pages generated and then adding the
-# dependency:
-#
-#   $(man3_MANS): doxygen-doc
-#
-# This will cause make to run doxygen and generate all the documentation.
-#
-# The following variable is intended for use in Makefile.am:
-#
-# DX_CLEANFILES = everything to clean.
-#
-# This is usually added to MOSTLYCLEANFILES.
-
-## --------------------------------- ##
-## Format-independent Doxygen rules. ##
-## --------------------------------- ##
-
-if DX_COND_doc
-
-## ------------------------------- ##
-## Rules specific for HTML output. ##
-## ------------------------------- ##
-
-if DX_COND_html
-
-DX_CLEAN_HTML = @DX_DOCDIR@/html
-
-endif DX_COND_html
-
-## ------------------------------ ##
-## Rules specific for CHM output. ##
-## ------------------------------ ##
-
-if DX_COND_chm
-
-DX_CLEAN_CHM = @DX_DOCDIR@/chm
-
-if DX_COND_chi
-
-DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi
-
-endif DX_COND_chi
-
-endif DX_COND_chm
-
-## ------------------------------ ##
-## Rules specific for MAN output. ##
-## ------------------------------ ##
-
-if DX_COND_man
-
-DX_CLEAN_MAN = @DX_DOCDIR@/man
-
-endif DX_COND_man
-
-## ------------------------------ ##
-## Rules specific for RTF output. ##
-## ------------------------------ ##
-
-if DX_COND_rtf
-
-DX_CLEAN_RTF = @DX_DOCDIR@/rtf
-
-endif DX_COND_rtf
-
-## ------------------------------ ##
-## Rules specific for XML output. ##
-## ------------------------------ ##
-
-if DX_COND_xml
-
-DX_CLEAN_XML = @DX_DOCDIR@/xml
-
-endif DX_COND_xml
-
-## ----------------------------- ##
-## Rules specific for PS output. ##
-## ----------------------------- ##
-
-if DX_COND_ps
-
-DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps
-
-DX_PS_GOAL = doxygen-ps
-
-doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps
-
-@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag
-	cd @DX_DOCDIR@/latex; \
-	rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
-	$(DX_LATEX) refman.tex; \
-	$(MAKEINDEX_PATH) refman.idx; \
-	$(DX_LATEX) refman.tex; \
-	countdown=5; \
-	while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
-	                  refman.log > /dev/null 2>&1 \
-	   && test $$countdown -gt 0; do \
-	    $(DX_LATEX) refman.tex; \
-	    countdown=`expr $$countdown - 1`; \
-	done; \
-	$(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi
-
-endif DX_COND_ps
-
-## ------------------------------ ##
-## Rules specific for PDF output. ##
-## ------------------------------ ##
-
-if DX_COND_pdf
-
-DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf
-
-DX_PDF_GOAL = doxygen-pdf
-
-doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf
-
-@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag
-	cd @DX_DOCDIR@/latex; \
-	rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
-	$(DX_PDFLATEX) refman.tex; \
-	$(DX_MAKEINDEX) refman.idx; \
-	$(DX_PDFLATEX) refman.tex; \
-	countdown=5; \
-	while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
-	                  refman.log > /dev/null 2>&1 \
-	   && test $$countdown -gt 0; do \
-	    $(DX_PDFLATEX) refman.tex; \
-	    countdown=`expr $$countdown - 1`; \
-	done; \
-	mv refman.pdf ../@PACKAGE@.pdf
-
-endif DX_COND_pdf
-
-## ------------------------------------------------- ##
-## Rules specific for LaTeX (shared for PS and PDF). ##
-## ------------------------------------------------- ##
-
-if DX_COND_latex
-
-DX_CLEAN_LATEX = @DX_DOCDIR@/latex
-
-endif DX_COND_latex
-
-.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
-
-.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
-
-doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag
-
-doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
-
-@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS)
-	rm -rf @DX_DOCDIR@
-	$(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
-
-DX_CLEANFILES = \
-    @DX_DOCDIR@/@PACKAGE@.tag \
-    -r \
-    $(DX_CLEAN_HTML) \
-    $(DX_CLEAN_CHM) \
-    $(DX_CLEAN_CHI) \
-    $(DX_CLEAN_MAN) \
-    $(DX_CLEAN_RTF) \
-    $(DX_CLEAN_XML) \
-    $(DX_CLEAN_PS) \
-    $(DX_CLEAN_PDF) \
-    $(DX_CLEAN_LATEX)
-
-endif DX_COND_doc



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-08-04 14:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-08-04 14:24 UTC (permalink / raw
  To: gentoo-commits

commit:     fb007eba7449cf3c7d49530002f7b6706dcb0025
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  4 07:01:30 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 14:15:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=fb007eba

Doc: update README

---
 README |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/README b/README
index 8e00feb..b3ca119 100644
--- a/README
+++ b/README
@@ -25,6 +25,12 @@ bashast/gunit: Grammar gunit tests
 src/: source directory for libbash library
 src/builtins: source directory for built in bash functionality classes
 src/builtins/tests: Unit tests for builtins
+src/core: core runtime for libbash
+src/core/tests: Unit tests for the core runtime
+include/: public headers
+utils/: some utilities that built on libbash
+test/: some general tests for libbash
+scripts/: some bash scripts or ebuilds for testing
 coding_standard/: LaTeX coding standard for the project
 docs/: output folder for Doxygen generated documentation
 
@@ -42,3 +48,9 @@ To generate the coding standard from the latex file (with pdflatex):
 	make coding_standard.pdf
 To generate the doxygen documentation:
 	make doxygen-doc
+To get memory usage statstics of libbash (with Valgrind):
+	make massif
+To get benchmark data for metadata generation (with Valgrind):
+	make benchmark_parser
+To get unit tests coverage:
+	make test_coverage



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-08-04 14:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-08-04 14:24 UTC (permalink / raw
  To: gentoo-commits

commit:     e8f6cef956b5b1b5c5b4a68dbecc52a021cec28b
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  4 07:45:38 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 14:15:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=e8f6cef9

Doc: hide undocumented classes and members

---
 Doxyfile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Doxyfile b/Doxyfile
index a062f24..8ed80b5 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -337,14 +337,14 @@ EXTRACT_ANON_NSPACES   = NO
 # various overviews, but no documentation section is generated.
 # This option has no effect if EXTRACT_ALL is enabled.
 
-HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_MEMBERS     = YES
 
 # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
 # undocumented classes that are normally visible in the class hierarchy.
 # If set to NO (the default) these classes will be included in the various
 # overviews. This option has no effect if EXTRACT_ALL is enabled.
 
-HIDE_UNDOC_CLASSES     = NO
+HIDE_UNDOC_CLASSES     = YES
 
 # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
 # friend (class|struct|union) declarations.



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-08-04 14:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-08-04 14:24 UTC (permalink / raw
  To: gentoo-commits

commit:     98a8eb47739b8b9f1182ec3d2867fa425e10fd1c
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  3 11:01:44 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 14:15:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=98a8eb47

Build: add ABI version

---
 Makefile.am  |    1 +
 configure.ac |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 63cabda..9a11e03 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -287,6 +287,7 @@ libbash_la_CXXFLAGS += -Wconversion -Wsign-conversion
 endif
 libbash_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
 libbash_la_LIBADD = libparser.la libwalker.la
+libbash_la_LDFLAGS = -version-info $(LIBBASH_SO_VERSION)
 
 EXTRA_DIST = bashast/bashast.g \
 			 bashast/libbashWalker.g \

diff --git a/configure.ac b/configure.ac
index c5bbbb1..c05d21d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,7 @@ AM_INIT_AUTOMAKE([foreign parallel-tests color-tests subdir-objects 1.11])
 AM_SILENT_RULES([yes])
 AC_PROG_CXX
 LT_INIT
+AC_SUBST([LIBBASH_SO_VERSION], [0:0:0])
 
 AC_ARG_ENABLE([developer],
 			  [AS_HELP_STRING([--enable-developer],[enables various QA checks])])



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-08-04 14:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-08-04 14:24 UTC (permalink / raw
  To: gentoo-commits

commit:     3dae01d081e51749741d4d3e2d391b54c5bb2e0a
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  3 10:48:19 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 14:15:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=3dae01d0

Build: rename libcppbash to libbash

It's weird if we have one name for our project and another name for the
.so file. Now the name is unified.

---
 Makefile.am |  134 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 67 insertions(+), 67 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1f48eca..63cabda 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -111,7 +111,7 @@ cppunittests_SOURCES =  test/run_tests.cpp \
 						test/post_check.cpp \
 						test/api_test.cpp \
 						test/walker_test.cpp
-cppunittests_LDADD = libcppbash.la \
+cppunittests_LDADD = libbash.la \
 					 $(GTEST_LIBS) \
 					 $(BOOST_SYSTEM_LIB) \
 					 $(BOOST_FILESYSTEM_LIB)
@@ -128,14 +128,14 @@ libmetadata_a_CPPFLAGS = $(AM_CPPFLAGS) -Iutils
 noinst_PROGRAMS = variable_printer metadata_generator ast_printer instruo bash
 
 variable_printer_SOURCES = utils/variable_printer.cpp
-variable_printer_LDADD = libcppbash.la
+variable_printer_LDADD = libbash.la
 
 bash_SOURCES = utils/bash.cpp test/test.h  test/test.cpp
-bash_LDADD = libcppbash.la
+bash_LDADD = libbash.la
 bash_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/test/
 
 metadata_generator_SOURCES = utils/metadata_generator.cpp
-metadata_generator_LDADD = libcppbash.la libmetadata.a
+metadata_generator_LDADD = libbash.la libmetadata.a
 metadata_generator_CPPFLAGS = $(AM_CPPFLAGS) -Iutils
 
 instruo_SOURCES = utils/instruo.cpp \
@@ -143,12 +143,12 @@ instruo_SOURCES = utils/instruo.cpp \
 				  utils/command_line.h \
 				  test/test.h \
 				  test/test.cpp
-instruo_LDADD = libcppbash.la @PALUDIS_LIBS@ libmetadata.a
+instruo_LDADD = libbash.la @PALUDIS_LIBS@ libmetadata.a
 instruo_CPPFLAGS = $(AM_CPPFLAGS) @PALUDIS_CFLAGS@ -Iutils -I$(top_srcdir)/test/
 instruo_CXXFLAGS = $(AM_CXXFLAGS) -Wno-extra -fopenmp
 
 ast_printer_SOURCES = utils/ast_printer.cpp
-ast_printer_LDADD = libcppbash.la $(BOOST_PROGRAM_OPTIONS_LIB)
+ast_printer_LDADD = libbash.la $(BOOST_PROGRAM_OPTIONS_LIB)
 ast_printer_LDFLAGS = -static
 # boost is probably compiled without debug STL so if that is used
 # linking will fail
@@ -199,63 +199,63 @@ libbash_include_HEADERS = include/libbash.h \
                           include/unsupported_exception.h \
                           include/exceptions.h
 
-lib_LTLIBRARIES = libcppbash.la
-libcppbash_la_SOURCES = include/common.h \
-						include/libbash.h \
-						src/libbash.cpp \
-						src/cppbash_builtin.cpp \
-						src/cppbash_builtin.h \
-						src/builtins/continue_builtin.cpp \
-						src/builtins/continue_builtin.h \
-						src/builtins/break_builtin.cpp \
-						src/builtins/break_builtin.h \
-						src/builtins/echo_builtin.cpp \
-						src/builtins/echo_builtin.h \
-						src/builtins/eval_builtin.cpp \
-						src/builtins/eval_builtin.h \
-						src/builtins/export_builtin.cpp \
-						src/builtins/export_builtin.h \
-						src/builtins/local_builtin.cpp \
-						src/builtins/local_builtin.h \
-						src/builtins/declare_builtin.cpp \
-						src/builtins/declare_builtin.h \
-						src/builtins/boolean_builtins.h \
-						src/builtins/source_builtin.h \
-						src/builtins/source_builtin.cpp \
-						src/builtins/shift_builtin.h \
-						src/builtins/shift_builtin.cpp \
-						src/builtins/shopt_builtin.h \
-						src/builtins/shopt_builtin.cpp \
-						src/builtins/return_builtin.h \
-						src/builtins/return_builtin.cpp \
-						src/builtins/printf_builtin.h \
-						src/builtins/printf_builtin.cpp \
-						src/builtins/let_builtin.h \
-						src/builtins/let_builtin.cpp \
-						src/builtins/inherit_builtin.h \
-						src/builtins/inherit_builtin.cpp \
-						src/builtins/unset_builtin.h \
-						src/builtins/unset_builtin.cpp \
-						src/builtins/builtin_exceptions.h \
-						$(GENERATED_PARSER_C) \
-						$(GENERATED_PARSER_H) \
-						include/divide_by_zero_error.h \
-						include/exceptions.h \
-						include/illegal_argument_exception.h \
-						include/interpreter_exception.h \
-						include/parse_exception.h \
-						include/readonly_exception.h \
-						include/runtime_exception.h \
-						include/unsupported_exception.h \
-						src/core/interpreter.cpp \
-						src/core/interpreter.h \
-						src/core/symbols.hpp \
-						src/core/function.h \
-						src/core/function.cpp \
-						src/core/bash_condition.h \
-						src/core/bash_condition.cpp \
-						src/core/bash_ast.cpp \
-						src/core/bash_ast.h
+lib_LTLIBRARIES = libbash.la
+libbash_la_SOURCES = include/common.h \
+					 include/libbash.h \
+					 src/libbash.cpp \
+					 src/cppbash_builtin.cpp \
+					 src/cppbash_builtin.h \
+					 src/builtins/continue_builtin.cpp \
+					 src/builtins/continue_builtin.h \
+					 src/builtins/break_builtin.cpp \
+					 src/builtins/break_builtin.h \
+					 src/builtins/echo_builtin.cpp \
+					 src/builtins/echo_builtin.h \
+					 src/builtins/eval_builtin.cpp \
+					 src/builtins/eval_builtin.h \
+					 src/builtins/export_builtin.cpp \
+					 src/builtins/export_builtin.h \
+					 src/builtins/local_builtin.cpp \
+					 src/builtins/local_builtin.h \
+					 src/builtins/declare_builtin.cpp \
+					 src/builtins/declare_builtin.h \
+					 src/builtins/boolean_builtins.h \
+					 src/builtins/source_builtin.h \
+					 src/builtins/source_builtin.cpp \
+					 src/builtins/shift_builtin.h \
+					 src/builtins/shift_builtin.cpp \
+					 src/builtins/shopt_builtin.h \
+					 src/builtins/shopt_builtin.cpp \
+					 src/builtins/return_builtin.h \
+					 src/builtins/return_builtin.cpp \
+					 src/builtins/printf_builtin.h \
+					 src/builtins/printf_builtin.cpp \
+					 src/builtins/let_builtin.h \
+					 src/builtins/let_builtin.cpp \
+					 src/builtins/inherit_builtin.h \
+					 src/builtins/inherit_builtin.cpp \
+					 src/builtins/unset_builtin.h \
+					 src/builtins/unset_builtin.cpp \
+					 src/builtins/builtin_exceptions.h \
+					 $(GENERATED_PARSER_C) \
+					 $(GENERATED_PARSER_H) \
+					 include/divide_by_zero_error.h \
+					 include/exceptions.h \
+					 include/illegal_argument_exception.h \
+					 include/interpreter_exception.h \
+					 include/parse_exception.h \
+					 include/readonly_exception.h \
+					 include/runtime_exception.h \
+					 include/unsupported_exception.h \
+					 src/core/interpreter.cpp \
+					 src/core/interpreter.h \
+					 src/core/symbols.hpp \
+					 src/core/function.h \
+					 src/core/function.cpp \
+					 src/core/bash_condition.h \
+					 src/core/bash_condition.cpp \
+					 src/core/bash_ast.cpp \
+					 src/core/bash_ast.h
 
 # separate library because we need per file CXXFLAGS
 # as antlr generated code does not pass our strict developer
@@ -277,16 +277,16 @@ libwalker_la_CXXFLAGS = -std=c++0x \
 						-fvisibility=hidden \
 						-fvisibility-inlines-hidden
 
-libcppbash_la_CXXFLAGS = $(AM_CXXFLAGS) \
+libbash_la_CXXFLAGS = $(AM_CXXFLAGS) \
 						 -fvisibility=hidden \
 						 -fvisibility-inlines-hidden
 if DEVELOPER_MODE
 # Paludis cannot get compiled with these flags.
 # So we only turn them on for our library.
-libcppbash_la_CXXFLAGS += -Wconversion -Wsign-conversion
+libbash_la_CXXFLAGS += -Wconversion -Wsign-conversion
 endif
-libcppbash_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
-libcppbash_la_LIBADD = libparser.la libwalker.la
+libbash_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
+libbash_la_LIBADD = libparser.la libwalker.la
 
 EXTRA_DIST = bashast/bashast.g \
 			 bashast/libbashWalker.g \



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-08-04 14:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-08-04 14:24 UTC (permalink / raw
  To: gentoo-commits

commit:     3eec2301d03a7055a2663ac0071d9e7afb4fd395
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  3 08:35:09 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 14:15:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=3eec2301

Build: add libbash.pc.in

---
 .gitignore    |    1 +
 Makefile.am   |    5 ++++-
 configure.ac  |    2 +-
 libbash.pc.in |   10 ++++++++++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0aef229..311384d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
 *.class
 *.java
 *.tokens
+*.pc
 libbash-*
 .deps
 .libs

diff --git a/Makefile.am b/Makefile.am
index cf09ee3..1f48eca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -187,7 +187,7 @@ CLEANFILES = $(GENERATED_PARSER_CPP) \
 			 massif.out \
 			 callgrind.out
 
-libbash_includedir = $(includedir)/libbash-0.1/libbash
+libbash_includedir = $(includedir)/libbash-@PACKAGE_VERSION@/libbash
 libbash_include_HEADERS = include/libbash.h \
                           include/common.h \
                           include/divide_by_zero_error.h \
@@ -322,6 +322,9 @@ EXTRA_DIST = bashast/bashast.g \
 			 $(BASH_LOG_COMPILER) \
 			 $(EBUILD_LOG_COMPILER)
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libbash.pc
+
 coding_standard.pdf: coding_standard/coding_standard.tex
 	$(AM_V_GEN)@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
 

diff --git a/configure.ac b/configure.ac
index 3563013..c5bbbb1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,7 @@ if test "$PDFLATEX" = "no"; then
 fi
 
 AC_CHECK_LIB([antlr3c],[antlr3AsciiFileStreamNew],[],[AC_MSG_ERROR(libasntlr3c not found.  Have you installed the C antlr runtime?)])
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile libbash.pc])
 DX_HTML_FEATURE(ON)
 DX_MAN_FEATURE(OFF)
 DX_CHM_FEATURE(OFF)

diff --git a/libbash.pc.in b/libbash.pc.in
new file mode 100644
index 0000000..c312986
--- /dev/null
+++ b/libbash.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libbash
+Description: A C++ library for bash
+Requires:
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}/libbash-@PACKAGE_VERSION@



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-08-04 13:53 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-08-04 13:53 UTC (permalink / raw
  To: gentoo-commits

commit:     a2addfd9d2b115de5090a56f1f1ba0d7295e2da8
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 19 14:47:38 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Wed Jul 20 15:08:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=a2addfd9

Build: remove the time limit option

Now our parser is simplified and this option is not necessary any more.

---
 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 61041ec..87d9c9a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -295,7 +295,7 @@ EXTRA_DIST = bashast/bashast.g \
 coding_standard.pdf: coding_standard/coding_standard.tex
 	$(AM_V_GEN)@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
 
-ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool -Xconversiontimeout 5000 $(ANTLRFLAGS)
+ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool $(ANTLRFLAGS)
 
 cgrammar.run: libbash.g
 	$(AM_V_at)touch $@.tmp



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-07-20 14:01 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-07-20 14:01 UTC (permalink / raw
  To: gentoo-commits

commit:     e0ee57cefc6d347a5613997595ed332353ac39ee
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  6 08:10:12 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Wed Jul 20 13:11:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=e0ee57ce

Build: add antlr flags

---
 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2702338..20fe274 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -301,7 +301,7 @@ EXTRA_DIST = bashast/bashast.g \
 coding_standard.pdf: coding_standard/coding_standard.tex
 	$(AM_V_GEN)@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
 
-ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool -Xconversiontimeout 5000
+ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool -Xconversiontimeout 5000 $(ANTLRFLAGS)
 
 cgrammar.run: libbash.g
 	$(AM_V_at)touch $@.tmp



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-07-08 14:03 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-07-08 14:03 UTC (permalink / raw
  To: gentoo-commits

commit:     c6f7de39b7e8ea59a02c768af17f9a5c8dc217cd
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  5 15:15:34 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Tue Jul  5 15:15:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=c6f7de39

Merge branch 'multithreading'


 Makefile.am                     |    4 +-
 bashast/libbashWalker.g         |    2 +-
 src/builtins/source_builtin.cpp |   51 +++++++++++--------
 src/core/bash_ast.cpp           |   39 +++++++++++++-
 src/core/bash_ast.h             |    8 ++-
 utils/instruo.cpp               |  108 ++++++++++++++++++---------------------
 6 files changed, 125 insertions(+), 87 deletions(-)

diff --cc src/core/bash_ast.h
index fb42663,190b020..1dd7be2
--- a/src/core/bash_ast.h
+++ b/src/core/bash_ast.h
@@@ -63,18 -58,15 +63,18 @@@ class bash_ast: public boost::noncopyab
    antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct> token_stream;
    antlr_pointer<libbashParser_Ctx_struct> parser;
    pANTLR3_BASE_TREE ast;
-   antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct> nodes;
    std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> parse;
  
 -  typedef std::unique_ptr<libbashWalker_Ctx_struct, std::function<void(plibbashWalker)>> walker_pointer;
 +  typedef std::unique_ptr<libbashWalker_Ctx_struct, std::function<void(libbashWalker_Ctx_struct*)>> walker_pointer;
  
    void init_parser(const std::string& script, const std::string& script_path);
-   walker_pointer create_walker(interpreter& walker);
+   walker_pointer create_walker(interpreter& walker,
+                                antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct>& nodes);
  
  public:
 +  /// \brief build AST from istream
 +  /// \param source input source
 +  /// \param p the parser rule for building the AST
    bash_ast(const std::istream& source,
             std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> p=parser_start);
  
@@@ -108,14 -86,15 +108,16 @@@
  
    ///
    /// \brief interpret the script with a given interpreter
 -  /// \param the interpreter object
 +  /// \param walker the interpreter object
 +  /// \param walk the walker rule to evaluate the AST
    /// \return the interpreted result
    template<typename Functor>
 -  typename std::result_of<Functor(plibbashWalker)>::type
 +  typename std::result_of<Functor(libbashWalker_Ctx_struct*)>::type
    interpret_with(interpreter& walker, Functor walk)
    {
-     walker_pointer p_tree_parser = create_walker(walker);
+     antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct> nodes(
+       antlr3CommonTreeNodeStreamNewTree(ast, ANTLR3_SIZE_HINT));
+     walker_pointer p_tree_parser = create_walker(walker, nodes);
      return walk(p_tree_parser.get());
    }
  



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-07-08 14:03 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-07-08 14:03 UTC (permalink / raw
  To: gentoo-commits

commit:     d3296b24ca1fa7cafc5bf25e129a3c1ce0811ac7
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  1 09:51:38 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Tue Jul  5 01:49:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=d3296b24

Merge remote branch 'betelgeuse/multithread' into multithreading

Conflicts:
	src/builtins/source_builtin.cpp
	src/core/bash_ast.cpp
	src/core/bash_ast.h
	utils/instruo.cpp


 Makefile.am                     |    4 +-
 bashast/libbashWalker.g         |    2 +-
 src/builtins/source_builtin.cpp |   51 +++++++++++--------
 src/core/bash_ast.cpp           |   39 +++++++++++++-
 src/core/bash_ast.h             |    8 ++-
 utils/instruo.cpp               |  108 ++++++++++++++++++---------------------
 6 files changed, 125 insertions(+), 87 deletions(-)

diff --cc src/builtins/source_builtin.cpp
index bec83ad,ee95e29..d7924ab
--- a/src/builtins/source_builtin.cpp
+++ b/src/builtins/source_builtin.cpp
@@@ -30,39 -32,45 +31,47 @@@
  
  #include "builtins/builtin_exceptions.h"
  #include "cppbash_builtin.h"
 +#include "core/exceptions.h"
  #include "core/interpreter.h"
 -#include "core/interpreter_exception.h"
  #include "core/bash_ast.h"
  
- int source_builtin::exec(const std::vector<std::string>& bash_args)
- {
-   static std::unordered_map<std::string, std::shared_ptr<bash_ast>> ast_cache;
+ namespace {
+   std::mutex parse_mutex;
  
-   if(bash_args.size() == 0)
-     throw libbash::illegal_argument_exception("should provide one argument for source builtin");
+   std::shared_ptr<bash_ast>& parse(const std::string& path)
+   {
+     static std::unordered_map<std::string, std::shared_ptr<bash_ast>> ast_cache;
  
-   // we need fix this to pass extra arguments as positional parameters
-   const std::string& path = bash_args[0];
+     std::lock_guard<std::mutex> parse_lock(parse_mutex);
  
-   auto stored_ast = ast_cache.find(path);
-   if(stored_ast == ast_cache.end())
-   {
-     // ensure the path is cached
-     auto iter = ast_cache.insert(make_pair(path, std::shared_ptr<bash_ast>()));
-     // this may throw exception
-     iter.first->second.reset(new bash_ast(path));
-     stored_ast = iter.first;
-   }
-   else if(!(stored_ast->second))
-   {
-     throw libbash::parse_exception(path + " cannot be fully parsed");
 -    auto& stored_ast = ast_cache[path];
 -    if(!stored_ast)
++    auto stored_ast = ast_cache.find(path);
++    if(stored_ast == ast_cache.end())
+     {
 -      std::ifstream input(path);
 -      if(!input)
 -        throw interpreter_exception(path + " can't be read");
 -
 -      stored_ast.reset(new bash_ast(input));
 -      if(stored_ast->get_error_count())
 -        std::cerr << path << " could not be parsed properly" << std::endl;
++      // ensure the path is cached
++      auto iter = ast_cache.insert(make_pair(path, std::shared_ptr<bash_ast>()));
++      // this may throw exception
++      iter.first->second.reset(new bash_ast(path));
++      stored_ast = iter.first;
++    }
++    else if(!(stored_ast->second))
++    {
++      throw libbash::parse_exception(path + " cannot be fully parsed");
+     }
+ 
 -    return stored_ast;
++    return stored_ast->second;
    }
+ }
+ 
+ int source_builtin::exec(const std::vector<std::string>& bash_args)
+ {
 -  static std::unordered_map<std::string, std::shared_ptr<bash_ast>> ast_cache;
 -
+   if(bash_args.size() == 0)
 -    throw interpreter_exception("should provide one argument for source builtin");
++    throw libbash::illegal_argument_exception("should provide one argument for source builtin");
  
 +  const std::string& original_path = _walker.resolve<std::string>("0");
++  _walker.define("0", bash_args.front(), true);
    try
    {
-     _walker.define("0", path, true);
-     stored_ast->second->interpret_with(_walker);
+     parse(bash_args.front())->interpret_with(_walker);
    }
    catch(return_exception& e) {}
  
diff --cc src/core/bash_ast.cpp
index c7b9180,22c7f22..3787f84
--- a/src/core/bash_ast.cpp
+++ b/src/core/bash_ast.cpp
@@@ -18,15 -18,16 +18,17 @@@
  */
  ///
  /// \file bash_ast.cpp
 -/// \author Mu Qiao
 -/// \brief implementation that helps interpret from istream
 +/// \brief a wrapper class that helps interpret from istream and string
  ///
 -
  #include "core/bash_ast.h"
  
 +#include <fstream>
+ #include <sstream>
+ #include <thread>
  
 -#include "core/interpreter_exception.h"
 +#include <boost/numeric/conversion/cast.hpp>
 +
 +#include "core/exceptions.h"
  #include "core/interpreter.h"
  #include "libbashLexer.h"
  #include "libbashParser.h"
@@@ -38,60 -38,107 +40,85 @@@ bash_ast::bash_ast(const std::istream& 
    std::stringstream stream;
    stream << source.rdbuf();
    script = stream.str();
 +  init_parser(script, "unknown source");
 +}
  
 -  input = antlr3NewAsciiStringInPlaceStream(
 -      reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script.c_str())),
 -      script.size(),
 -      NULL);
 -
 -  if(input == NULL)
 -    throw interpreter_exception("Unable to open file " + script + " due to malloc() failure");
 +bash_ast::bash_ast(const std::string& script_path,
 +                   std::function<pANTLR3_BASE_TREE(plibbashParser)> p): parse(p)
 +{
 +  std::stringstream stream;
 +  std::ifstream file_stream(script_path);
 +  if(!file_stream)
 +    throw libbash::parse_exception(script_path + " can't be read");
  
 -  init_parser();
 +  stream << file_stream.rdbuf();
 +  script = stream.str();
 +  init_parser(script, script_path);
  }
  
+ namespace
+ {
+   std::mutex string_mutex;
+ 
+   pANTLR3_STRING locked_newRaw8(pANTLR3_STRING_FACTORY factory)
+   {
+     std::lock_guard<std::mutex> l(string_mutex);
+     pANTLR3_STRING_FACTORY pristine = antlr3StringFactoryNew();
+     pANTLR3_STRING result = pristine->newRaw(factory);
+     pristine->close(pristine);
+     return result;
+   }
+ 
+   void locked_destroy(pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string)
+   {
+     std::lock_guard<std::mutex> l(string_mutex);
+     pANTLR3_STRING_FACTORY pristine = antlr3StringFactoryNew();
+     pristine->destroy(factory, string);
+     pristine->close(pristine);
+   }
+ }
+ 
 -bash_ast::~bash_ast()
 +void bash_ast::init_parser(const std::string& script, const std::string& script_path)
  {
 -  psr->free(psr);
 -  tstream->free(tstream);
 -  lxr->free(lxr);
 -  input->close(input);
 -}
 -
 -void bash_ast::init_parser()
 -{
 -  lxr = libbashLexerNew(input);
 -  if ( lxr == NULL )
 -  {
 -    std::cerr << "Unable to create the lexer due to malloc() failure" << std::endl;
 -    error_count = 1;
 -    return;
 -  }
 -
 -  tstream = antlr3CommonTokenStreamSourceNew(
 -      ANTLR3_SIZE_HINT, lxr->pLexer->rec->state->tokSource);
 -  if (tstream == NULL)
 -  {
 -    std::cerr << "Out of memory trying to allocate token stream" << std::endl;
 -    error_count = 1;
 -    return;
 -  }
 -
 -  psr = libbashParserNew(tstream);
 -  if (psr == NULL)
 -  {
 -    std::cerr << "Out of memory trying to allocate parser" << std::endl;
 -    error_count = 1;
 -    return;
 -  }
 -
 -  langAST.reset(new libbashParser_start_return(psr->start(psr)));
 -  langAST->tree->strFactory->newRaw = &locked_newRaw8;
 -  langAST->tree->strFactory->destroy = &locked_destroy;
 -  error_count = psr->pParser->rec->getNumberOfSyntaxErrors(psr->pParser->rec);
 -}
 -
 -void bash_ast::interpret_with(interpreter& walker)
 -{
 -  set_interpreter(&walker);
 -
 -  auto nodes = antlr3CommonTreeNodeStreamNewTree(langAST->tree, ANTLR3_SIZE_HINT);
 -  plibbashWalker treePsr = libbashWalkerNew(nodes);
 -  try
 -  {
 -    treePsr->start(treePsr);
 -  }
 -  catch(...)
 -  {
 -    treePsr->free(treePsr);
 -    throw;
 -  }
 -  treePsr->free(treePsr);
 -  nodes->free(nodes);
 +  input.reset(antlr3NewAsciiStringInPlaceStream(
 +    reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script.c_str())),
 +    // We do not support strings longer than the max value of ANTLR3_UNIT32
 +    boost::numeric_cast<ANTLR3_UINT32>(script.size()),
 +    NULL));
 +
 +  if(!input)
 +    throw libbash::parse_exception("Unable to open file " + script + " due to malloc() failure");
 +
 +  input->fileName = input->strFactory->newStr(
 +      input->strFactory,
 +      reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script_path.c_str())));
 +
 +  lexer.reset(libbashLexerNew(input.get()));
 +  if(!lexer)
 +    throw libbash::parse_exception("Unable to create the lexer due to malloc() failure");
 +
 +  token_stream.reset(antlr3CommonTokenStreamSourceNew(
 +      ANTLR3_SIZE_HINT, lexer->pLexer->rec->state->tokSource));
 +  if(!token_stream)
 +    throw libbash::parse_exception("Out of memory trying to allocate token stream");
 +
 +  parser.reset(libbashParserNew(token_stream.get()));
 +  if(!parser)
 +    throw libbash::parse_exception("Out of memory trying to allocate parser");
 +
 +  ast = parse(parser.get());
++  ast->strFactory->newRaw = &locked_newRaw8;
++  ast->strFactory->destroy = &locked_destroy;
 +  if(parser->pParser->rec->getNumberOfSyntaxErrors(parser->pParser->rec))
 +    throw libbash::parse_exception("Something wrong happened while parsing");
-   nodes.reset(antlr3CommonTreeNodeStreamNewTree(ast, ANTLR3_SIZE_HINT));
  }
  
  std::string bash_ast::get_dot_graph()
  {
 -  auto nodes = antlr3CommonTreeNodeStreamNewTree(langAST->tree, ANTLR3_SIZE_HINT);
 -  pANTLR3_STRING graph = nodes->adaptor->makeDot(nodes->adaptor, langAST->tree);
 -  std::string result(reinterpret_cast<char*>(graph->chars));
 -  nodes->free(nodes);
 -  return result;
++  antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct> nodes(
++    antlr3CommonTreeNodeStreamNewTree(ast, ANTLR3_SIZE_HINT));
 +  pANTLR3_STRING graph = nodes->adaptor->makeDot(nodes->adaptor, ast);
 +  return std::string(reinterpret_cast<char*>(graph->chars));
  }
  
  std::string bash_ast::get_string_tree()
@@@ -148,71 -195,6 +175,79 @@@ std::string bash_ast::get_parser_tokens
        print_line_counter(result, token, line_counter, tokenName == "CONTINUE_LINE"? 1 : 0);
      }
    }
 +  return result.str();
 +}
 +
 +std::string bash_ast::get_walker_tokens(std::function<std::string(ANTLR3_UINT32)> token_map)
 +{
 +  std::stringstream result;
++  antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct> nodes(
++    antlr3CommonTreeNodeStreamNewTree(ast, ANTLR3_SIZE_HINT));
 +  pANTLR3_INT_STREAM istream = nodes->tnstream->istream;
 +  auto istream_size = istream->size(istream);
 +
 +  for(ANTLR3_UINT32 i = 1; i <= istream_size; ++i)
 +  {
 +    ANTLR3_UINT32 token = istream->_LA(istream, boost::numeric_cast<ANTLR3_INT32>(i));
 +    if(token == 2)
 +      result << "DOWN ";
 +    else if(token == 3)
 +      result << "UP ";
 +    else
 +      result << token_map(istream->_LA(istream, boost::numeric_cast<ANTLR3_INT32>(i))) << " ";
 +  }
 +  result << std::endl;
  
    return result.str();
  }
 +
 +void bash_ast::walker_start(plibbashWalker tree_parser)
 +{
 +  tree_parser->start(tree_parser);
 +}
 +
 +long bash_ast::walker_arithmetics(plibbashWalker tree_parser)
 +{
 +  return tree_parser->arithmetics(tree_parser);
 +}
 +
 +pANTLR3_BASE_TREE bash_ast::parser_start(plibbashParser parser)
 +{
 +  return parser->start(parser).tree;
 +}
 +
 +pANTLR3_BASE_TREE bash_ast::parser_arithmetics(plibbashParser parser)
 +{
 +  return parser->arithmetics(parser).tree;
 +}
 +
 +void bash_ast::call_function(plibbashWalker ctx,
 +                             ANTLR3_MARKER index)
 +{
 +  auto INPUT = ctx->pTreeParser->ctnstream;
++
++  // Initialize the input stream
++  auto ISTREAM = ctx->pTreeParser->ctnstream->tnstream->istream;
++  ISTREAM->size(ISTREAM);
++
 +  // Push function index into INPUT
 +  // The actual type of ANTLR3_MARKER is ANTLR3_INT32
 +  INPUT->push(INPUT, boost::numeric_cast<ANTLR3_INT32>(index));
 +  // Execute function body
 +  ctx->compound_command(ctx);
 +}
 +
- bash_ast::walker_pointer bash_ast::create_walker(interpreter& walker)
++bash_ast::walker_pointer bash_ast::create_walker(interpreter& walker,
++                                                 antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct>& nodes)
 +{
 +    set_interpreter(&walker);
 +    walker.push_current_ast(this);
 +
 +    auto deleter = [&](plibbashWalker tree_parser)
 +    {
 +      tree_parser->free(tree_parser);
 +      walker.pop_current_ast();
 +    };
 +
 +    return walker_pointer(libbashWalkerNew(nodes.get()), deleter);
 +}
diff --cc src/core/bash_ast.h
index 22635a1,852899c..190b020
--- a/src/core/bash_ast.h
+++ b/src/core/bash_ast.h
@@@ -36,79 -34,37 +36,81 @@@
  
  struct libbashLexer_Ctx_struct;
  struct libbashParser_Ctx_struct;
 -struct libbashParser_start_return_struct;
 +struct libbashWalker_Ctx_struct;
 +typedef libbashWalker_Ctx_struct* plibbashWalker;
  class interpreter;
  
 +template<typename T>
 +class antlr_pointer: public std::unique_ptr<T, std::function<void(T*)>>
 +{
 +  typedef std::unique_ptr<T, std::function<void(T*)>> parent;
 +public:
 +  antlr_pointer(T* p = 0) : parent(p, [](T* to_delete) { to_delete->free(to_delete); }) {};
 +};
 +
  /// \class bash_ast
 -/// \brief a wrapper class that helps interpret from istream
 -class bash_ast
 +/// \brief a wrapper class that helps interpret from istream and string
 +class bash_ast: public boost::noncopyable
  {
 -  pANTLR3_INPUT_STREAM input;
 +  antlr_pointer<ANTLR3_INPUT_STREAM_struct> input;
    std::string script;
 -  libbashLexer_Ctx_struct* lxr;
 -  pANTLR3_COMMON_TOKEN_STREAM tstream;
 -  libbashParser_Ctx_struct* psr;
 -  std::unique_ptr<libbashParser_start_return_struct> langAST;
 -  int error_count;
 +  antlr_pointer<libbashLexer_Ctx_struct> lexer;
 +  antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct> token_stream;
 +  antlr_pointer<libbashParser_Ctx_struct> parser;
 +  pANTLR3_BASE_TREE ast;
-   antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct> nodes;
 +  std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> parse;
 +
 +  typedef std::unique_ptr<libbashWalker_Ctx_struct, std::function<void(plibbashWalker)>> walker_pointer;
 +
 +  void init_parser(const std::string& script, const std::string& script_path);
-   walker_pointer create_walker(interpreter& walker);
++  walker_pointer create_walker(interpreter& walker,
++                               antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct>& nodes);
  
 -  void init_parser();
  public:
 -  explicit bash_ast(std::istream& source);
 -  ~bash_ast();
 +  bash_ast(const std::istream& source,
 +           std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> p=parser_start);
 +
 +  bash_ast(const std::string& script_path,
 +           std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> p=parser_start);
 +
 +  static void walker_start(plibbashWalker tree_parser);
 +
 +  static long walker_arithmetics(plibbashWalker tree_parser);
 +
 +  static void call_function(plibbashWalker tree_parser,
 +                            ANTLR3_MARKER index);
 +
 +  static pANTLR3_BASE_TREE parser_start(libbashParser_Ctx_struct* parser);
 +
 +  static pANTLR3_BASE_TREE parser_arithmetics(libbashParser_Ctx_struct* parser);
  
    ///
    /// \brief interpret the script with a given interpreter
    /// \param the interpreter object
 -  void interpret_with(interpreter& walker);
 +  /// \return the interpreted result
 +  template<typename Functor>
 +  typename std::result_of<Functor(plibbashWalker)>::type
 +  interpret_with(interpreter& walker, Functor walk)
 +  {
-     walker_pointer p_tree_parser = create_walker(walker);
++    antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct> nodes(
++      antlr3CommonTreeNodeStreamNewTree(ast, ANTLR3_SIZE_HINT));
++    walker_pointer p_tree_parser = create_walker(walker, nodes);
 +    return walk(p_tree_parser.get());
 +  }
 +
 +  void interpret_with(interpreter& walker)
 +  {
 +    interpret_with(walker, walker_start);
 +  }
 +
    std::string get_dot_graph();
 +
    std::string get_string_tree();
 -  std::string get_tokens(std::function<std::string(ANTLR3_INT32)> token_map);
 +
 +  static std::string get_parser_tokens(antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct>& token_stream,
 +                                       std::function<std::string(ANTLR3_UINT32)>);
 +
 +  std::string get_walker_tokens(std::function<std::string(ANTLR3_UINT32)>);
  };
  
  #endif
diff --cc utils/instruo.cpp
index dcd3924,f91bbf1..704c98c
--- a/utils/instruo.cpp
+++ b/utils/instruo.cpp
@@@ -53,7 -53,6 +53,7 @@@
  #include <paludis/package_database.hh>
  #include <paludis/metadata_key.hh>
  
- #include "builtins/builtin_exceptions.h"
++#include "core/exceptions.h"
  #include "command_line.h"
  #include "libbash.h"
  #include "utils/metadata.h"
@@@ -65,71 -64,63 +65,63 @@@ using std::endl
  
  void worker(const std::shared_ptr<PackageIDSequence> &ids)
  {
-   std::unordered_map<std::string, std::vector<std::string>> variables;
- 
-   std::shared_ptr<const PackageID> id;
    unsigned total(0);
    CategoryNamePart old_cat("OLDCAT");
-   while(!ids->empty())
+   #pragma omp parallel
    {
-     id = *ids->begin();
-     ids->pop_front();
-     if (id->name().category() != old_cat)
+     #pragma omp single nowait
+     while(!ids->empty())
      {
-       std::cout << "Processing " << stringify(id->name().category()) << "..." << std::endl;
-       old_cat = id->name().category();
-       FSPath(CommandLine::get_instance()->a_output_directory.argument() + "/" +
-           stringify(id->name().category())).mkdir(0755,  {fspmkdo_ok_if_exists});
-       ++total;
-     }
+       std::shared_ptr<const PackageID> id = *ids->begin();
+       ids->pop_front();
+       if (id->name().category() != old_cat)
+       {
+         std::cout << "Processing " << stringify(id->name().category()) << "..." << std::endl;
+         old_cat = id->name().category();
+         FSPath(CommandLine::get_instance()->a_output_directory.argument() + "/" +
+             stringify(id->name().category())).mkdir(0755,  {fspmkdo_ok_if_exists});
+         ++total;
+       }
  
-     Context i_context("When generating metadata for ID '" + stringify(*id) + "':");
+       #pragma omp task
+       {
+         Context i_context("When generating metadata for ID '" + stringify(*id) + "':");
  
-     variables.clear();
-     variables["PN"].push_back(stringify(id->name().package()));
-     variables["PV"].push_back(stringify(id->version().remove_revision()));
-     variables["P"].push_back(stringify(id->name().package()) + "-" +
-                              stringify(id->version().remove_revision()));
-     variables["PR"].push_back(id->version().revision_only());
-     variables["PVR"].push_back(stringify(id->version()));
-     variables["PF"].push_back(stringify(id->name().package()) + "-" + stringify(id->version()));
-     variables["CATEGORY"].push_back(stringify(id->name().category()));
-     std::vector<std::string> functions;
+         std::unordered_map<std::string, std::vector<std::string>> variables;
+         variables["PN"].push_back(stringify(id->name().package()));
+         variables["PV"].push_back(stringify(id->version().remove_revision()));
+         variables["P"].push_back(stringify(id->name().package()) + "-" +
+                                  stringify(id->version().remove_revision()));
+         variables["PR"].push_back(id->version().revision_only());
+         variables["PVR"].push_back(stringify(id->version()));
+         variables["PF"].push_back(stringify(id->name().package()) + "-" + stringify(id->version()));
+         variables["CATEGORY"].push_back(stringify(id->name().category()));
+         std::vector<std::string> functions;
  
-     std::string ebuild_path(CommandLine::get_instance()->a_repository_directory.argument() +
-                             variables["CATEGORY"][0] + "/" +
-                             variables["PN"][0] + "/" +
-                             variables["PN"][0] + "-" +
-                             variables["PVR"][0] + ".ebuild");
-     try
-     {
-       libbash::interpret(ebuild_path, "utils/isolated-functions.sh", variables, functions);
-     }
-     catch(const libbash::interpreter_exception& e)
-     {
-       cerr << "Exception occurred while interpreting " << ebuild_path << ". The error message is:\n"
-         << e.what() << endl;
-       continue;
-     }
-     catch(const return_exception& e)
-     {
-       cerr << "Unhandled return exception in " << ebuild_path << ". The error message is:\n"
-         << e.what() << endl;
-       continue;
-     }
-     catch (...)
-     {
-       cerr << "Unhandled exception in " << ebuild_path << endl;
-       continue;
-     }
+         std::string ebuild_path(CommandLine::get_instance()->a_repository_directory.argument() +
+                                 variables["CATEGORY"][0] + "/" +
+                                 variables["PN"][0] + "/" +
+                                 variables["PN"][0] + "-" +
+                                 variables["PVR"][0] + ".ebuild");
+         try
+         {
+           libbash::interpret(ebuild_path, variables, functions);
  
-     std::string output_path(CommandLine::get_instance()->a_output_directory.argument() + "/" +
-                             variables["CATEGORY"][0] + "/" +
-                             variables["PN"][0] + "-" +
-                             variables["PVR"][0]);
-     FSPath(output_path).dirname().mkdir(0755, {fspmkdo_ok_if_exists});
-     std::ofstream output(output_path, std::ofstream::out | std::ofstream::trunc);
-     write_metadata(output, variables, functions);
+           std::string output_path(CommandLine::get_instance()->a_output_directory.argument() + "/" +
+                                   variables["CATEGORY"][0] + "/" +
+                                   variables["PN"][0] + "-" +
+                                   variables["PVR"][0]);
+           FSPath(output_path).dirname().mkdir(0755, {fspmkdo_ok_if_exists});
+           std::ofstream output(output_path, std::ofstream::out | std::ofstream::trunc);
+           write_metadata(output, variables, functions);
+         }
 -        catch(const interpreter_exception& e)
++        catch(const libbash::interpreter_exception& e)
+         {
+           cerr << "Exception occurred while interpreting " << ebuild_path << ". The error message is:\n"
+             << e.what() << endl;
+         }
+       }
+     }
    }
  }
  



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-07-03 20:21 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-07-03 20:21 UTC (permalink / raw
  To: gentoo-commits

commit:     a50b669e1d829120cc01600bda31af99413d6386
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  3 08:56:48 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 08:56:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=a50b669e

Doc: add docs to .gitignore

---
 .gitignore |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index f9685d5..df9d332 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,3 +63,4 @@ libtool
 ltmain.sh
 INSTALL
 test_coverage/
+docs/



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-26 13:38 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-26 13:38 UTC (permalink / raw
  To: gentoo-commits

commit:     b7ff827783049072f8afefad626522e39c092511
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 26 12:27:46 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun Jun 26 12:27:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=b7ff8277

Merge branch 'mu/native_code'

Conflicts:
	Makefile.am
	bashast/features_script/features.sh.ast
	bashast/gunit/simp_command.gunit
	scripts/command_execution.bash
	test/verify_error_output_test.sh


 .gitignore                                        |    8 +-
 Makefile.am                                       |   55 ++++++++---
 bashast/bashast.g                                 |  114 +++++++++++++++++---
 bashast/features_script/features.sh.ast           |    2 +-
 bashast/features_script/features.sh.tokens        |    2 +-
 bashast/features_script/features.sh.walker.tokens |    2 +-
 bashast/gunit/arith_main.gunit                    |    2 +-
 bashast/gunit/array.gunit                         |    2 +-
 bashast/gunit/assoc_array.gunit                   |    2 +-
 bashast/gunit/brace.gunit                         |    2 +-
 bashast/gunit/command_sub.gunit                   |    4 +-
 bashast/gunit/comment.gunit                       |    2 +-
 bashast/gunit/compound.gunit                      |    4 +-
 bashast/gunit/cond_main.gunit                     |    2 +-
 bashast/gunit/continued_lines.gunit               |    5 +-
 bashast/gunit/expansions.gunit                    |    2 +-
 bashast/gunit/fname.gunit                         |   14 ++--
 bashast/gunit/function.gunit                      |    2 +-
 bashast/gunit/list.gunit                          |    4 +-
 bashast/gunit/param_main.gunit                    |    4 +-
 bashast/gunit/pipeline.gunit                      |    2 +-
 bashast/gunit/process_substitution.gunit          |    2 +-
 bashast/gunit/redir.gunit                         |    6 +-
 bashast/gunit/simp_command.gunit                  |    3 +-
 bashast/gunit/simp_prog.gunit                     |    2 +-
 bashast/libbashWalker.g                           |   10 +-
 scripts/command_execution.bash                    |    1 +
 scripts/command_execution.bash.result             |    1 +
 scripts/here_document.ast                         |    3 +
 scripts/here_document.sh                          |    5 +
 test/post_check.cpp                               |    4 +-
 test/verify_here_document.sh                      |    3 +
 32 files changed, 200 insertions(+), 76 deletions(-)

diff --cc .gitignore
index 4c665a8,ea74327..7a07a66
--- a/.gitignore
+++ b/.gitignore
@@@ -1,3 -1,3 +1,4 @@@
++*.bak
  *.swp
  *.swo
  *.o
@@@ -26,9 -28,8 +29,9 @@@ instru
  long.sh
  massif.out
  libbash.g
- libbash.tokens
+ java_libbash.g
  libbash.tokens.md5
- bashast.tokens
++libbashWalker.h.md5
  bashast/.DS_Store
  bashast/*.ebuild
  bashast/c_runtime
diff --cc bashast/bashast.g
index 1a73c4b,819be98..8903c02
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@@ -101,9 -111,52 +110,53 @@@ tokens
  	MINUS_SIGN;
  	// Operators
  	NOT_EQUALS;
 +	BUILTIN_LOGIC;
  }
  
+ @lexer::members
+ {
+ #ifdef OUTPUT_C
+ 	bool double_quoted = false;
+ #else
+ 	boolean double_quoted = false;
+ #endif
+ }
+ 
+ #ifdef OUTPUT_C
+ @includes {
+ 	C_INCLUDE #include <iostream>
+ 	C_INCLUDE #include <string>
+ 
+ 	C_INCLUDE #include <boost/numeric/conversion/cast.hpp>
+ }
+ @members
+ {
+ 	static std::string get_string(pANTLR3_COMMON_TOKEN token)
+ 	{
+ 		if(!token || !token->start)
+ 			return "";
+ 		// Use reinterpret_cast here because we have to cast C code.
+ 		// The real type here is int64_t which is used as a pointer.
+ 		// token->stop - token->start + 1 should be bigger than 0.
+ 		return std::string(reinterpret_cast<const char *>(token->start),
+ 				boost::numeric_cast<unsigned>(token->stop - token->start + 1));
+ 	}
+ 
+ 	static bool is_here_end(plibbashParser ctx, const std::string& here_doc_word, int number_of_tokens_in_word)
+ 	{
+ 		std::string word;
+ 		for(int i = 1; i <= number_of_tokens_in_word; ++i)
+ 			word += get_string(LT(i));
+ 		return (word == here_doc_word);
+ 	}
+ 
+ 	static void free_redirect_atom(plibbashParser_redirect_atom_SCOPE scope)
+ 	{
+ 		(&(scope->here_doc_word))->std::string::~string();
+ 	}
+ }
+ #endif
+ 
  start	:	(flcomment)? EOL* clist BLANK* (SEMIC|AMP|EOL)? EOF -> clist;
  //Because the comment token doesn't handle the first comment in a file if it's on the first line, have a parser rule for it
  flcomment
@@@ -147,16 -200,45 +200,49 @@@ export_ite
  	:var_def
  	|name ->;
  bash_command
 -	:	fname_no_res_word (BLANK!+ fname)*;
 +	:	fname_no_res_word (BLANK!+ bash_command_arguments)*;
 +bash_command_arguments
 +	: bash_command_arguments_atom+ -> ^(STRING bash_command_arguments_atom+);
 +bash_command_arguments_atom
 +	:	brace_expansion|LBRACE|RBRACE|fname_part;
  redirect:	(BLANK!* redirect_atom)*;
- redirect_atom:	here_string_op^ BLANK!* fname
- 	|	here_doc_op^ BLANK!* fname EOL! heredoc
+ redirect_atom
+ #ifdef OUTPUT_C
+ scope {
+ 	std::string here_doc_word;
+ 	int number_of_tokens_in_word;
+ }
+ @init {
+ 	// http://antlr.1301665.n2.nabble.com/C-target-initialization-of-return-scope-structures-td5078478.html
+ 	new (&($redirect_atom::here_doc_word)) std::string;
+ 	$redirect_atom::number_of_tokens_in_word = 0;
+ 	ctx->plibbashParser_redirect_atomTop->free = &free_redirect_atom;
+ }
+ #endif
+ 	:	HERE_STRING_OP^ BLANK!* fname
+ #ifdef OUTPUT_C
+ 	|	here_doc_op BLANK* here_doc_begin redirect?
+ #else
+ 	|	here_doc_op BLANK* n=NAME redirect?
+ #endif
+ 	EOL heredoc ->  ^(here_doc_op ^(STRING heredoc) redirect?)
  	|	redir_op BLANK* redir_dest -> ^(REDIR redir_op redir_dest)
  	|	process_substitution;
+ #ifdef OUTPUT_C
+ here_doc_begin
+ 	:( {
+ 		if(LA(1) != BLANK && LA(1) != EOL)
+ 		{
+ 			$redirect_atom::here_doc_word += get_string(LT(1));
+ 			++$redirect_atom::number_of_tokens_in_word;
+ 		}
+ 	} (~(EOL|BLANK)))+;
+ here_doc_end
+ 	: ({ ($redirect_atom::number_of_tokens_in_word) != 0 }? => .{ ($redirect_atom::number_of_tokens_in_word)--; })+;
+ heredoc	:	({ !is_here_end(ctx, $redirect_atom::here_doc_word, $redirect_atom::number_of_tokens_in_word) }? => .)+ here_doc_end!;
+ #else
+ heredoc	:   (fname_part EOL!)*;
+ #endif
  redir_dest
  	:	file_desc_as_file //handles file descriptors
  	|	fname; //path to a file
diff --cc bashast/features_script/features.sh.ast
index 4191c85,4570804..ad37b9c
--- a/bashast/features_script/features.sh.ast
+++ b/bashast/features_script/features.sh.ast
@@@ -1,1 -1,1 +1,1 @@@
- (LIST (COMMAND (function (STRING lots_o_echo) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING The   number   of   tests   that   have   failed :   (VAR_REF failedtests)))) (COMMAND (STRING echo) (STRING (SINGLE_QUOTED_STRING $ failedtests))) (COMMAND (STRING echo) (STRING (VAR_REF failedtests))))))) (COMMAND (function (STRING do_some_arith) (CURRENT_SHELL (LIST (COMMAND (ARITHMETIC_EXPRESSION (* 5 4))) (COMMAND (ARITHMETIC_EXPRESSION (** 5 4))) (COMMAND (ARITHMETIC_EXPRESSION (+ (VAR_REF failedtests) (/ 5 4)))) (COMMAND (ARITHMETIC_EXPRESSION (+ (VAR_REF z) (MINUS_SIGN 3)))))))) (COMMAND (function (STRING arrays) (SUBSHELL (LIST (COMMAND (VARIABLE_DEFINITIONS (= asdf (ARRAY (STRING a) (STRING b) (STRING c) (STRING d))))) (COMMAND (STRING echo) (STRING (VAR_REF (asdf 3)))) (COMMAND (VARIABLE_DEFINITIONS (= foo (ARRAY (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING 6))))) (STRING b) (STRING c) (STRING d))))) (COMMAND (VARIABLE_DEFINITIONS (
 = (arr (VAR_REF foo)) (STRING 3)))) (COMMAND (VARIABLE_DEFINITIONS (= bar (ARRAY (STRING a) (STRING b) (= 5 (STRING c)))))))))) (COMMAND (STRING echo) (STRING (BRACE_EXP (STRING a) (STRING b)))) (COMMAND (STRING echo) (STRING (BRACE_EXP (.. a d)))) (COMMAND (STRING echo) (STRING (BRACE_EXP (STRING (BRACE_EXP (STRING a) (STRING b))) (STRING c) (STRING d)))) (COMMAND (STRING echo) (STRING a (BRACE_EXP (STRING b) (STRING c)))) (COMMAND (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING foobar)))))) (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING gunit) (REDIR >> (STRING filelist)))) (COMMAND (case (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING asdf))))) (CASE_PATTERN (STRING gz) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))) (CASE_PATTERN (STRING bzip) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING three)))) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING woo)))))) (COMMAND (for each (STRING (COMMAND_SUB
  (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (VAR_REF each))) (COMMAND (STRING cat) (STRING each))))) (COMMAND (CFOR (FOR_INIT (+ 5 3)) (FOR_COND (+ 6 2)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 3 1)))) (COMMAND (select each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING output)))))) (LIST (COMMAND (STRING echo) (STRING asdf) (STRING 2) (REDIR > (STRING / dev / null)))))) (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))))) (COMMAND (until (LIST (COMMAND (COMPOUND_COND (KEYWORD_TEST (a (STRING this / is . afile)))))) (LIST (COMMAND (STRING touch) (STRING this / is . afile))))) (COMMAND (while (LIST (COMMAND (COMPOUND_COND (BUILTIN_TEST (n (STRING foobar)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file   found)))))) (COMMAND (IF_STATEMENT (if (LIST (COMMAND (COMPOUND_COND (BU
 ILTIN_TEST (eq (STRING 5) (STRING 6)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING something ' s   wrong))))))) (COMMAND (STRING echo) (STRING this) (STRING command) (STRING has) (STRING multiple) (STRING arguments)) (COMMAND (STRING wc) (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING cat) (STRING / usr / share / dict / linux . words))))) (|| (&& (&& (&& (COMMAND (STRING cd) (STRING build)) (COMMAND (STRING . / configure))) (COMMAND (STRING make))) (COMMAND (STRING make_install))) (COMMAND (STRING echo) (STRING fail))) (COMMAND (STRING cd) (STRING / usr / bin)) (| (COMMAND (STRING ls) (STRING - al)) (COMMAND (STRING grep) (STRING more))) (COMMAND (VARIABLE_DEFINITIONS (= asdf (STRING parameters)))) (COMMAND (STRING (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING foo))))) (COMMAND (STRING (VAR_REF (OFFSET asdf 8)))) (COMMAND (STRING (VAR_REF (! asdf *)))) (COMMAND (STRING (VAR_REF (! asdf @)))) (COMMAND (STRING (VAR_REF (# foo)))) (COMMAND (STRING (VAR_
 REF (REPLACE_FIRST replaice (STRING with) (STRING pattern))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_START asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_START asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_END asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_END asdf (STRING bar))))) (COMMAND (STRING (VAR_REF 1)) (STRING (VAR_REF @)) (STRING (VAR_REF *))) (COMMAND (STRING (VAR_REF ?))) (COMMAND (STRING (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_START PV (STRING foo) (STRING bar))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_END PV (STRING foo) (STRING bar))))) (COMMAND (VARIABLE_DEFINITIONS (= MY_PN (STRING (VAR_REF (REPLACE_FIRST PN (STRING asterisk -))))))) (| (COMMAND (STRING cat) (STRING asdf)) (COMMAND (STRING grep) (STRING three) (STRING 2) (REDIR >& (FILE_DESCRIPTOR 1)) (REDIR > (STRING / dev / null)))) (COMMAND (STRING echo) (STRING asdf) (REDIR >> (STRING APPEND))) (COMMAND (
 STRING echo) (STRING cat) (<<< (STRING word))))
 -(LIST (COMMAND (function (STRING lots_o_echo) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING The   number   of   tests   that   have   failed :   (VAR_REF failedtests)))) (COMMAND (STRING echo) (STRING (SINGLE_QUOTED_STRING '$failedtests'))) (COMMAND (STRING echo) (STRING (VAR_REF failedtests))))))) (COMMAND (function (STRING do_some_arith) (CURRENT_SHELL (LIST (COMMAND (COMPOUND_ARITH (* 5 4))) (COMMAND (COMPOUND_ARITH (** 5 4))) (COMMAND (COMPOUND_ARITH (+ (VAR_REF failedtests) (/ 5 4)))) (COMMAND (COMPOUND_ARITH (+ (VAR_REF z) (MINUS_SIGN 3)))))))) (COMMAND (function (STRING arrays) (SUBSHELL (LIST (COMMAND (VARIABLE_DEFINITIONS (= asdf (ARRAY (STRING a) (STRING b) (STRING c) (STRING d))))) (COMMAND (STRING echo) (STRING (VAR_REF (asdf 3)))) (COMMAND (VARIABLE_DEFINITIONS (= foo (ARRAY (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING 6))))) (STRING b) (STRING c) (STRING d))))) (COMMAND (VARIABLE_DEFINITIONS (= (arr (VAR_REF foo)) (STRI
 NG 3)))) (COMMAND (VARIABLE_DEFINITIONS (= bar (ARRAY (STRING a) (STRING b) (= 5 (STRING c)))))))))) (COMMAND (STRING echo) (STRING (BRACE_EXP (STRING a) (STRING b)))) (COMMAND (STRING echo) (STRING (BRACE_EXP (.. a d)))) (COMMAND (STRING echo) (STRING (BRACE_EXP (STRING (BRACE_EXP (STRING a) (STRING b))) (STRING c) (STRING d)))) (COMMAND (STRING echo) (STRING a (BRACE_EXP (STRING b) (STRING c)))) (COMMAND (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING foobar)))))) (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING gunit) (REDIR >> (STRING filelist)))) (COMMAND (case (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING asdf))))) (CASE_PATTERN (STRING gz) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))) (CASE_PATTERN (STRING bzip) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING three)))) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING woo)))))) (COMMAND (for each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING 
 ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (VAR_REF each))) (COMMAND (STRING cat) (STRING each))))) (COMMAND (CFOR (FOR_INIT (+ 5 3)) (FOR_COND (+ 6 2)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 3 1)))) (COMMAND (select each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING output)))))) (LIST (COMMAND (STRING echo) (STRING asdf) (STRING 2) (REDIR > (STRING / dev / null)))))) (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))))) (COMMAND (until (LIST (COMMAND (COMPOUND_COND (KEYWORD_TEST (a (STRING this / is . afile)))))) (LIST (COMMAND (STRING touch) (STRING this / is . afile))))) (COMMAND (while (LIST (COMMAND (COMPOUND_COND (BUILTIN_TEST (n (STRING foobar)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file   found)))))) (COMMAND (IF_STATEMENT (if (LIST (COMMAND (COMPOUND_COND (BUILTIN_TEST (eq (STRING 5) (
 STRING 6)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING something ' s   wrong))))))) (COMMAND (STRING echo) (STRING this) (STRING command) (STRING has) (STRING multiple) (STRING arguments)) (COMMAND (STRING wc) (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING cat) (STRING / usr / share / dict / linux . words))))) (|| (&& (&& (&& (COMMAND (STRING cd) (STRING build)) (COMMAND (STRING . / configure))) (COMMAND (STRING make))) (COMMAND (STRING make_install))) (COMMAND (STRING echo) (STRING fail))) (COMMAND (STRING cd) (STRING / usr / bin)) (| (COMMAND (STRING ls) (STRING - al)) (COMMAND (STRING grep) (STRING more))) (COMMAND (VARIABLE_DEFINITIONS (= asdf (STRING parameters)))) (COMMAND (STRING (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING foo))))) (COMMAND (STRING (VAR_REF (OFFSET asdf 8)))) (COMMAND (STRING (VAR_REF (! asdf *)))) (COMMAND (STRING (VAR_REF (! asdf @)))) (COMMAND (STRING (VAR_REF (# foo)))) (COMMAND (STRING (VAR_REF (REPLACE_FIRST replaice
  (STRING with) (STRING pattern))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_START asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_START asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_END asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_END asdf (STRING bar))))) (COMMAND (STRING (VAR_REF 1)) (STRING (VAR_REF @)) (STRING (VAR_REF *))) (COMMAND (STRING (VAR_REF ?))) (COMMAND (STRING (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_START PV (STRING foo) (STRING bar))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_END PV (STRING foo) (STRING bar))))) (COMMAND (VARIABLE_DEFINITIONS (= MY_PN (STRING (VAR_REF (REPLACE_FIRST PN (STRING asterisk -))))))) (| (COMMAND (STRING cat) (STRING asdf)) (COMMAND (STRING grep) (STRING three) (STRING 2) (REDIR >& (FILE_DESCRIPTOR 1)) (REDIR > (STRING / dev / null)))) (COMMAND (STRING echo) (STRING asdf) (REDIR >> (STRING APPEND))) (COMMAND (STRING echo) (STRING cat) (
 <<< (STRING word))))
++(LIST (COMMAND (function (STRING lots_o_echo) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING The   number   of   tests   that   have   failed :   (VAR_REF failedtests)))) (COMMAND (STRING echo) (STRING (SINGLE_QUOTED_STRING '$failedtests'))) (COMMAND (STRING echo) (STRING (VAR_REF failedtests))))))) (COMMAND (function (STRING do_some_arith) (CURRENT_SHELL (LIST (COMMAND (ARITHMETIC_EXPRESSION (* 5 4))) (COMMAND (ARITHMETIC_EXPRESSION (** 5 4))) (COMMAND (ARITHMETIC_EXPRESSION (+ (VAR_REF failedtests) (/ 5 4)))) (COMMAND (ARITHMETIC_EXPRESSION (+ (VAR_REF z) (MINUS_SIGN 3)))))))) (COMMAND (function (STRING arrays) (SUBSHELL (LIST (COMMAND (VARIABLE_DEFINITIONS (= asdf (ARRAY (STRING a) (STRING b) (STRING c) (STRING d))))) (COMMAND (STRING echo) (STRING (VAR_REF (asdf 3)))) (COMMAND (VARIABLE_DEFINITIONS (= foo (ARRAY (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING 6))))) (STRING b) (STRING c) (STRING d))))) (COMMAND (VARIABLE_DEFINITIONS 
 (= (arr (VAR_REF foo)) (STRING 3)))) (COMMAND (VARIABLE_DEFINITIONS (= bar (ARRAY (STRING a) (STRING b) (= 5 (STRING c)))))))))) (COMMAND (STRING echo) (STRING (BRACE_EXP (STRING a) (STRING b)))) (COMMAND (STRING echo) (STRING (BRACE_EXP (.. a d)))) (COMMAND (STRING echo) (STRING (BRACE_EXP (STRING (BRACE_EXP (STRING a) (STRING b))) (STRING c) (STRING d)))) (COMMAND (STRING echo) (STRING a (BRACE_EXP (STRING b) (STRING c)))) (COMMAND (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING foobar)))))) (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING gunit) (REDIR >> (STRING filelist)))) (COMMAND (case (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING asdf))))) (CASE_PATTERN (STRING gz) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))) (CASE_PATTERN (STRING bzip) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING three)))) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING woo)))))) (COMMAND (for each (STRING (COMMAND_SU
 B (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (VAR_REF each))) (COMMAND (STRING cat) (STRING each))))) (COMMAND (CFOR (FOR_INIT (+ 5 3)) (FOR_COND (+ 6 2)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 3 1)))) (COMMAND (select each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING output)))))) (LIST (COMMAND (STRING echo) (STRING asdf) (STRING 2) (REDIR > (STRING / dev / null)))))) (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))))) (COMMAND (until (LIST (COMMAND (COMPOUND_COND (KEYWORD_TEST (a (STRING this / is . afile)))))) (LIST (COMMAND (STRING touch) (STRING this / is . afile))))) (COMMAND (while (LIST (COMMAND (COMPOUND_COND (BUILTIN_TEST (n (STRING foobar)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file   found)))))) (COMMAND (IF_STATEMENT (if (LIST (COMMAND (COMPOUND_COND (B
 UILTIN_TEST (eq (STRING 5) (STRING 6)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING something ' s   wrong))))))) (COMMAND (STRING echo) (STRING this) (STRING command) (STRING has) (STRING multiple) (STRING arguments)) (COMMAND (STRING wc) (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING cat) (STRING / usr / share / dict / linux . words))))) (|| (&& (&& (&& (COMMAND (STRING cd) (STRING build)) (COMMAND (STRING . / configure))) (COMMAND (STRING make))) (COMMAND (STRING make_install))) (COMMAND (STRING echo) (STRING fail))) (COMMAND (STRING cd) (STRING / usr / bin)) (| (COMMAND (STRING ls) (STRING - al)) (COMMAND (STRING grep) (STRING more))) (COMMAND (VARIABLE_DEFINITIONS (= asdf (STRING parameters)))) (COMMAND (STRING (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING foo))))) (COMMAND (STRING (VAR_REF (OFFSET asdf 8)))) (COMMAND (STRING (VAR_REF (! asdf *)))) (COMMAND (STRING (VAR_REF (! asdf @)))) (COMMAND (STRING (VAR_REF (# foo)))) (COMMAND (STRING (VAR
 _REF (REPLACE_FIRST replaice (STRING with) (STRING pattern))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_START asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_START asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_END asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_END asdf (STRING bar))))) (COMMAND (STRING (VAR_REF 1)) (STRING (VAR_REF @)) (STRING (VAR_REF *))) (COMMAND (STRING (VAR_REF ?))) (COMMAND (STRING (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_START PV (STRING foo) (STRING bar))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_END PV (STRING foo) (STRING bar))))) (COMMAND (VARIABLE_DEFINITIONS (= MY_PN (STRING (VAR_REF (REPLACE_FIRST PN (STRING asterisk -))))))) (| (COMMAND (STRING cat) (STRING asdf)) (COMMAND (STRING grep) (STRING three) (STRING 2) (REDIR >& (FILE_DESCRIPTOR 1)) (REDIR > (STRING / dev / null)))) (COMMAND (STRING echo) (STRING asdf) (REDIR >> (STRING APPEND))) (COMMAND 
 (STRING echo) (STRING cat) (<<< (STRING word))))
diff --cc bashast/features_script/features.sh.walker.tokens
index 255caa7,0000000..14b0536
mode 100644,000000..100644
--- a/bashast/features_script/features.sh.walker.tokens
+++ b/bashast/features_script/features.sh.walker.tokens
@@@ -1,2 -1,0 +1,2 @@@
- LIST DOWN COMMAND DOWN FUNCTION DOWN STRING DOWN NAME UP CURRENT_SHELL DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN DOUBLE_QUOTED_STRING DOWN NAME BLANK NAME BLANK NAME BLANK NAME BLANK NAME BLANK NAME BLANK NAME COLON BLANK VAR_REF DOWN NAME UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN SINGLE_QUOTED_STRING DOWN DOLLAR NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN VAR_REF DOWN NAME UP UP UP UP UP UP UP COMMAND DOWN FUNCTION DOWN STRING DOWN NAME UP CURRENT_SHELL DOWN LIST DOWN COMMAND DOWN ARITHMETIC_EXPRESSION DOWN TIMES DOWN DIGIT DIGIT UP UP UP COMMAND DOWN ARITHMETIC_EXPRESSION DOWN EXP DOWN DIGIT DIGIT UP UP UP COMMAND DOWN ARITHMETIC_EXPRESSION DOWN PLUS DOWN VAR_REF DOWN NAME UP SLASH DOWN DIGIT DIGIT UP UP UP UP COMMAND DOWN ARITHMETIC_EXPRESSION DOWN PLUS DOWN VAR_REF DOWN LETTER UP MINUS_SIGN DOWN DIGIT UP UP UP UP UP UP UP UP COMMAND DOWN FUNCTION DOWN STRING DOWN NAME UP SUBSHELL DOWN LIST DOWN COMMAND DOWN VARIABLE_DEFINI
 TIONS DOWN EQUALS DOWN NAME ARRAY DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN VAR_REF DOWN NAME DOWN DIGIT UP UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME ARRAY DOWN STRING DOWN COMMAND_SUB DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN DIGIT UP UP UP UP UP STRING DOWN LETTER UP STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME DOWN VAR_REF DOWN NAME UP UP STRING DOWN DIGIT UP UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME ARRAY DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP EQUALS DOWN DIGIT STRING DOWN LETTER UP UP UP UP UP UP UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN BRACE_EXP DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN BRACE_EXP DOWN DOTDOT DOWN LETTER LETTER UP UP UP UP COMMAND DO
 WN STRING DOWN NAME UP STRING DOWN BRACE_EXP DOWN STRING DOWN BRACE_EXP DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN LETTER BRACE_EXP DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP COMMAND DOWN STRING DOWN COMMAND_SUB DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP PIPE DOWN COMMAND DOWN STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP REDIR DOWN OP STRING DOWN NAME UP UP UP UP COMMAND DOWN CASE DOWN STRING DOWN COMMAND_SUB DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP CASE_PATTERN DOWN STRING DOWN NAME UP CASE_COMMAND LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP CASE_PATTERN DOWN STRING DOWN NAME UP CASE_COMMAND LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP CASE_PATTERN DOWN STRING DOWN MATCH_ALL UP CASE_COMMAN
 D LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP COMMAND DOWN FOR DOWN NAME STRING DOWN COMMAND_SUB DOWN LIST DOWN PIPE DOWN COMMAND DOWN STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN VAR_REF DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP COMMAND DOWN CFOR DOWN FOR_INIT DOWN PLUS DOWN DIGIT DIGIT UP UP FOR_COND DOWN PLUS DOWN DIGIT DIGIT UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP FOR_MOD DOWN PLUS DOWN DIGIT DIGIT UP UP UP UP COMMAND DOWN SELECT DOWN NAME STRING DOWN COMMAND_SUB DOWN LIST DOWN PIPE DOWN COMMAND DOWN STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN DIGIT UP REDIR DOWN GREATER_THAN STRING DOWN SLASH NAME SLASH NAME UP UP UP UP UP UP COMMAND DOWN IF_
 STATEMENT DOWN IF DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP COMMAND DOWN UNTIL DOWN LIST DOWN COMMAND DOWN COMPOUND_COND DOWN KEYWORD_TEST DOWN LETTER DOWN STRING DOWN NAME SLASH NAME DOT NAME UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME SLASH NAME DOT NAME UP UP UP UP UP COMMAND DOWN WHILE DOWN LIST DOWN COMMAND DOWN COMPOUND_COND DOWN BUILTIN_TEST DOWN LETTER DOWN STRING DOWN NAME UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN DOUBLE_QUOTED_STRING DOWN NAME BLANK NAME UP UP UP UP UP UP COMMAND DOWN IF_STATEMENT DOWN IF DOWN LIST DOWN COMMAND DOWN COMPOUND_COND DOWN BUILTIN_TEST DOWN NAME DOWN STRING DOWN DIGIT UP STRING DOWN DIGIT UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN DOUBLE_QUOTED_STRING DOWN NAME SQUOTE LETTER BLANK NAME UP UP UP UP UP UP UP COMMAND DOWN STRING DOWN NAME
  UP STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP PROCESS_SUBSTITUTION DOWN LESS_THAN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN SLASH NAME SLASH NAME SLASH NAME SLASH NAME DOT NAME UP UP UP UP UP LOGICOR DOWN LOGICAND DOWN LOGICAND DOWN LOGICAND DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN DOT SLASH NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN SLASH NAME SLASH NAME UP UP PIPE DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN MINUS NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME STRING DOWN NAME UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN USE_DEFAULT_WHEN_UNSET_OR_NULL DOWN NAME STRING DOWN NAME UP UP UP
  UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN OFFSET DOWN NAME DIGIT UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN BANG DOWN NAME TIMES UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN BANG DOWN NAME AT UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN POUND DOWN NAME UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_FIRST DOWN NAME STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN LAZY_REMOVE_AT_START DOWN NAME STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_AT_START DOWN NAME STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN LAZY_REMOVE_AT_END DOWN NAME STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN LAZY_REMOVE_AT_END DOWN NAME STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN DIGIT UP UP STRING DOWN VAR_REF DOWN AT UP UP STRING DOWN VAR_REF DOWN TIMES UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN QMARK UP UP UP COMMAND DOWN STRI
 NG DOWN VAR_REF DOWN REPLACE_ALL DOWN NAME STRING DOWN DOT UP STRING DOWN UNDERSCORE UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_AT_START DOWN NAME STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_AT_END DOWN NAME STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME STRING DOWN VAR_REF DOWN REPLACE_FIRST DOWN NAME STRING DOWN NAME MINUS UP UP UP UP UP UP UP PIPE DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN DIGIT UP REDIR DOWN OP FILE_DESCRIPTOR DOWN DIGIT UP UP REDIR DOWN GREATER_THAN STRING DOWN SLASH NAME SLASH NAME UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP REDIR DOWN OP STRING DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP HERE_STRING_OP DOWN STRING DOWN NAME UP UP UP UP 
++LIST DOWN COMMAND DOWN FUNCTION DOWN STRING DOWN NAME UP CURRENT_SHELL DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN DOUBLE_QUOTED_STRING DOWN NAME BLANK NAME BLANK NAME BLANK NAME BLANK NAME BLANK NAME BLANK NAME COLON BLANK VAR_REF DOWN NAME UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN SINGLE_QUOTED_STRING DOWN SINGLE_QUOTED_STRING_TOKEN UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN VAR_REF DOWN NAME UP UP UP UP UP UP UP COMMAND DOWN FUNCTION DOWN STRING DOWN NAME UP CURRENT_SHELL DOWN LIST DOWN COMMAND DOWN ARITHMETIC_EXPRESSION DOWN TIMES DOWN DIGIT DIGIT UP UP UP COMMAND DOWN ARITHMETIC_EXPRESSION DOWN EXP DOWN DIGIT DIGIT UP UP UP COMMAND DOWN ARITHMETIC_EXPRESSION DOWN PLUS DOWN VAR_REF DOWN NAME UP SLASH DOWN DIGIT DIGIT UP UP UP UP COMMAND DOWN ARITHMETIC_EXPRESSION DOWN PLUS DOWN VAR_REF DOWN LETTER UP MINUS_SIGN DOWN DIGIT UP UP UP UP UP UP UP UP COMMAND DOWN FUNCTION DOWN STRING DOWN NAME UP SUBSHELL DOWN LIST DOWN COMMAND DOWN 
 VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME ARRAY DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN VAR_REF DOWN NAME DOWN DIGIT UP UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME ARRAY DOWN STRING DOWN COMMAND_SUB DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN DIGIT UP UP UP UP UP STRING DOWN LETTER UP STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME DOWN VAR_REF DOWN NAME UP UP STRING DOWN DIGIT UP UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME ARRAY DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP EQUALS DOWN DIGIT STRING DOWN LETTER UP UP UP UP UP UP UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN BRACE_EXP DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN BRACE_EXP DOWN DOTDOT DOWN LETTER LETTER UP UP U
 P UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN BRACE_EXP DOWN STRING DOWN BRACE_EXP DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN LETTER BRACE_EXP DOWN STRING DOWN LETTER UP STRING DOWN LETTER UP UP UP UP COMMAND DOWN STRING DOWN COMMAND_SUB DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP PIPE DOWN COMMAND DOWN STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP REDIR DOWN OP STRING DOWN NAME UP UP UP UP COMMAND DOWN CASE DOWN STRING DOWN COMMAND_SUB DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP CASE_PATTERN DOWN STRING DOWN NAME UP CASE_COMMAND LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP CASE_PATTERN DOWN STRING DOWN NAME UP CASE_COMMAND LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP CASE_PATTERN DOWN STRING DOWN MATCH_ALL
  UP CASE_COMMAND LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP COMMAND DOWN FOR DOWN NAME STRING DOWN COMMAND_SUB DOWN LIST DOWN PIPE DOWN COMMAND DOWN STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN VAR_REF DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP COMMAND DOWN CFOR DOWN FOR_INIT DOWN PLUS DOWN DIGIT DIGIT UP UP FOR_COND DOWN PLUS DOWN DIGIT DIGIT UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP FOR_MOD DOWN PLUS DOWN DIGIT DIGIT UP UP UP UP COMMAND DOWN SELECT DOWN NAME STRING DOWN COMMAND_SUB DOWN LIST DOWN PIPE DOWN COMMAND DOWN STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN DIGIT UP REDIR DOWN GREATER_THAN STRING DOWN SLASH NAME SLASH NAME UP UP UP UP UP UP C
 OMMAND DOWN IF_STATEMENT DOWN IF DOWN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP UP COMMAND DOWN UNTIL DOWN LIST DOWN COMMAND DOWN COMPOUND_COND DOWN KEYWORD_TEST DOWN LETTER DOWN STRING DOWN NAME SLASH NAME DOT NAME UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME SLASH NAME DOT NAME UP UP UP UP UP COMMAND DOWN WHILE DOWN LIST DOWN COMMAND DOWN COMPOUND_COND DOWN BUILTIN_TEST DOWN LETTER DOWN STRING DOWN NAME UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN DOUBLE_QUOTED_STRING DOWN NAME BLANK NAME UP UP UP UP UP UP COMMAND DOWN IF_STATEMENT DOWN IF DOWN LIST DOWN COMMAND DOWN COMPOUND_COND DOWN BUILTIN_TEST DOWN NAME DOWN STRING DOWN DIGIT UP STRING DOWN DIGIT UP UP UP UP UP UP LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN DOUBLE_QUOTED_STRING DOWN NAME SQUOTE LETTER BLANK NAME UP UP UP UP UP UP UP COMMAND DOWN S
 TRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP PROCESS_SUBSTITUTION DOWN LESS_THAN LIST DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN SLASH NAME SLASH NAME SLASH NAME SLASH NAME DOT NAME UP UP UP UP UP LOGICOR DOWN LOGICAND DOWN LOGICAND DOWN LOGICAND DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN DOT SLASH NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN SLASH NAME SLASH NAME UP UP PIPE DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN MINUS NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME STRING DOWN NAME UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN USE_DEFAULT_WHEN_UNSET_OR_NULL DOWN NAME STRING DOW
 N NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN OFFSET DOWN NAME DIGIT UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN BANG DOWN NAME TIMES UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN BANG DOWN NAME AT UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN POUND DOWN NAME UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_FIRST DOWN NAME STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN LAZY_REMOVE_AT_START DOWN NAME STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_AT_START DOWN NAME STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN LAZY_REMOVE_AT_END DOWN NAME STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN LAZY_REMOVE_AT_END DOWN NAME STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN DIGIT UP UP STRING DOWN VAR_REF DOWN AT UP UP STRING DOWN VAR_REF DOWN TIMES UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN QMARK UP UP UP CO
 MMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_ALL DOWN NAME STRING DOWN DOT UP STRING DOWN UNDERSCORE UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_AT_START DOWN NAME STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP COMMAND DOWN STRING DOWN VAR_REF DOWN REPLACE_AT_END DOWN NAME STRING DOWN NAME UP STRING DOWN NAME UP UP UP UP UP COMMAND DOWN VARIABLE_DEFINITIONS DOWN EQUALS DOWN NAME STRING DOWN VAR_REF DOWN REPLACE_FIRST DOWN NAME STRING DOWN NAME MINUS UP UP UP UP UP UP UP PIPE DOWN COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP STRING DOWN DIGIT UP REDIR DOWN OP FILE_DESCRIPTOR DOWN DIGIT UP UP REDIR DOWN GREATER_THAN STRING DOWN SLASH NAME SLASH NAME UP UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP REDIR DOWN OP STRING DOWN NAME UP UP UP COMMAND DOWN STRING DOWN NAME UP STRING DOWN NAME UP HERE_STRING_OP DOWN STRING DOWN NAME UP UP UP UP 
 +
diff --cc bashast/gunit/simp_command.gunit
index 76af49b,da899bb..db26ab4
--- a/bashast/gunit/simp_command.gunit
+++ b/bashast/gunit/simp_command.gunit
@@@ -28,7 -28,7 +28,8 @@@ simple_command
  "cat ~/Documents/todo.txt" -> (STRING cat) (STRING ~ / Documents / todo . txt)
  "dodir ${foo}/${bar}" -> (STRING dodir) (STRING (VAR_REF foo) / (VAR_REF bar))
  "local a=123 b=(1 2 3) c" -> (VARIABLE_DEFINITIONS local (= a (STRING 123)) (= b (ARRAY (STRING 1) (STRING 2) (STRING 3))) (EQUALS c))
 +"echo {}{}}{{{}}{{}" -> (STRING echo) (STRING { } { } } { { { } } { { })
+ "echo \"ab#af ###\" #abc" -> (STRING echo) (STRING (DOUBLE_QUOTED_STRING ab # af   ## #))
  
  command:
  "asdf=5 cat out.log > result" -> (COMMAND (STRING cat) (STRING out . log) (= asdf (STRING 5)) (REDIR > (STRING result)))
diff --cc scripts/command_execution.bash
index d485d57,365f199..76e9c4c
--- a/scripts/command_execution.bash
+++ b/scripts/command_execution.bash
@@@ -55,4 -55,4 +55,5 @@@ shopt -s extglo
  shopt -p
  printf "%s %s\n" abc def
  printf "%s %s\n" $FOO001, def
 +((FOO010=1))
+ echo "abc #av### ##" # for comment



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-25 10:30 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-25 10:30 UTC (permalink / raw
  To: gentoo-commits

commit:     a0f1ce8a10a50a732a9aaec80a51df8f72120c78
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Jun 25 10:26:05 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Jun 25 10:26:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=a0f1ce8a

Merge remote-tracking branch 'mu/fix_arithmetic'


 Makefile.am                                       |    1 +
 bashast/bashast.g                                 |    9 ++---
 bashast/features_script/features.sh.ast           |    2 +-
 bashast/features_script/features.sh.walker.tokens |    2 +
 bashast/gunit/compound.gunit                      |   10 +++---
 bashast/gunit/expansions.gunit                    |    4 +-
 bashast/libbashWalker.g                           |   35 ++++++++++++++++--
 scripts/binary_arithmetic.bash                    |    2 +
 scripts/binary_arithmetic.bash.result             |    2 +
 scripts/command_execution.bash                    |    1 +
 scripts/command_execution.bash.result             |    1 +
 src/core/bash_ast.cpp                             |   22 +++++++++++-
 src/core/bash_ast.h                               |    4 ++-
 test/ast_printer_test.sh                          |    4 ++
 utils/ast_printer.cpp                             |   40 +++++++++++++++++----
 15 files changed, 114 insertions(+), 25 deletions(-)



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-25 10:05 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-25 10:05 UTC (permalink / raw
  To: gentoo-commits

commit:     95c82eca762174b0d329af65029fd2e1a280232b
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Jun 25 10:04:08 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Jun 25 10:04:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=95c82eca

Merge remote-tracking branch 'mu/break_builtin'

Conflicts:
	src/builtins/builtin_exceptions.h


 Makefile.am                                        |    3 +
 bashast/libbashWalker.g                            |   28 ++++++-
 scripts/compound_command.bash                      |   87 ++++++++++++++++++++
 scripts/compound_command.bash.result               |   10 ++-
 .../{continue_builtin.cpp => break_builtin.cpp}    |   16 ++--
 src/builtins/{let_builtin.h => break_builtin.h}    |   12 ++--
 src/builtins/builtin_exceptions.h                  |   46 +++++++++--
 .../tests/{continue_tests.cpp => break_tests.cpp}  |   26 +++---
 src/cppbash_builtin.cpp                            |    2 +
 9 files changed, 189 insertions(+), 41 deletions(-)

diff --cc src/builtins/builtin_exceptions.h
index 9b0c1d8,c535417..7b45efc
--- a/src/builtins/builtin_exceptions.h
+++ b/src/builtins/builtin_exceptions.h
@@@ -59,6 -61,36 +61,36 @@@ public
    }
  };
  
+ class continue_exception: public loop_control_exception
+ {
+ protected:
+   virtual void rethrow()
+   {
+     throw *this;
+   }
+ 
+ public:
+   explicit continue_exception(int c): loop_control_exception(c) {
+     if(c < 1)
 -      throw libbash::interpreter_exception("continue: argument should be greater than or equal to 1");
++      throw libbash::illegal_argument_exception("continue: argument should be greater than or equal to 1");
+   }
+ };
+ 
+ class break_exception: public loop_control_exception
+ {
+ protected:
+   virtual void rethrow()
+   {
+     throw *this;
+   }
+ 
+ public:
+   explicit break_exception(int c): loop_control_exception(c) {
+     if(c < 1)
 -      throw libbash::interpreter_exception("break: argument should be greater than or equal to 1");
++      throw libbash::illegal_argument_exception("break: argument should be greater than or equal to 1");
+   }
+ };
+ 
  class suppress_output: public std::exception
  {
  };



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-16 16:53 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-16 16:53 UTC (permalink / raw
  To: gentoo-commits

commit:     6911bc054a5684377ab303a3133ca91349675b30
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Thu Jun 16 16:49:41 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Jun 16 16:49:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=6911bc05

Merge remote-tracking branch 'mu/bash_options' into review

Conflicts:
	bashast/libbashWalker.g
	src/core/interpreter.cpp
	src/core/tests/interpreter_test.cpp


 bashast/libbashWalker.g             |    6 ++-
 scripts/var_def.bash                |    2 +-
 scripts/var_def.bash.result         |    2 +-
 src/builtins/shopt_builtin.cpp      |    4 +-
 src/builtins/tests/shopt_tests.cpp  |   10 +++---
 src/core/interpreter.cpp            |   55 ++++++++++++++++++++++++++++++----
 src/core/interpreter.h              |   18 +++++++----
 src/core/tests/interpreter_test.cpp |   19 ++++++++----
 utils/variable_printer.cpp          |    2 +-
 9 files changed, 86 insertions(+), 32 deletions(-)

diff --cc bashast/libbashWalker.g
index 9d297d2,458dcd8..f74f64e
--- a/bashast/libbashWalker.g
+++ b/bashast/libbashWalker.g
@@@ -247,8 -247,8 +247,8 @@@ bash_pattern[boost::xpressive::sregex& 
  	bool do_append = false;
  	sregex pattern_list;
  	auto check_extglob = [&]() {
- 		if(!walker->get_option("extglob"))
+ 		if(!walker->get_additional_option("extglob"))
 -			throw interpreter_exception("Entered extended pattern matching with extglob disabled");
 +			throw libbash::interpreter_exception("Entered extended pattern matching with extglob disabled");
  	};
  }
  	:^(STRING (
diff --cc src/core/interpreter.cpp
index c71233d,eca7987..d34ce96
--- a/src/core/interpreter.cpp
+++ b/src/core/interpreter.cpp
@@@ -372,20 -413,20 +413,20 @@@ void interpreter::unset(const std::stri
    }
  }
  
- bool interpreter::get_option(const std::string& name) const
+ bool interpreter::get_additional_option(const std::string& name) const
  {
-   auto iter = bash_options.find(name);
-   if(iter == bash_options.end())
+   auto iter = additional_options.find(name);
+   if(iter == additional_options.end())
 -    throw interpreter_exception("Invalid bash option");
 +    throw libbash::interpreter_exception("Invalid bash option");
  
    return iter->second;
  }
  
- void interpreter::set_option(const std::string& name, bool value)
+ void interpreter::set_additional_option(const std::string& name, bool value)
  {
-   auto iter = bash_options.find(name);
-   if(iter == bash_options.end())
+   auto iter = additional_options.find(name);
+   if(iter == additional_options.end())
 -    throw interpreter_exception(name + " is not a valid bash option");
 +    throw libbash::interpreter_exception(name + " is not a valid bash option");
  
    iter->second = value;
  }
diff --cc src/core/tests/interpreter_test.cpp
index 678ac00,54971ab..f207bfb
--- a/src/core/tests/interpreter_test.cpp
+++ b/src/core/tests/interpreter_test.cpp
@@@ -240,10 -240,17 +240,17 @@@ TEST(interpreter, bash_additional_optio
  {
    interpreter walker;
  
-   EXPECT_THROW(walker.set_option("not exist", false), libbash::interpreter_exception);
-   EXPECT_THROW(walker.get_option("not exist"), libbash::interpreter_exception);
 -  EXPECT_THROW(walker.set_additional_option("not exist", false), interpreter_exception);
 -  EXPECT_THROW(walker.get_additional_option("not exist"), interpreter_exception);
++  EXPECT_THROW(walker.set_additional_option("not exist", false), libbash::interpreter_exception);
++  EXPECT_THROW(walker.get_additional_option("not exist"), libbash::interpreter_exception);
+ 
+   EXPECT_FALSE(walker.get_additional_option("extglob"));
+   walker.set_additional_option("extglob", true);
+   EXPECT_TRUE(walker.get_additional_option("extglob"));
+ }
+ 
+ TEST(interpreter, bash_option)
+ {
+   interpreter walker;
  
-   EXPECT_FALSE(walker.get_option("extglob"));
-   walker.set_option("extglob", true);
-   EXPECT_TRUE(walker.get_option("extglob"));
+   EXPECT_STREQ("Bh", walker.resolve<std::string>("-").c_str());
  }



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-11  8:52 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-11  8:52 UTC (permalink / raw
  To: gentoo-commits

commit:     f9612e1b3e07cc64dbfb72406d3e7d03b2fa07df
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Jun 11 08:44:35 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 08:44:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=f9612e1b

Merge remote-tracking branch 'mu/array_expansion'


 bashast/bashast.g                 |   12 ++--
 bashast/gunit/array.gunit         |   12 ++--
 bashast/libbashWalker.g           |   44 ++++++------
 scripts/function_def.bash         |    8 ++
 scripts/function_def.bash.result  |    8 ++
 scripts/var_def.bash              |    3 -
 scripts/var_def.bash.result       |    2 -
 scripts/var_expansion.bash        |   25 +++++--
 scripts/var_expansion.bash.result |   23 +++++--
 src/core/interpreter.cpp          |  134 +++++++++++++++++++------------------
 src/core/interpreter.h            |   24 ++++++-
 test/script_compiler.sh           |    5 +-
 12 files changed, 179 insertions(+), 121 deletions(-)



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-11  8:52 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-11  8:52 UTC (permalink / raw
  To: gentoo-commits

commit:     5847bc6dec1069e75abe343fc29dfd04b4df31a6
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Jun 11 08:42:00 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 08:42:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=5847bc6d

Merge remote-tracking branch 'mu/simplify_arithmetic'


 bashast/libbashWalker.g          |  241 ++++++++++++++++++++++------------
 src/builtins/inherit_builtin.cpp |    4 +-
 src/core/interpreter.cpp         |   27 +----
 src/core/interpreter.h           |  268 +-------------------------------------
 4 files changed, 164 insertions(+), 376 deletions(-)



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-11  8:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-11  8:24 UTC (permalink / raw
  To: gentoo-commits

commit:     4e4605d4324daf9e000a1432ba1698977fe3d95b
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Thu Jun  9 21:37:22 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 14:51:44 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=4e4605d4

Build: rebuild libbashWalker.g less often

libbashWalker.g must be rebuild only when the set of tokens changes. Now
we use a md5 trick to check if the tokens file has really changed
instead of relying on modification times.

---
 .gitignore  |    1 +
 Makefile.am |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index db37cad..4c665a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@ long.sh
 massif.out
 libbash.g
 libbash.tokens
+libbash.tokens.md5
 bashast.tokens
 bashast/.DS_Store
 bashast/*.ebuild

diff --git a/Makefile.am b/Makefile.am
index 15d4b65..826970a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -163,6 +163,7 @@ CLEANFILES = $(GENERATED_PARSER_C) \
 			 $(check_JAVA) \
 			 libbash.g \
 			 libbash.tokens \
+			 libbash.tokens.md5 \
 			 bashast/bashast.tokens \
 			 libbashWalker.tokens \
 			 javagrammar.run \
@@ -277,9 +278,13 @@ libbash.g: bashast/bashast.g
 				  -e 's/language	= Java;/language	= C;/g' \
 				  -e 's/grammar bashast;/grammar libbash;/g' $< > $@
 
+# http://www.kolpackov.net/pipermail/notes/2004-September.txt
+libbash.tokens.md5: libbash.tokens
+	$(AM_V_at)md5sum $< | cmp -s $@ -; if test $$? -ne 0; then md5sum $< > $@; fi
+
 # Avoid initializing C++ type to NULL by sed, variables whose name
 # starts with libbash_ will be stripped
-walker.run: bashast/libbashWalker.g cgrammar.run
+walker.run: bashast/libbashWalker.g libbash.tokens.md5
 	$(AM_V_at)touch $@.tmp
 	$(AM_V_GEN)$(ANTLR) -fo . $<
 	$(AM_V_at)sed -i -e 's/\(libbash_.*\) = NULL/\1/' libbashWalker.c
@@ -288,6 +293,7 @@ walker.run: bashast/libbashWalker.g cgrammar.run
 
 $(GENERATED_PARSER_C): cgrammar.run
 $(GENERATED_PARSER_H): cgrammar.run
+libbash.tokens: cgrammar.run
 
 $(GENERATED_WALKER_CPP): walker.run
 $(GENERATED_WALKER_H): walker.run



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-03 14:48 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-03 14:48 UTC (permalink / raw
  To: gentoo-commits

commit:     e974841ac146b836c24a8ba4e9030296fa13abe9
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri Jun  3 14:47:06 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 14:47:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=e974841a

Merge remote-tracking branch 'mu/redirection' into review

Conflicts:
	src/core/interpreter.cpp


 bashast/bashast.g                       |    9 ++---
 bashast/features_script/features.sh.ast |    2 +-
 bashast/gunit/compound.gunit            |    4 +-
 bashast/gunit/list.gunit                |    4 +-
 bashast/gunit/redir.gunit               |    5 ++-
 bashast/libbashWalker.g                 |   52 ++++++++++++++++++++++++------
 scripts/command_execution.bash          |    2 +-
 scripts/command_execution.bash.result   |    1 -
 src/core/interpreter.cpp                |    2 +-
 src/core/interpreter.h                  |   24 +++++++++-----
 10 files changed, 71 insertions(+), 34 deletions(-)

diff --cc src/core/interpreter.cpp
index b0d32c0,3a065cb..e08fd57
--- a/src/core/interpreter.cpp
+++ b/src/core/interpreter.cpp
@@@ -40,7 -38,9 +40,7 @@@
  #include "core/unset_exception.h"
  #include "libbashWalker.h"
  
- interpreter::interpreter(): out(&std::cout), err(&std::cerr), in(&std::cin), bash_options(
 -#include "core/interpreter.h"
 -
+ interpreter::interpreter(): _out(&std::cout), _err(&std::cerr), _in(&std::cin), bash_options(
      {
        {"autocd", false},
        {"cdable_vars", false},



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-06-03 12:43 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-06-03 12:43 UTC (permalink / raw
  To: gentoo-commits

commit:     85725730eaaafbbf3afeb7a220d21c42e2b2d836
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri Jun  3 12:39:17 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 12:39:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=85725730

Merge remote-tracking branch 'mu/keyword_test' into review

Conflicts:
	src/builtins/let_builtin.cpp
	src/core/interpreter.cpp


 bashast/libbashWalker.g                |   19 +++++++---
 scripts/test_expr.bash                 |   10 +++++
 scripts/test_expr.bash.result          |    4 ++
 src/builtins/let_builtin.cpp           |    9 ++---
 src/core/bash_condition.cpp            |   17 +++++----
 src/core/bash_condition.h              |    5 ++-
 src/core/interpreter.cpp               |    7 ++++
 src/core/interpreter.h                 |    5 +++
 src/core/tests/bash_condition_test.cpp |   62 ++++++++++++++++++--------------
 9 files changed, 92 insertions(+), 46 deletions(-)

diff --cc src/builtins/let_builtin.cpp
index b1dd9b7,97785ab..5f1f9e5
--- a/src/builtins/let_builtin.cpp
+++ b/src/builtins/let_builtin.cpp
@@@ -23,10 -24,9 +23,8 @@@
  #include <sstream>
  
  #include <boost/algorithm/string/join.hpp>
- #include <boost/numeric/conversion/cast.hpp>
- 
- #include "core/bash_ast.h"
  
 -#include "core/bash_ast.h"
 -
++#include "core/interpreter.h"
  #include "builtins/let_builtin.h"
  
  int let_builtin::exec(const std::vector<std::string>& bash_args)
diff --cc src/core/interpreter.cpp
index d3c078e,83fd29a..ce1d2d8
--- a/src/core/interpreter.cpp
+++ b/src/core/interpreter.cpp
@@@ -419,10 -414,8 +420,16 @@@ void interpreter::set_option(const std:
    iter->second = value;
  }
  
 +int interpreter::exp(int left, int right)
 +{
 +  int init = 1;
 +  while(right--)
 +    init *= left;
 +  return init;
 +}
++
+ int interpreter::eval_arithmetic(const std::string& expression)
+ {
+   bash_ast ast(std::stringstream(expression), &bash_ast::parser_arithmetics);
+   return ast.interpret_with(*this, &bash_ast::walker_arithmetics);
+ }



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-05-27 23:03 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-05-27 23:03 UTC (permalink / raw
  To: gentoo-commits

commit:     bfeb754803ae1078046fd576151b5f387045c9d1
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri May 27 22:59:36 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri May 27 22:59:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=bfeb7548

Merge remote-tracking branch 'mu/test_coverage' into review


 src/builtins/source_builtin.cpp        |    3 +++
 src/builtins/tests/declare_tests.cpp   |    8 ++++++++
 src/builtins/tests/return_tests.cpp    |    1 +
 src/builtins/tests/shopt_tests.cpp     |   20 ++++++++++++++++++--
 src/builtins/tests/source_tests.cpp    |   19 +++++++++++++++++++
 src/core/interpreter.cpp               |    3 ++-
 src/core/tests/bash_ast_test.cpp       |    5 +++++
 src/core/tests/bash_condition_test.cpp |    5 +++++
 src/core/tests/interpreter_test.cpp    |   15 ++++++++++++++-
 test/api_test.cpp                      |    5 +++++
 10 files changed, 80 insertions(+), 4 deletions(-)

diff --cc src/core/tests/interpreter_test.cpp
index d64866f,d5e5d4a..6a39591
--- a/src/core/tests/interpreter_test.cpp
+++ b/src/core/tests/interpreter_test.cpp
@@@ -195,25 -170,14 +199,26 @@@ TEST(interpreter, unset_variables
    EXPECT_STREQ("123", walker.resolve<string>("var").c_str());
    walker.unset("var");
    EXPECT_STREQ("", walker.resolve<string>("var").c_str());
 +  walker.unset("var");
 +
 +  EXPECT_THROW(walker.unset("ro_var"), unset_exception);
 +  EXPECT_THROW(walker.unset("ro_local_var"), unset_exception);
 +  EXPECT_THROW(walker.unset("1"), interpreter_exception);
 +}
  
 -  EXPECT_THROW(walker.unset("ro_var"), interpreter_exception);
 +TEST(interpreter, unset_functions)
 +{
 +  interpreter walker;
 +  walker.define_function("foo", 0);
 +  EXPECT_TRUE(walker.has_function("foo"));
 +  walker.unset_function("foo");
 +  EXPECT_FALSE(walker.has_function("foo"));
  }
  
- TEST(interperter, substring_expansion_exception)
+ TEST(interperter, substring_expansion)
  {
    interpreter walker;
+   EXPECT_STREQ("", walker.do_substring_expansion("@", 0, 1, 2).c_str());
    EXPECT_THROW(walker.do_substring_expansion("", 0, -1, 0), interpreter_exception);
  }
  



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-05-24 14:50 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-05-24 14:50 UTC (permalink / raw
  To: gentoo-commits

commit:     dd5cbd758e004e0ae07914a6e03484b3414322b4
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Tue May 24 14:47:04 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Tue May 24 14:47:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=dd5cbd75

Merge remote-tracking branch 'mu/declare_builtin' into review

Conflicts:
	scripts/command_execution.bash
	scripts/command_execution.bash.result
	scripts/function_def.bash
	scripts/function_def.bash.result


 Makefile.am                                        |    3 +
 bashast/libbashWalker.g                            |   24 ++++++-
 scripts/command_execution.bash                     |    2 +
 scripts/command_execution.bash.result              |    1 +
 scripts/function_def.bash                          |   13 ++++
 scripts/function_def.bash.result                   |    1 +
 src/builtins/declare_builtin.cpp                   |   66 ++++++++++++++++++++
 .../{source_builtin.h => declare_builtin.h}        |   32 +++++-----
 src/builtins/tests/declare_tests.cpp               |   66 ++++++++++++++++++++
 src/cppbash_builtin.cpp                            |    2 +
 10 files changed, 191 insertions(+), 19 deletions(-)

diff --cc Makefile.am
index bd0bf7b,c8c702b..c4605cd
--- a/Makefile.am
+++ b/Makefile.am
@@@ -97,8 -97,8 +97,9 @@@ cppunittests_SOURCES =  test/run_tests.
  						src/core/tests/symbols_test.cpp \
  						src/core/tests/interpreter_test.cpp \
  						src/core/tests/bash_ast_test.cpp \
 +						src/core/tests/bash_condition_test.cpp \
  						src/builtins/tests/echo_tests.cpp \
+ 						src/builtins/tests/declare_tests.cpp \
  						src/builtins/tests/boolean_tests.cpp \
  						src/builtins/tests/source_tests.cpp \
  						src/builtins/tests/return_tests.cpp \
diff --cc scripts/command_execution.bash
index 6e655e4,344618e..95e1594
--- a/scripts/command_execution.bash
+++ b/scripts/command_execution.bash
@@@ -15,5 -16,4 +16,6 @@@ true || echo "wrong
  echo "end"
  : ${DEFAULTED:="yes"}
  FOO="abc" echo "command environment"
 +export FOO003=1 FOO004=abc FOO005=(1 2 3) FOO002
 +abc=1 export foo
+ true > /dev/null
diff --cc scripts/command_execution.bash.result
index 9f2ba11,bd09a8b..ae71fa5
--- a/scripts/command_execution.bash.result
+++ b/scripts/command_execution.bash.result
@@@ -4,7 -4,7 +4,8 @@@ righ
  right
  end
  command environment
 +We do not support command env before the export builtin.
+ Redirection is not supported yet
  DEFAULTED=yes
  FOO001=hello
  FOO002=Hello World
diff --cc scripts/function_def.bash
index ac99f83,101e732..5be1e36
--- a/scripts/function_def.bash
+++ b/scripts/function_def.bash
@@@ -52,15 -52,15 +52,28 @@@ func_nested2() 
      func_nested1
  }
  func_nested2
+ 
 +let() {
 +    echo "overloaded let"
 +}
 +let "1 + 2"
 +func_positional_args() {
 +    IFS="abc" echo "$*"
 +    IFS="abc" echo $*
 +    IFS=abc
 +    echo "$*"
 +    echo $*
 +}
 +func_positional_args 1 2 3
++
+ if true; then
+     function_in_compound_statement() {
+         echo "function_in_compound_statement"
+     }
+ fi
+ if false; then
+     function_in_compound_statement() {
+         echo "I should not get called"
+     }
+ fi
+ function_in_compound_statement
diff --cc scripts/function_def.bash.result
index e4cdd82,a1c9b91..d3abad0
--- a/scripts/function_def.bash.result
+++ b/scripts/function_def.bash.result
@@@ -1,9 -1,5 +1,10 @@@
  hi 1
 +overloaded let
 +1 2 3
 +1 2 3
 +1a2a3
 +1 2 3
+ function_in_compound_statement
  ARG1=100
  ARG2=2
  ARG3=3
diff --cc src/cppbash_builtin.cpp
index 7334a8e,edbfa8c..88fdf99
--- a/src/cppbash_builtin.cpp
+++ b/src/cppbash_builtin.cpp
@@@ -25,9 -25,9 +25,10 @@@
  #include "cppbash_builtin.h"
  
  #include "builtins/boolean_builtins.h"
+ #include "builtins/declare_builtin.h"
  #include "builtins/echo_builtin.h"
  #include "builtins/inherit_builtin.h"
 +#include "builtins/let_builtin.h"
  #include "builtins/return_builtin.h"
  #include "builtins/source_builtin.h"
  



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-05-14 14:58 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-05-14 14:58 UTC (permalink / raw
  To: gentoo-commits

commit:     70d904ff45b79c46190246048690ed16096c6298
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat May 14 14:39:42 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat May 14 14:52:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=70d904ff

Build: parallel support for code coverage

make -j8 test_coverage works now. This is done by passing MAKE down to
the script.

---
 Makefile.am      |    2 +-
 test_coverage.sh |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 73af619..5b33379 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -288,5 +288,5 @@ generate_metadata: metadata_generator
 	srcdir=$(srcdir) utils/meta_gen.sh
 
 test_coverage: dist
-	DIST_ARCHIVES=$(DIST_ARCHIVES) ./test_coverage.sh
+	MAKE=$(MAKE) DIST_ARCHIVES=$(DIST_ARCHIVES) ./test_coverage.sh
 	rm $(DIST_ARCHIVES)

diff --git a/test_coverage.sh b/test_coverage.sh
index 5c57d02..20f70d9 100755
--- a/test_coverage.sh
+++ b/test_coverage.sh
@@ -21,11 +21,11 @@ cd $srcdir
 CXXFLAGS="-g -O0 --coverage" CFLAGS="-g -O0 --coverage" ./autogen.sh --disable-shared
 
 # Generate gcov output
-make
+${MAKE}
 
 # Generate html report
 lcov --base-directory . --directory . --zerocounters -q
-make check
+${MAKE} check
 lcov --base-directory . --directory . -c -o libbash_test.info
 lcov --remove libbash_test.info "/usr*" -o libbash_test.info # remove output for external libraries
 rm -rf ../test_coverage



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-05-14 14:58 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-05-14 14:58 UTC (permalink / raw
  To: gentoo-commits

commit:     9d1ba1a2b0911f8cb1559ad3e518d9c6fb2a0d87
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Sat May 14 03:57:54 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat May 14 14:43:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=9d1ba1a2

Built: support generating test coverage report

A new target "test_coverage" is created to generate test coverage
report in html format. To use that, you need to have lcov installed.

---
 .gitignore       |    1 +
 Makefile.am      |    6 ++++++
 autogen.sh       |    2 +-
 test_coverage.sh |   35 +++++++++++++++++++++++++++++++++++
 4 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index 60da165..db37cad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,3 +59,4 @@ m4/lt~obsolete.m4
 libtool
 ltmain.sh
 INSTALL
+test_coverage/

diff --git a/Makefile.am b/Makefile.am
index 7102884..73af619 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -220,6 +220,8 @@ EXTRA_DIST = bashast/bashast.g \
 			 scripts/illegal_script.sh \
 			 utils/meta_gen.sh \
 			 scripts/foo.eclass \
+			 test_coverage.sh \
+			 autogen.sh \
 			 $(BASH_TESTS) \
 			 $(BASH_RESULT) \
 			 $(EBUILD_TESTS) \
@@ -284,3 +286,7 @@ benchmark_parser: callgrind.out
 
 generate_metadata: metadata_generator
 	srcdir=$(srcdir) utils/meta_gen.sh
+
+test_coverage: dist
+	DIST_ARCHIVES=$(DIST_ARCHIVES) ./test_coverage.sh
+	rm $(DIST_ARCHIVES)

diff --git a/autogen.sh b/autogen.sh
index 3ccf6d8..d845062 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,2 +1,2 @@
 #!/bin/sh
-autoreconf -W all -i && ./configure --enable-gtest --enable-developer
+autoreconf -W all -i && ./configure --enable-gtest --enable-developer "$@"

diff --git a/test_coverage.sh b/test_coverage.sh
new file mode 100755
index 0000000..5c57d02
--- /dev/null
+++ b/test_coverage.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+which lcov 1>/dev/null 2>&1
+if [ $? != 0 ]
+then
+    echo "You need to have lcov installed in order to generate the test coverage report"
+    exit 1
+fi
+
+if [ ! $DIST_ARCHIVES ]
+then
+    echo "You need to provide the archive name by running DIST_ARCHIVES=\"ARCHIVE_NAME\" $0"
+    exit 1
+fi
+
+tar zxf $DIST_ARCHIVES
+srcdir=${DIST_ARCHIVES/.tar.gz}
+cd $srcdir
+
+# Reconfigure with gcov support
+CXXFLAGS="-g -O0 --coverage" CFLAGS="-g -O0 --coverage" ./autogen.sh --disable-shared
+
+# Generate gcov output
+make
+
+# Generate html report
+lcov --base-directory . --directory . --zerocounters -q
+make check
+lcov --base-directory . --directory . -c -o libbash_test.info
+lcov --remove libbash_test.info "/usr*" -o libbash_test.info # remove output for external libraries
+rm -rf ../test_coverage
+genhtml -o ../test_coverage -t "libbash test coverage" --num-spaces 4 libbash_test.info
+
+# Clean work space
+cd .. && rm -rf $srcdir



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-05-12 14:06 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-05-12 14:06 UTC (permalink / raw
  To: gentoo-commits

commit:     1999c27e98093985aa4cf7778b4681c362b95de9
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Thu May 12 12:05:06 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu May 12 14:03:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=1999c27e

Build: silence javac warnings

The antlr generated sources are for 1.4 so add -source 1.4 to
AM_JAVACFLAGS to suppress warnings about unchecked or unsafe
operations.

---
 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index bb36f72..33387ff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -71,7 +71,7 @@ EBUILD_RESULT = scripts/sunpinyin-2.0.3-r1.ebuild.result
 TESTS = $(GUNIT_TESTS) $(BASH_TESTS) $(EBUILD_TESTS)
 # these get cleaned so only add autogenerated stuff or modify CLEANFILES
 check_JAVA = bashast/bashastLexer.java bashast/bashastParser.java
-AM_JAVACFLAGS = -classpath @antlr_cp@
+AM_JAVACFLAGS = -source 1.4 -classpath @antlr_cp@
 
 COMMON_FLAGS = -std=c++0x -I$(top_srcdir)/src/
 # We use -x c++ to compile all C source files as C++ because there's C++



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-05-11  7:19 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-05-11  7:19 UTC (permalink / raw
  To: gentoo-commits

commit:     af3866332694ab98054f042c95080d130e310a06
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Wed May 11 07:15:58 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Wed May 11 07:15:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=af386633

Merge remote-tracking branch 'mu/pattern_matching'

Conflicts:
	bashast/bashast.g


 bashast/bashast.g                       |   10 +-
 bashast/features_script/features.sh.ast |    2 +-
 bashast/gunit/compound.gunit            |   10 +-
 bashast/gunit/param_main.gunit          |    2 +-
 bashast/libbashWalker.g                 |  194 ++++++++++++++++++++++++-------
 scripts/compound_command.bash           |   57 +++++++++-
 scripts/compound_command.bash.result    |    8 +-
 scripts/var_expansion.bash              |   10 ++
 scripts/var_expansion.bash.result       |   10 ++
 src/core/interpreter.cpp                |   49 +++-----
 src/core/interpreter.h                  |   33 +-----
 11 files changed, 268 insertions(+), 117 deletions(-)

diff --cc bashast/bashast.g
index 220d01f,429474e..c4156ec
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@@ -63,13 -63,15 +63,15 @@@ tokens
  	KEYWORD_TEST;
  	BUILTIN_TEST;
  	MATCH_ANY_EXCEPT;
 -	MATCH_EXACTLY_ONE;
 -	MATCH_AT_MOST_ONE;
 -	MATCH_NONE;
 +	EXTENDED_MATCH_EXACTLY_ONE;
 +	EXTENDED_MATCH_AT_MOST_ONE;
 +	EXTENDED_MATCH_NONE;
 +	EXTENDED_MATCH_ANY;
 +	EXTENDED_MATCH_AT_LEAST_ONE;
  	MATCH_ANY;
 -	MATCH_AT_LEAST_ONE;
 -	MATCH_PATTERN;
  	MATCH_ANY_EXCEPT;
+ 	MATCH_ALL;
+ 	MATCH_ONE;
  	CHARACTER_CLASS;
  	EQUIVALENCE_CLASS;
  	COLLATING_SYMBOL;
@@@ -450,9 -452,11 +452,11 @@@ pattern_match_trigge
  //Pattern matching using brackets
  bracket_pattern_match
  	:	LSQUARE RSQUARE (BANG|CARET) pattern_match* RSQUARE -> ^(MATCH_ANY_EXCEPT RSQUARE pattern_match*)
 -	|	LSQUARE RSQUARE pattern_match* RSQUARE -> ^(MATCH_PATTERN RSQUARE pattern_match*)
 +	|	LSQUARE RSQUARE pattern_match* RSQUARE -> ^(MATCH_ANY RSQUARE pattern_match*)
  	|	LSQUARE (BANG|CARET) pattern_match+ RSQUARE -> ^(MATCH_ANY_EXCEPT pattern_match+)
- 	|	LSQUARE pattern_match+ RSQUARE -> ^(MATCH_ANY pattern_match+);
 -	|	LSQUARE pattern_match+ RSQUARE -> ^(MATCH_PATTERN pattern_match+)
++	|	LSQUARE pattern_match+ RSQUARE -> ^(MATCH_ANY pattern_match+)
+ 	|	TIMES -> MATCH_ALL
+ 	|	QMARK -> MATCH_ONE;
  //allowable patterns with bracket pattern matching
  pattern_match
  	:	pattern_class_match
diff --cc bashast/libbashWalker.g
index f39e603,e80e43e..307333d
--- a/bashast/libbashWalker.g
+++ b/bashast/libbashWalker.g
@@@ -149,15 -175,98 +175,98 @@@ string_expr returns[std::string libbash
  	$quoted = true;
  }
  	:^(STRING (
+ 		string_part {
+ 			$libbash_value += $string_part.libbash_value;
+ 			$quoted = $string_part.quoted;
+ 		}
+ 	)+);
+ 
+ string_part returns[std::string libbash_value, bool quoted]
+ @init {
+ 	$quoted = false;
+ }
+ 	:(DOUBLE_QUOTED_STRING) =>
+ 		^(DOUBLE_QUOTED_STRING (libbash_string=double_quoted_string {
+ 									$libbash_value += libbash_string;
+ 									$quoted = true;
+ 								})*)
+ 	|(ARITHMETIC_EXPRESSION) =>
+ 		^(ARITHMETIC_EXPRESSION value=arithmetics {
+ 			$libbash_value = boost::lexical_cast<std::string>(value);
+ 		})
+ 	|(var_ref[false]) => libbash_string=var_ref[false] {
+ 		$libbash_value = libbash_string;
+ 	}
+ 	|libbash_string=command_substitution {
+ 		$libbash_value = libbash_string;
+ 	}
+ 	|(libbash_string=any_string {
+ 		$libbash_value = libbash_string;
+ 	});
+ 
+ bash_pattern[boost::xpressive::sregex& pattern, bool greedy]
+ @declarations {
+ 	using namespace boost::xpressive;
+ 	bool do_append = false;
+ 	bool negation;
+ 	std::string pattern_str;
+ }
+ 	:^(STRING (
  		(DOUBLE_QUOTED_STRING) =>
- 			^(DOUBLE_QUOTED_STRING (libbash_string=double_quoted_string { $libbash_value += libbash_string; })*)
- 		|(ARITHMETIC_EXPRESSION) =>
- 			^(ARITHMETIC_EXPRESSION value=arithmetics {
- 				$libbash_value += boost::lexical_cast<std::string>(value); $quoted = false;
- 			})
- 		|(var_ref[false]) => libbash_string=var_ref[false] { $libbash_value += libbash_string; $quoted = false; }
- 		|libbash_string=command_substitution { $libbash_value += libbash_string; $quoted = false; }
- 		|(libbash_string=any_string { $libbash_value += libbash_string; $quoted = false; })
+ 			^(DOUBLE_QUOTED_STRING (libbash_string=double_quoted_string {
+ 				append($pattern, as_xpr(libbash_string), do_append);
+ 			})*)
+ 		|(MATCH_ALL) => MATCH_ALL {
+ 			if($greedy)
+ 				append($pattern, *_, do_append);
+ 			else
+ 				append($pattern, -*_, do_append);
+ 		}
+ 		|(MATCH_ONE) => MATCH_ONE {
+ 			append($pattern, _, do_append);
+ 		}
 -		|(MATCH_ANY_EXCEPT|MATCH_PATTERN) =>
 -		^((MATCH_ANY_EXCEPT { negation = true; } | MATCH_PATTERN { negation = false; })
++		|(MATCH_ANY_EXCEPT|MATCH_ANY) =>
++		^((MATCH_ANY_EXCEPT { negation = true; } | MATCH_ANY { negation = false; })
+ 		  (s=string_part { pattern_str += s.libbash_value; })+) {
+ 			if(pattern_str.empty())
+ 				return;
+ 
+ 			// deal with the first character specially
+ 			int index = 0;
+ 			auto char_set = set = as_xpr(pattern_str[0]);
+ 			if( index + 1 < pattern_str.size() && pattern_str[index + 1] == '-')
+ 			{
+ 				char_set = set[range(pattern_str[index], pattern_str[index + 2])];
+ 				index += 3;
+ 			}
+ 			else
+ 			{
+ 				++index;
+ 			}
+ 
+ 			// handle all characters in the pattern
+ 			while(index < pattern_str.size())
+ 			{
+ 				if( index + 1 < pattern_str.size() && pattern_str[index + 1] == '-')
+ 				{
+ 					char_set |= range(pattern_str[index], pattern_str[index + 2]);
+ 					index += 3;
+ 				}
+ 				else
+ 				{
+ 					char_set |= pattern_str[index];
+ 					++index;
+ 				}
+ 			}
+ 
+ 			if(negation)
+ 				append($pattern, ~char_set, do_append);
+ 			else
+ 				append($pattern, char_set, do_append);
+ 		}
+ 		|(libbash_string=any_string {
+ 			append($pattern, as_xpr(libbash_string), do_append);
+ 		})
  	)+);
  
  //double quoted string rule, allows expansions



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-05-08 13:07 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-05-08 13:07 UTC (permalink / raw
  To: gentoo-commits

commit:     d99d179bbe397cf69bca41b0dd3962b1676676f9
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sun May  8 13:04:54 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun May  8 13:04:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=d99d179b

Merge remote-tracking branch 'mu/variable_setup'

Conflicts:
	src/builtins/source_builtin.cpp


 .gitignore                                     |    2 +
 Makefile.am                                    |   15 ++-
 configure.ac                                   |    2 +
 src/builtins/source_builtin.cpp                |   19 ++-
 src/core/symbols.hpp                           |    2 +-
 src/core/tests/symbols_test.cpp                |    2 +
 src/libbash.cpp                                |    5 +
 src/libbash.h                                  |    3 +-
 utils/command_line.cpp                         |   88 +++++++++
 utils/command_line.h                           |   62 ++++++
 utils/instruo.cpp                              |  251 ++++++++++++++++++++++++
 utils/{metadata_generator.cpp => metadata.cpp} |   35 +---
 src/common.h => utils/metadata.h               |   20 +-
 utils/metadata_generator.cpp                   |   84 +--------
 14 files changed, 465 insertions(+), 125 deletions(-)

diff --cc src/builtins/source_builtin.cpp
index 1e82c77,6ba6b11..277eb94
--- a/src/builtins/source_builtin.cpp
+++ b/src/builtins/source_builtin.cpp
@@@ -26,8 -26,8 +26,9 @@@
  
  #include <fstream>
  #include <string>
+ #include <unordered_map>
  
 +#include "builtins/builtin_exceptions.h"
  #include "cppbash_builtin.h"
  #include "core/interpreter.h"
  #include "core/interpreter_exception.h"
@@@ -40,16 -42,17 +43,22 @@@ int source_builtin::exec(const std::vec
  
    // we need fix this to pass extra arguments as positional parameters
    const std::string& path = bash_args[0];
-   std::ifstream input(path);
-   if(!input)
-     throw interpreter_exception(path + " can't be read");
  
-   bash_ast ast(input);
+   auto& stored_ast = ast_cache[path];
+   if(!stored_ast)
+   {
+     std::ifstream input(path);
+     if(!input)
+       throw interpreter_exception(path + " can't be read");
+ 
+     stored_ast.reset(new bash_ast(input));
+   }
 -  stored_ast->interpret_with(_walker);
++  
 +  try
 +  {
-     ast.interpret_with(_walker);
++    stored_ast->interpret_with(_walker);
 +  }
 +  catch(return_exception& e) {}
  
    return _walker.get_status();
  }



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-05-07 12:25 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-05-07 12:25 UTC (permalink / raw
  To: gentoo-commits

commit:     ce9c217021e2154a64f8ed3b3e7c492bc8a4c917
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat May  7 12:23:34 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat May  7 12:23:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=ce9c2170

Merge remote-tracking branch 'mu/local_variables'

Conflicts:
	scripts/function_def.bash


 bashast/bashast.g                |    5 ++-
 bashast/gunit/simp_command.gunit |    1 +
 bashast/libbashWalker.g          |   20 ++++++++++++++----
 scripts/function_def.bash        |   10 +++++++++
 scripts/function_def.bash.result |    1 +
 src/core/interpreter.cpp         |   40 +++++++++++++++++++++++++++++++++----
 src/core/interpreter.h           |   39 +++++++++++++++++++++---------------
 7 files changed, 88 insertions(+), 28 deletions(-)

diff --cc bashast/libbashWalker.g
index beabfdf,1a305ef..f39e603
--- a/bashast/libbashWalker.g
+++ b/bashast/libbashWalker.g
@@@ -283,21 -292,13 +293,21 @@@ simple_comman
  @declarations {
  	std::vector<std::string> libbash_args;
  }
- 	:^(COMMAND string_expr (argument[libbash_args])* var_def*) {
+ 	:^(COMMAND string_expr (argument[libbash_args])* var_def[true]*) {
  		if(walker->has_function($string_expr.libbash_value))
  		{
 -			walker->set_status(walker->call($string_expr.libbash_value,
 -											libbash_args,
 -											ctx,
 -											compound_command));
 +			ANTLR3_MARKER command_index = INDEX();
 +			try
 +			{
 +				walker->set_status(walker->call($string_expr.libbash_value,
 +												libbash_args,
 +												ctx,
 +												compound_command));
 +			}
 +			catch(return_exception& e)
 +			{
 +				SEEK(command_index);
 +			}
  		}
  		else if(cppbash_builtin::is_builtin($string_expr.libbash_value))
  		{
diff --cc scripts/function_def.bash
index ee57a94,cbce4cd..bcf5a4b
--- a/scripts/function_def.bash
+++ b/scripts/function_def.bash
@@@ -27,18 -27,12 +27,28 @@@ ARRAY=(1 2 3
  func_with_args ${ARRAY[@]} $FOO001
  func_with_args 100 $ARG2 $ARG3 $ARG4
  
 +func_with_return()
 +{
 +    return 1
 +    NOT_EXIST=1
 +}
 +func_with_return
 +RETURN_STATUS=$?
 +func_with_return2()
 +{
 +    true
 +    return
 +    NOT_EXIST=1
 +}
 +func_with_return2
 +RETURN_STATUS2=$?
++
+ func_nested1() {
+     echo $foo_nested ${bar_nested[0]}
+ }
+ func_nested2() {
+     local foo_nested=hi bar_nested=(1 2
+     3)
+     func_nested1
+ }
+ func_nested2



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-27 15:11 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-27 15:11 UTC (permalink / raw
  To: gentoo-commits

commit:     74f857d116fa51adaa22f78893d7f1e836a2346c
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Wed Apr 27 15:07:13 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Wed Apr 27 15:07:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=74f857d1

Merge remote-tracking branch 'mu/compound_expr'


 Makefile.am                             |    4 +
 bashast/bashast.g                       |   25 ++--
 bashast/features_script/features.sh.ast |    2 +-
 bashast/gunit/compound.gunit            |   34 ++--
 bashast/gunit/cond_main.gunit           |    5 +-
 bashast/gunit/expansions.gunit          |    3 +-
 bashast/gunit/pipeline.gunit            |    2 +-
 bashast/libbashWalker.g                 |  286 +++++++++++++++++++++++++++----
 scripts/compound_command.bash           |  112 ++++++++++++
 scripts/compound_command.bash.result    |   34 ++++
 scripts/test_expr.bash                  |   26 +++
 scripts/test_expr.bash.result           |    9 +
 scripts/var_def.bash                    |    6 +
 scripts/var_def.bash.result             |    6 +
 src/core/interpreter.cpp                |   10 +-
 src/core/interpreter.h                  |   17 ++-
 src/core/tests/interpreter_test.cpp     |   14 ++
 test/script_compiler.sh                 |    2 +-
 utils/variable_printer.cpp              |    8 +-
 19 files changed, 533 insertions(+), 72 deletions(-)

diff --cc Makefile.am
index b4f6488,a21b3ad..7202cef
--- a/Makefile.am
+++ b/Makefile.am
@@@ -58,13 -60,11 +60,15 @@@ BASH_RESULT = scripts/var_def.bash.resu
  			  scripts/command_execution.bash.result \
  			  scripts/function_def.bash.result \
  			  scripts/arithmetic_assignment.bash.result \
+ 			  scripts/compound_command.bash.result \
+ 			  scripts/test_expr.bash.result \
  			  scripts/binary_arithmetic.bash.result
  
 -TESTS = $(GUNIT_TESTS) $(BASH_TESTS)
 +EBUILD_LOG_COMPILER = $(srcdir)/test/ebuild_compiler.sh
 +EBUILD_TESTS = scripts/sunpinyin-2.0.3-r1.ebuild
 +EBUILD_RESULT = scripts/sunpinyin-2.0.3-r1.ebuild.result
 +
 +TESTS = $(GUNIT_TESTS) $(BASH_TESTS) $(EBUILD_TESTS)
  # these get cleaned so only add autogenerated stuff or modify CLEANFILES
  check_JAVA = bashast/bashastLexer.java bashast/bashastParser.java
  AM_JAVACFLAGS = -classpath @antlr_cp@



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-20 11:26 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-20 11:26 UTC (permalink / raw
  To: gentoo-commits

commit:     2bb543bdcde31f9a84b9c54ce367d374d4247553
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Tue Apr 19 19:33:44 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Wed Apr 20 11:22:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=2bb543bd

Build: callgrind_annotate support

Instead of just running callgrind to get the total number of
instructions executed the benchmark_parser target now also runs
callgrind_annotate to get information where time is spent.

---
 Makefile.am |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c20601c..60a98fa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -128,7 +128,8 @@ CLEANFILES = $(GENERATED_PARSER_C) \
 			 javagrammar.run \
 			 cgrammar.run \
 			 walker.run \
-			 massif.out
+			 massif.out \
+			 callgrind.out
 
 lib_LTLIBRARIES = libcppbash.la
 libcppbash_la_SOURCES = src/common.h \
@@ -215,7 +216,10 @@ massif.out: ast_printer
 massif: massif.out
 	ms_print --threshold=10 $<
 
-benchmark_parser: ast_printer
+callgrind.out: ast_printer
 	libtool --mode=execute valgrind \
-		--tool=callgrind --callgrind-out-file=/dev/null \
+		--tool=callgrind --callgrind-out-file=callgrind.out \
 		./ast_printer -s  -f /usr/portage/eclass/versionator.eclass
+
+benchmark_parser: callgrind.out
+	callgrind_annotate callgrind.out



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-17 10:58 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-17 10:58 UTC (permalink / raw
  To: gentoo-commits

commit:     00cfdb05cf3576831e0ec703605978deddb6c4a4
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Apr 16 19:15:42 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun Apr 17 10:57:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=00cfdb05

Build: versionator.eclass for massif

To get a more realistic measurement for memory usage use
versionator.eclass with ast_printer.

---
 Makefile.am |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e965bf9..c20601c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -128,8 +128,7 @@ CLEANFILES = $(GENERATED_PARSER_C) \
 			 javagrammar.run \
 			 cgrammar.run \
 			 walker.run \
-			 massif.out \
-			 long.sh
+			 massif.out
 
 lib_LTLIBRARIES = libcppbash.la
 libcppbash_la_SOURCES = src/common.h \
@@ -208,14 +207,10 @@ javagrammar.run: bashast/bashast.g
 
 $(check_JAVA): javagrammar.run
 
-long.sh:
-	rm -f $@
-	for i in $$(seq 1 10000); do echo 'FOO="bar"' >> $@; done
-
-massif.out: variable_printer long.sh
+massif.out: ast_printer
 		libtool --mode=execute valgrind \
 		--tool=massif --massif-out-file=massif.out \
-		./variable_printer long.sh
+		./ast_printer -nsf /usr/portage/eclass/versionator.eclass
 
 massif: massif.out
 	ms_print --threshold=10 $<



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-14  4:50 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-14  4:50 UTC (permalink / raw
  To: gentoo-commits

commit:     009e018e3b65e2550356f1f61437986ec2763842
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Thu Apr 14 04:41:55 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Apr 14 04:41:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=009e018e

Change place where to report bugs

Instead of mailing Nathan we nowadays have a bugzilla component
available in the Gentoo bugzilla.

---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6e9f860..b710a97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ dnl #############################################
 
 AC_PREREQ(2.65)
 AC_CONFIG_MACRO_DIR([m4])
-AC_INIT([libbash],[0.1],[powerofazure@gmail.com])
+AC_INIT([libbash],[0.1],[https://bugs.gentoo.org/enter_bug.cgi?component=libbash&product=Gentoo%20Hosted%20Projects])
 AM_INIT_AUTOMAKE([foreign parallel-tests color-tests subdir-objects 1.11])
 AM_SILENT_RULES([yes])
 AC_PROG_CXX



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-14  4:50 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-14  4:50 UTC (permalink / raw
  To: gentoo-commits

commit:     9b72788bf2f6cd763a4f99f39827b1a8c19e8cb2
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Thu Apr 14 04:48:54 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Apr 14 04:48:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=9b72788b

Merge remote-tracking branch 'mu/master'

Conflicts:
	src/core/interpreter.h


 bashast/bashast.g                           |   19 +++-
 bashast/features_script/features.sh.ast     |    2 +-
 bashast/gunit/arith_main.gunit              |   14 ++-
 bashast/gunit/array.gunit                   |    6 +-
 bashast/gunit/assoc_array.gunit             |    2 +-
 bashast/gunit/expansions.gunit              |    2 +-
 bashast/libbashWalker.g                     |  138 ++++++++++++++++++---------
 scripts/arithmetic_assignment.ebuild        |    2 +
 scripts/arithmetic_assignment.ebuild.result |    3 +
 scripts/binary_arithmetic.ebuild            |   30 ++++++-
 scripts/binary_arithmetic.ebuild.result     |   26 +++++-
 scripts/var_def.ebuild                      |   22 ++++-
 scripts/var_def.ebuild.result               |   14 +++-
 scripts/var_expansion.ebuild                |   15 +++-
 scripts/var_expansion.ebuild.result         |   14 +++
 src/core/interpreter.cpp                    |   36 +++++++
 src/core/interpreter.h                      |   89 ++++++++++++------
 src/core/symbols.hpp                        |   26 +++---
 src/core/tests/interpreter_test.cpp         |   17 +++-
 test/variable_printer.cpp                   |    4 +-
 test/walker_test.cpp                        |   13 +++
 21 files changed, 382 insertions(+), 112 deletions(-)

diff --cc src/core/interpreter.cpp
index 0086216,9f10949..c723173
--- a/src/core/interpreter.cpp
+++ b/src/core/interpreter.cpp
@@@ -21,3 -21,38 +21,39 @@@
  /// \author Mu Qiao
  /// \brief implementations for bash interpreter (visitor pattern).
  ///
+ 
+ #include "core/interpreter.h"
+ 
+ #include <boost/algorithm/string/join.hpp>
+ 
+ void interpreter::get_all_elements_joined(const std::string& name,
+                                           const std::string& delim,
+                                           std::string& result)
+ {
+   std::vector<std::string> source;
 -  std::shared_ptr<variable> value = members.resolve(name);
 -  if(value)
++
++  auto i = members.find(name);
++  if(i != members.end())
+   {
 -    value->get_all_values(source);
++    i->second->get_all_values(source);
+     result = boost::algorithm::join(source, delim);
+   }
+   else
+   {
+     result = "";
+   }
+ }
+ 
+ void interpreter::get_all_elements(const std::string& name,
+                                    std::string& result)
+ {
+   get_all_elements_joined(name, " ", result);
+ }
+ 
+ void interpreter::get_all_elements_IFS_joined(const std::string& name,
+                                               std::string& result)
+ {
+   get_all_elements_joined(name,
+                           resolve<std::string>("IFS").substr(0, 1),
+                           result);
+ }
diff --cc src/core/interpreter.h
index 3baf029,5ac5027..e61748a
--- a/src/core/interpreter.h
+++ b/src/core/interpreter.h
@@@ -394,13 -401,13 +403,13 @@@ public
    ///        if the variable is undefined
    /// \param variable name
    /// \return whether the value of the variable is null
-   bool is_unset_or_null(const std::string& name)
+   bool is_unset_or_null(const std::string& name, const unsigned index)
    {
 -    std::shared_ptr<variable> value = members.resolve(name);
 -    if(value)
 -      return value->is_null(index);
 -    else
 +    auto i = members.find(name);
 +    if(i == members.end())
        return true;
 +    else
-       return i->second->is_null();
++      return i->second->is_null(index);
    }
  
    /// \brief check whether the value of the variable is unset
@@@ -420,13 -427,14 +429,14 @@@
    template <typename T>
    const T& set_value(const std::string& name,
                       const T& new_value,
-                      const unsigned index=0)
+                      const unsigned index=0,
+                      bool is_null=false)
    {
 -    std::shared_ptr<variable> value = members.resolve(name);
 -    if(!value)
 +    auto i = members.find(name);
 +    if(i == members.end())
-       define(name, new_value, false);
+       define(name, new_value, false, is_null, index);
      else
-       i->second->set_value(new_value, index);
 -      value->set_value(new_value, index, is_null);
++      i->second->set_value(new_value, index, is_null);
      return new_value;
    }
  
@@@ -439,11 -447,12 +449,12 @@@
    void define(const std::string& name,
                const T& value,
                bool readonly=false,
-               bool is_null=false)
+               bool is_null=false,
+               const unsigned index=0)
    {
      std::shared_ptr<variable> target(
-         new variable(name, value, readonly, is_null));
+         new variable(name, value, readonly, is_null, index));
 -    members.define(target);
 +    members[name] = target;
    }
  
    /// \brief perform ${parameter:−word} expansion
@@@ -509,11 -525,25 +527,26 @@@
    /// \return the length
    unsigned get_length(const std::string& name, const unsigned index=0)
    {
 -    std::shared_ptr<variable> value = members.resolve(name);
 -    if(!value)
 +    auto i = members.find(name);
 +    if(i == members.end())
        return 0;
 -    return value->get_length(index);
 +    return i->second->get_length(index);
    }
  
+   /// \brief get the length of an array
+   /// \param the name of the array
+   /// \return the length of the array
+   unsigned get_array_length(const std::string& name)
+   {
 -    std::shared_ptr<variable> value = members.resolve(name);
 -    if(!value)
++    auto i = members.find(name);
++    if(i == members.end())
+       return 0;
 -    return value->get_array_length();
++    else
++      return i->second->get_array_length();
+   }
+ 
+   void get_all_elements(const std::string&, std::string&);
+ 
+   void get_all_elements_IFS_joined(const std::string&, std::string&);
  };
  #endif



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-12 18:29 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-12 18:29 UTC (permalink / raw
  To: gentoo-commits

commit:     a8babcd50d15ceb52af075e2689b435102e76162
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Tue Apr 12 18:26:12 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Tue Apr 12 18:26:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=a8babcd5

Merge remote-tracking branch 'gentoo/master' into review

Conflicts:
	bashast/libbashWalker.g


 bashast/bashast.g                       |   86 +++++++++++++++++++------------
 bashast/features_script/features.sh.ast |    2 +-
 bashast/gunit/array.gunit               |   15 +++++
 bashast/gunit/assoc_array.gunit         |    9 ++--
 bashast/gunit/param_main.gunit          |    7 ++-
 bashast/gunit/simp_command.gunit        |    6 +-
 bashast/libbashWalker.g                 |    6 +--
 7 files changed, 82 insertions(+), 49 deletions(-)

diff --cc bashast/libbashWalker.g
index 1061c3f,bd11744..45034c2
--- a/bashast/libbashWalker.g
+++ b/bashast/libbashWalker.g
@@@ -67,27 -55,17 +67,28 @@@ options{ k=1; }
  	DIGIT { $libbash_value = walker->get_string($DIGIT); }
  	|NUMBER { $libbash_value = walker->get_string($NUMBER); };
  
 -var_def:
 -	^(EQUALS libbash_name=name libbash_value=string_expr){
 +var_def
 +@declarations {
 +	std::map<int, std::string> values;
 +	int index = 0;
 +}:
- 	^(EQUALS libbash_name=name_base libbash_value=word){
++	^(EQUALS libbash_name=name_base libbash_value=string_expr){
  		walker->define(libbash_name, libbash_value);
 +	}
 +	|^(EQUALS libbash_name=name_base ^(ARRAY (
 +										(libbash_string=string_expr
 +										|^(EQUALS value=arithmetics { index = value; } libbash_string=string_expr))
 +										{ values[index++] = libbash_string; })*
 +									 )){
 +		walker->define(libbash_name, values);
  	};
  
  string_expr	returns[std::string libbash_value]:
  	^(STRING(
  		(DOUBLE_QUOTED_STRING) => ^(DOUBLE_QUOTED_STRING (libbash_string=double_quoted_string { $libbash_value += libbash_string; })*)
  		|(ARITHMETIC_EXPRESSION) => ^(ARITHMETIC_EXPRESSION value=arithmetics { $libbash_value = boost::lexical_cast<std::string>(value); })
+ 		|(var_ref) => libbash_string=var_ref { $libbash_value = libbash_string; }
 -		|libbash_string=any_string { $libbash_value = libbash_string; }
 +		|(libbash_string=any_string { $libbash_value += libbash_string; })+
  	));
  
  //double quoted string rule, allows expansions



^ permalink raw reply	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-11  6:50 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-11  6:50 UTC (permalink / raw
  To: gentoo-commits

commit:     6e51788eb73c044b06d5674a384c3b9e245e959c
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sun Apr 10 08:26:34 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Mon Apr 11 05:23:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=6e51788e

Add code to benchmark parser speed

benchmark_parser target now runs callgrind on versionator.eclass and
collects the number of instructions executed.

---
 Makefile.am |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 96c01f0..b57922d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -214,3 +214,8 @@ massif.out: variable_printer long.sh
 
 massif: massif.out
 	ms_print --threshold=10 $<
+
+benchmark_parser: ast_printer
+	libtool --mode=execute valgrind \
+		--tool=callgrind --callgrind-out-file=/dev/null \
+		./ast_printer -s  -f /usr/portage/eclass/versionator.eclass



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-09 13:08 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-09 13:08 UTC (permalink / raw
  To: gentoo-commits

commit:     28da2a0f3bbd4b979961f6611fece4b1a74b2846
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  9 09:56:12 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Apr  9 13:02:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=28da2a0f

Remove BOOST_CPPFLAGS from COMMON_FLAGS

BOOST_CPPFLAGS is for preprecossor and shouldn't be used in
COMMON_FLAGS.

---
 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 19b537e..1ad2a27 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -57,7 +57,7 @@ TESTS = $(GUNIT_TESTS) $(EBUILD_TESTS)
 check_JAVA = bashast/bashastLexer.java bashast/bashastParser.java
 AM_JAVACFLAGS = -classpath @antlr_cp@
 
-COMMON_FLAGS = $(BOOST_CPPFLAGS) -std=c++0x -I$(top_srcdir)/src/
+COMMON_FLAGS = -std=c++0x -I$(top_srcdir)/src/
 # We use -x c++ to compile all C source files as C++ because there's C++
 # code embedded in them.
 # no DEVELOPER_FLAGS to as the generated files don't pass -Werror



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-08 11:12 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-08 11:12 UTC (permalink / raw
  To: gentoo-commits

commit:     9af524bb5f96176e58c8c3f42f9fd1289ca9267a
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Fri Apr  8 02:17:37 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Apr  8 11:01:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=9af524bb

Fix .gitignore for *.pdf and *.aux

---
 .gitignore |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6b73188..76473ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,9 +40,8 @@ libbashWalker.h
 libbashWalker.c
 libbashWalker.cpp
 libbashWalker.tokens
-coding_standard/*.pdf
-coding_standard/*.log
-coding_standard/*.aux
+*.pdf
+*.aux
 config.*
 *.run
 configure



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-07 16:44 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-07 16:44 UTC (permalink / raw
  To: gentoo-commits

commit:     268d9c5f73ef2b42ae9b85bb5e3eef25bc4a7314
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Thu Apr  7 11:59:02 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Apr  7 16:39:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=268d9c5f

Add massif make target

You can now run make massif to get a print for memory usage of
interpreting a simple script.

---
 .gitignore  |    2 ++
 Makefile.am |   16 +++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index ed9707b..6b73188 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,8 @@ autom4te.cache
 cppunittests
 variable_printer
 ast_printer
+long.sh
+massif.out
 libbash.g
 libbash.tokens
 bashast.tokens

diff --git a/Makefile.am b/Makefile.am
index 77661e7..0b783f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -122,7 +122,9 @@ CLEANFILES = $(GENERATED_PARSER_C) \
 			 libbashWalker.tokens \
 			 javagrammar.run \
 			 cgrammar.run \
-			 walker.run
+			 walker.run \
+			 massif.out \
+			 long.sh
 
 lib_LTLIBRARIES = libcppbash.la
 libcppbash_la_SOURCES = src/common.h \
@@ -195,3 +197,15 @@ javagrammar.run: bashast/bashast.g
 	$(AM_V_at)mv $@.tmp $@
 
 $(check_JAVA): javagrammar.run
+
+long.sh:
+	rm -f $@
+	for i in $$(seq 1 10000); do echo 'FOO="bar"' >> $@; done
+
+massif.out: variable_printer long.sh
+		libtool --mode=execute valgrind \
+		--tool=massif --massif-out-file=massif.out \
+		./variable_printer long.sh
+
+massif: massif.out
+	ms_print --threshold=10 $<



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-03 13:46 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-03 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     da99007ae235f6d19c917d1ff79b3a4838b9b61a
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sun Apr  3 13:42:35 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun Apr  3 13:42:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=da99007a

Fix make distcheck

One result file was not declared in Makefile.am.

---
 Makefile.am |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 43796c3..2da69a2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,7 +49,8 @@ GUNIT_TESTS = bashast/gunit/arith_main.gunit \
 EBUILD_LOG_COMPILER = $(srcdir)/test/script_compiler.sh
 EBUILD_TESTS = scripts/var_def.ebuild \
 			   scripts/var_expansion.ebuild
-EBUILD_RESULT = scripts/var_def.ebuild.result
+EBUILD_RESULT = scripts/var_def.ebuild.result \
+				scripts/var_expansion.ebuild.result
 
 TESTS = $(GUNIT_TESTS) $(EBUILD_TESTS)
 # these get cleaned so only add autogenerated stuff or modify CLEANFILES



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-03 13:46 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-03 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     6ceb8c771b482bf217b0218061c9b4ef81f9c9fa
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sun Apr  3 13:37:53 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun Apr  3 13:37:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=6ceb8c77

Add check_JAVA to BUILT_SOURCES

When using -j8 it could happen that the java sources were not recompiled
after changing the grammar file. Now they are listed in BUILT_SOURCES so
they get rebuilt before javac testing happens.

---
 Makefile.am |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 44cdcba..43796c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -104,7 +104,8 @@ GENERATED_WALKER_H = libbashWalker.h
 BUILT_SOURCES = $(GENERATED_PARSER_C) \
 				$(GENERATED_PARSER_H) \
 				$(GENERATED_WALKER_C) \
-				$(GENERATED_WALKER_H)
+				$(GENERATED_WALKER_H) \
+				$(check_JAVA)
 CLEANFILES = $(GENERATED_PARSER_C) \
 			 $(GENERATED_PARSER_H) \
 			 $(GENERATED_WALKER_C) \



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-04-02 15:50 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-04-02 15:50 UTC (permalink / raw
  To: gentoo-commits

commit:     edefa979330d74b788db8fbed031340d9da39fa1
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Apr  2 15:48:14 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Apr  2 15:48:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=edefa979

Fix walker.run target outputting GEN twice

---
 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e14c26a..0ef756a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -170,7 +170,7 @@ walker.run: bashast/libbashWalker.g cgrammar.run
 	$(AM_V_at)touch $@.tmp
 	$(AM_V_GEN)$(ANTLR) -fo . $<
 	$(AM_V_at)sed -i -e 's/\(libbash_.*\) = NULL/\1/' libbashWalker.c
-	$(AM_V_GEN)mv $@.tmp $@
+	$(AM_V_at)mv $@.tmp $@
 
 $(GENERATED_PARSER_C): cgrammar.run
 $(GENERATED_PARSER_H): cgrammar.run



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-30 12:48 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-30 12:48 UTC (permalink / raw
  To: gentoo-commits

commit:     6fc0febdea520ec8ffb8b6ba4a19868805059795
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Wed Mar 30 12:39:15 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Wed Mar 30 12:39:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=6fc0febd

Fix make distcheck

make distcheck was broken for handling javagrammar.run.

---
 Makefile.am |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9207722..e8bbdb6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -101,7 +101,7 @@ CLEANFILES = $(GENERATED_PARSER_C) \
 			 libbash.tokens \
 			 bashast/bashast.tokens \
 			 libbashWalker.tokens \
-			 bashast/javagrammar.run \
+			 javagrammar.run \
 			 cgrammar.run \
 			 walker.run
 
@@ -158,9 +158,9 @@ $(GENERATED_PARSER_H): cgrammar.run
 $(GENERATED_WALKER_C): walker.run
 $(GENERATED_WALKER_H): walker.run
 
-bashast/javagrammar.run: bashast/bashast.g
+javagrammar.run: bashast/bashast.g
 	$(AM_V_at)touch $@.tmp
 	$(AM_V_GEN)$(ANTLR) -fo bashast $<
 	$(AM_V_at)mv $@.tmp $@
 
-$(check_JAVA): bashast/javagrammar.run
+$(check_JAVA): javagrammar.run



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-27  8:56 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-27  8:56 UTC (permalink / raw
  To: gentoo-commits

commit:     5bd8bcf2282a165132b403a0246a3a04315835f1
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Mar 26 21:57:58 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 21:57:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=5bd8bcf2

Hidden visibility for generated .c files

CXXFLAGS is not in use for .c files so the antlr generated files ended
up in the symbol table. This is now fixed.

---
 Makefile.am |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b30ae49..faecc69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -117,9 +117,12 @@ libcppbash_la_SOURCES = src/cppbash_builtin.cpp \
 						src/core/interpreter.h \
 						src/core/symbols.hpp \
 						$(GENERATED_WALKER_C)
-libcppbash_la_CXXFLAGS = $(AM_CXXFLAGS) \
-						 -fvisibility=hidden \
-						 -fvisibility-inlines-hidden
+
+HIDDEN_FLAGS = -fvisibility=hidden \
+			   -fvisibility-inlines-hidden
+
+libcppbash_la_CXXFLAGS = $(AM_CXXFLAGS) $(HIDDEN_FLAGS)
+libcppbash_la_CFLAGS = $(AM_CFLAGS) $(HIDDEN_FLAGS)
 
 EXTRA_DIST = bashast/bashast.g \
 			 bashast/bashwalker.g \



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 19:08 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 19:08 UTC (permalink / raw
  To: gentoo-commits

commit:     7e3c4668c4cce1f722536aa362bfaeb8cc1825ba
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 12:37:52 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 12:42:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=7e3c4668

Fix .gitignore for *.swp and add *.swo

*.swp and *.swo are used to ignore temporary files created by vim.

---
 .gitignore |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index efb8f82..35588e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
-.*.swp
+*.swp
+*.swo
 *.o
 *.la
 *.lo



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 19:08 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 19:08 UTC (permalink / raw
  To: gentoo-commits

commit:     8e6943abc8710756971ffb1c719d9ef67dd36df7
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Mar 26 12:41:03 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 12:41:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=8e6943ab

Add Mu Qiao to authors

---
 AUTHORS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 9fcb346..55ec4a1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,3 @@
 Nathan Eloe <powerofazure@gmail.com>
 Petteri Räty <betelgeuse@gentoo.org>
+Mu Qiao <qiaomuf@gentoo.org>



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 12:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     f010d98d959d13affd691d2a8306f2beef5edaab
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Mar 26 10:31:36 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 11:16:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=f010d98d

Enable automake silent rules

Much easier to follow the output when a ton of stuff is not printed.

---
 Makefile.am  |   24 ++++++++++++------------
 configure.ac |    3 ++-
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 3c5a738..4d66b8a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -118,25 +118,25 @@ EXTRA_DIST = bashast/bashast.g \
 			 $(GUNIT_LOG_COMPILER)
 
 coding_standard.pdf: coding_standard/coding_standard.tex
-	@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
+	$(AM_V_GEN)@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
 
 ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool
 
 cgrammar.run: bashast.g
-	touch $@.tmp
-	$(ANTLR) -fo . $<
-	mv $@.tmp $@
+	$(AM_V_at)touch $@.tmp
+	$(AM_V_GEN)$(ANTLR) -fo . $<
+	$(AM_V_at)mv $@.tmp $@
 
 bashast.g: bashast/bashast.g
-	sed -e 's/CommonTree/pANTLR3_BASE_TREE/g' -e 's/Java/C/g' $< > $@
+	$(AM_V_at)sed -e 's/CommonTree/pANTLR3_BASE_TREE/g' -e 's/Java/C/g' $< > $@
 
 # Avoid initializing C++ type to NULL by sed, variables whose name
 # starts with libbash_ will be stripped
 walker.run: bashast/bashwalker.g cgrammar.run
-	touch $@.tmp
-	$(ANTLR) -fo . $<
-	sed -i -e 's/\(libbash_.*\) = NULL/\1/' bashwalker.c
-	mv $@.tmp $@
+	$(AM_V_at)touch $@.tmp
+	$(AM_V_GEN)$(ANTLR) -fo . $<
+	$(AM_V_at)sed -i -e 's/\(libbash_.*\) = NULL/\1/' bashwalker.c
+	$(AM_V_GEN)mv $@.tmp $@
 
 $(GENERATED_PARSER_C): cgrammar.run
 $(GENERATED_PARSER_H): cgrammar.run
@@ -145,8 +145,8 @@ $(GENERATED_WALKER_C): walker.run
 $(GENERATED_WALKER_H): walker.run
 
 bashast/javagrammar.run: bashast/bashast.g
-	touch $@.tmp
-	$(ANTLR) -fo bashast $<
-	mv $@.tmp $@
+	$(AM_V_at)touch $@.tmp
+	$(AM_V_GEN)$(ANTLR) -fo bashast $<
+	$(AM_V_at)mv $@.tmp $@
 
 $(check_JAVA): bashast/javagrammar.run

diff --git a/configure.ac b/configure.ac
index 445460e..5dd5b0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,8 @@ dnl #############################################
 AC_PREREQ(2.65)
 AC_CONFIG_MACRO_DIR([m4])
 AC_INIT([libbash],[0.1],[powerofazure@gmail.com])
-AM_INIT_AUTOMAKE([foreign parallel-tests color-tests subdir-objects])
+AM_INIT_AUTOMAKE([foreign parallel-tests color-tests subdir-objects 1.11])
+AM_SILENT_RULES([yes])
 AC_PROG_CXX
 LT_INIT
 



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 12:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     986ef45bb379a1f70061498613a6284dbf8d28aa
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Mar 26 10:09:06 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 11:16:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=986ef45b

Enable libstdc++ debug mode for developers

---
 Makefile.am  |    6 +++++-
 configure.ac |    7 ++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 229c11a..21342d5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,7 +55,11 @@ COMMON_FLAGS = $(BOOST_CPPFLAGS) -std=c++0x -I$(top_srcdir)/src/
 # code embedded in them.
 # no DEVELOPER_FLAGS to as the generated files don't pass -Werror
 AM_CFLAGS = -x c++ $(COMMON_FLAGS)
-AM_CXXFLAGS = $(COMMON_FLAGS) @DEVELOPER_FLAGS@
+AM_CXXFLAGS = $(COMMON_FLAGS)
+if DEVELOPER_MODE
+AM_CXXFLAGS += -Wall -Werror
+AM_CPPFLAGS = -D_GLIBCXX_DEBUG
+endif
 
 if HAVE_GTEST
 TESTS += core_unittests builtin_unittests post_check

diff --git a/configure.ac b/configure.ac
index 27276fa..445460e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,9 +24,10 @@ AC_PROG_CXX
 LT_INIT
 
 AC_ARG_ENABLE([developer],
-			  [AS_HELP_STRING([--enable-developer],[makes compiler warnings errors])],
-			  [AS_IF([test "x$enable_developer" != xno],[AC_SUBST(DEVELOPER_FLAGS,["-Wall -Werror"])]]))
-AS_IF([test "x$enable_developer" != xno],[boost_version="1.46.1"],[boost_version="1.43.0"])
+			  [AS_HELP_STRING([--enable-developer],[enables various QA checks])])
+AM_CONDITIONAL([DEVELOPER_MODE],[test "x$enable_developer" = xyes])
+
+AS_IF([test "x$enable_developer" = xyes],[boost_version="1.46.1"],[boost_version="1.43.0"])
 AX_BOOST_BASE([$boost_version],[:],
 			  [AC_MSG_ERROR([Needed boost not found])])
 AX_BOOST_SYSTEM



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 12:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     e6eb71d9496b4c14596e01a193b630810a46eddd
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri Mar 25 21:14:47 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Mar 25 21:14:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=e6eb71d9

Fix walker make rule

The old rule was also running bashast.g again which caused rebuilds due
to for example bashastLexer.c timestamp changing. Now the walker
generation rule just depends on cgrammar.run.

---
 Makefile.am |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 59657ad..0d47f9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -132,9 +132,9 @@ bashast.g: bashast/bashast.g
 
 # Avoid initializing C++ type to NULL by sed, variables whose name
 # starts with libbash_ will be stripped
-walker.run: bashast/bashwalker.g
+walker.run: bashast/bashwalker.g cgrammar.run
 	touch $@.tmp
-	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 bashast.g -fo . $<
+	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 -fo . $<
 	sed -i -e 's/\(libbash_.*\) = NULL/\1/' bashwalker.c
 	mv $@.tmp $@
 



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 12:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     e31a500017b0d2f30dd7f2bb35e0996f02aae817
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri Mar 25 22:15:04 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Mar 25 22:15:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=e31a5000

Add developer option to autotools

When you give --enable-developer to configure sources get built with
-Wall -Werror. In this case boost 1.45 seems to give errors so boost
1.46.1 is marked as the needed version.

---
 Makefile.am  |    6 ++++--
 autogen.sh   |    2 +-
 configure.ac |    8 +++++++-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 65bd783..229c11a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,10 +50,12 @@ TESTS = $(GUNIT_TESTS)
 check_JAVA = bashast/bashastLexer.java bashast/bashastParser.java
 AM_JAVACFLAGS = -classpath @antlr_cp@
 
-AM_CXXFLAGS=$(BOOST_CPPFLAGS) -std=c++0x -I$(top_srcdir)/src/
+COMMON_FLAGS = $(BOOST_CPPFLAGS) -std=c++0x -I$(top_srcdir)/src/
 # We use -x c++ to compile all C source files as C++ because there's C++
 # code embedded in them.
-AM_CFLAGS=-x c++ $(AM_CXXFLAGS)
+# no DEVELOPER_FLAGS to as the generated files don't pass -Werror
+AM_CFLAGS = -x c++ $(COMMON_FLAGS)
+AM_CXXFLAGS = $(COMMON_FLAGS) @DEVELOPER_FLAGS@
 
 if HAVE_GTEST
 TESTS += core_unittests builtin_unittests post_check

diff --git a/autogen.sh b/autogen.sh
index e18e24b..3ccf6d8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,2 +1,2 @@
 #!/bin/sh
-autoreconf -W all -i && ./configure --enable-gtest
+autoreconf -W all -i && ./configure --enable-gtest --enable-developer

diff --git a/configure.ac b/configure.ac
index 045fb49..27276fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,13 @@ AC_INIT([libbash],[0.1],[powerofazure@gmail.com])
 AM_INIT_AUTOMAKE([foreign parallel-tests color-tests subdir-objects])
 AC_PROG_CXX
 LT_INIT
-AX_BOOST_BASE(1.43.0,[:],[AC_MSG_ERROR([Needed boost not found])])
+
+AC_ARG_ENABLE([developer],
+			  [AS_HELP_STRING([--enable-developer],[makes compiler warnings errors])],
+			  [AS_IF([test "x$enable_developer" != xno],[AC_SUBST(DEVELOPER_FLAGS,["-Wall -Werror"])]]))
+AS_IF([test "x$enable_developer" != xno],[boost_version="1.46.1"],[boost_version="1.43.0"])
+AX_BOOST_BASE([$boost_version],[:],
+			  [AC_MSG_ERROR([Needed boost not found])])
 AX_BOOST_SYSTEM
 AX_BOOST_FILESYSTEM
 AC_PATH_PROG([JAVA],[java],"no")



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 12:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     0a5f9fdbd8a496963c13f20b82ae25a5a29f3cc9
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri Mar 25 21:21:21 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Mar 25 21:21:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=0a5f9fdb

Update ANTLR options and handling

ANTLR options are not declared in only one place. As our grammar files
generate simpler output now there's no need to raise the limits.

---
 Makefile.am |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 0d47f9d..65bd783 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -122,9 +122,11 @@ EXTRA_DIST = bashast/bashast.g \
 coding_standard.pdf: coding_standard/coding_standard.tex
 	@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
 
+ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool
+
 cgrammar.run: bashast.g
 	touch $@.tmp
-	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 -fo . $<
+	$(ANTLR) -fo . $<
 	mv $@.tmp $@
 
 bashast.g: bashast/bashast.g
@@ -134,7 +136,7 @@ bashast.g: bashast/bashast.g
 # starts with libbash_ will be stripped
 walker.run: bashast/bashwalker.g cgrammar.run
 	touch $@.tmp
-	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 -fo . $<
+	$(ANTLR) -fo . $<
 	sed -i -e 's/\(libbash_.*\) = NULL/\1/' bashwalker.c
 	mv $@.tmp $@
 
@@ -146,7 +148,7 @@ $(GENERATED_WALKER_H): walker.run
 
 bashast/javagrammar.run: bashast/bashast.g
 	touch $@.tmp
-	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 -fo bashast $<
+	$(ANTLR) -fo bashast $<
 	mv $@.tmp $@
 
 $(check_JAVA): bashast/javagrammar.run



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 12:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     42bb1918870f230062f362138c89452e541b704d
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Mar 26 10:20:45 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 11:16:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=42bb1918

Single binary for unittests

There's no benefit from splitting the unit tests to multiple programs so
in order to make build system maintenance easier just have single
cppunittests binary.

---
 .gitignore  |    4 +---
 Makefile.am |   36 ++++++++++++++----------------------
 2 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/.gitignore b/.gitignore
index a0936bd..efb8f82 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,9 +16,7 @@ install-sh
 missing
 Makefile
 autom4te.cache
-core_unittests
-builtin_unittests
-post_check
+cppunittests
 bashast.g
 bashast.tokens
 bashast/.DS_Store

diff --git a/Makefile.am b/Makefile.am
index 21342d5..3c5a738 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,29 +62,21 @@ AM_CPPFLAGS = -D_GLIBCXX_DEBUG
 endif
 
 if HAVE_GTEST
-TESTS += core_unittests builtin_unittests post_check
-check_PROGRAMS = core_unittests builtin_unittests post_check
-
-core_unittests_SOURCES = test/run_tests.cpp \
-						 src/core/tests/symbols_test.cpp \
-						 src/core/tests/interpreter_test.cpp
-core_unittests_LDADD = ${GTEST_LIBS} libcppbash.la
-core_unittests_LDFLAGS = -static
-
-builtin_unittests_SOURCES = test/run_tests.cpp \
-							src/builtins/tests/echo_tests.cpp \
-							src/builtins/tests/boolean_tests.cpp
-builtin_unittests_LDADD = ${GTEST_LIBS} libcppbash.la
-builtin_unittests_LDFLAGS = -static
-
-post_check_SOURCES = test/run_tests.cpp \
-					 test/post_check.cpp \
-					 test/walker_test.cpp
-post_check_LDADD = ${GTEST_LIBS}\
-				   $(BOOST_SYSTEM_LIB)\
-				   $(BOOST_FILESYSTEM_LIB)\
-				   libcppbash.la
-post_check_LDFLAGS = -static
+TESTS += cppunittests
+check_PROGRAMS = cppunittests
+
+cppunittests_SOURCES =  test/run_tests.cpp \
+						src/core/tests/symbols_test.cpp \
+						src/core/tests/interpreter_test.cpp \
+						src/builtins/tests/echo_tests.cpp \
+						src/builtins/tests/boolean_tests.cpp \
+						test/post_check.cpp \
+						test/walker_test.cpp
+cppunittests_LDADD = libcppbash.la \
+					 $(GTEST_LIBS) \
+					 $(BOOST_SYSTEM_LIB) \
+					 $(BOOST_FILESYSTEM_LIB)
+cppunittests_LDFLAGS = -static
 endif
 
 GENERATED_PARSER_C = bashastLexer.c bashastParser.c



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 12:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     29880f341b68a46d17028be002ce0162541c6bce
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri Mar 25 20:42:36 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Mar 25 20:42:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=29880f34

Build shared library with hidden visilibity

Build the library with -fvisibility=hidden and
fvisibilitity-inlines-hidden for better performance. To be able to use
the internal classes in tests the unit test binaries are linked
statically.

---
 Makefile.am |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9bd9f59..e5b850d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,11 +63,13 @@ core_unittests_SOURCES = test/run_tests.cpp \
 						 src/core/tests/symbols_test.cpp \
 						 src/core/tests/interpreter_test.cpp
 core_unittests_LDADD = ${GTEST_LIBS} libcppbash.la
+core_unittests_LDFLAGS = -static
 
 builtin_unittests_SOURCES = test/run_tests.cpp \
 							src/builtins/tests/echo_tests.cpp \
 							src/builtins/tests/boolean_tests.cpp
 builtin_unittests_LDADD = ${GTEST_LIBS} libcppbash.la
+builtin_unittests_LDFLAGS = -static
 
 post_check_SOURCES = test/run_tests.cpp \
 					 test/post_check.cpp \
@@ -76,6 +78,7 @@ post_check_LDADD = ${GTEST_LIBS}\
 				   $(BOOST_SYSTEM_LIB)\
 				   $(BOOST_FILESYSTEM_LIB)\
 				   libcppbash.la
+post_check_LDFLAGS = -static
 endif
 
 GENERATED_PARSER_C = bashastLexer.c bashastParser.c
@@ -107,6 +110,9 @@ libcppbash_la_SOURCES = src/cppbash_builtin.cpp \
 						src/core/interpreter.h \
 						src/core/symbols.hpp \
 						$(GENERATED_WALKER_C)
+libcppbash_la_CXXFLAGS = $(AM_CXXFLAGS) \
+						 -fvisibility=hidden \
+						 -fvisibility-inlines-hidden
 
 EXTRA_DIST = bashast/bashast.g \
 			 bashast/bashwalker.g \



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-26 12:24 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-26 12:24 UTC (permalink / raw
  To: gentoo-commits

commit:     f3acc74012a9f4d97c8705d7c332b1605474a451
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri Mar 25 18:39:07 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Mar 25 21:11:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=f3acc740

Improve antlr grammar rules

The generated .run files should have older timestamps than the files the
rules generate to avoid possible rebuilds later. The .run files now also
have distinctive names.

---
 Makefile.am |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e5b850d..59657ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -94,8 +94,8 @@ CLEANFILES = $(GENERATED_PARSER_C) \
 			 bashast.tokens \
 			 bashast/bashast.tokens \
 			 bashwalker.tokens \
-			 bashast/grammar.run \
-			 grammar.run \
+			 bashast/javagrammar.run \
+			 cgrammar.run \
 			 walker.run
 
 lib_LTLIBRARIES = libcppbash.la
@@ -122,29 +122,31 @@ EXTRA_DIST = bashast/bashast.g \
 coding_standard.pdf: coding_standard/coding_standard.tex
 	@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
 
-grammar.run: bashast.g
+cgrammar.run: bashast.g
+	touch $@.tmp
 	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 -fo . $<
-	touch $@
+	mv $@.tmp $@
 
 bashast.g: bashast/bashast.g
 	sed -e 's/CommonTree/pANTLR3_BASE_TREE/g' -e 's/Java/C/g' $< > $@
 
+# Avoid initializing C++ type to NULL by sed, variables whose name
+# starts with libbash_ will be stripped
 walker.run: bashast/bashwalker.g
+	touch $@.tmp
 	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 bashast.g -fo . $<
-	touch $@
+	sed -i -e 's/\(libbash_.*\) = NULL/\1/' bashwalker.c
+	mv $@.tmp $@
 
-$(GENERATED_PARSER_C): grammar.run
-$(GENERATED_PARSER_H): grammar.run
+$(GENERATED_PARSER_C): cgrammar.run
+$(GENERATED_PARSER_H): cgrammar.run
 
-# Avoid initializing C++ type to NULL by sed, variables whose name
-# starts with libbash_ will be stripped
 $(GENERATED_WALKER_C): walker.run
-	sed -i -e 's/\(libbash_.*\) = NULL/\1/' $@
-
 $(GENERATED_WALKER_H): walker.run
 
-bashast/grammar.run: bashast/bashast.g
+bashast/javagrammar.run: bashast/bashast.g
+	touch $@.tmp
 	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 -fo bashast $<
-	touch $@
+	mv $@.tmp $@
 
-$(check_JAVA): bashast/grammar.run
+$(check_JAVA): bashast/javagrammar.run



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-25 12:11 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-25 12:11 UTC (permalink / raw
  To: gentoo-commits

commit:     a97da8ab1ae4e3cb76e93d7d751c09bdb6d9d694
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 18 08:59:40 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Mar 25 09:39:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=a97da8ab

Change target definition in Makefile.am

Avoid '+=' for target definition, change indentation.

---
 Makefile.am |   53 +++++++++++++++++++++++++++--------------------------
 1 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 7cb508d..31b2e60 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,24 +26,24 @@ TEST_EXTENSIONS= .gunit
 GUNIT_LOG_COMPILER = $(srcdir)/bashast/gunit/runtests.sh
 AM_GUNIT_LOG_FLAGS = @antlr_cp@:.
 GUNIT_TESTS = bashast/gunit/arith_main.gunit \
-		bashast/gunit/array.gunit \
-		bashast/gunit/assoc_array.gunit \
-		bashast/gunit/brace.gunit \
-		bashast/gunit/command_sub.gunit \
-		bashast/gunit/comment.gunit \
-		bashast/gunit/compound.gunit \
-		bashast/gunit/cond_main.gunit \
-		bashast/gunit/continued_lines.gunit \
-		bashast/gunit/expansions.gunit \
-		bashast/gunit/fname.gunit \
-		bashast/gunit/function.gunit \
-		bashast/gunit/list.gunit \
-		bashast/gunit/param_main.gunit \
-		bashast/gunit/pipeline.gunit \
-		bashast/gunit/proc_sub.gunit \
-		bashast/gunit/redir.gunit \
-		bashast/gunit/simp_command.gunit \
-		bashast/gunit/simp_prog.gunit
+			  bashast/gunit/array.gunit \
+			  bashast/gunit/assoc_array.gunit \
+			  bashast/gunit/brace.gunit \
+			  bashast/gunit/command_sub.gunit \
+			  bashast/gunit/comment.gunit \
+			  bashast/gunit/compound.gunit \
+			  bashast/gunit/cond_main.gunit \
+			  bashast/gunit/continued_lines.gunit \
+			  bashast/gunit/expansions.gunit \
+			  bashast/gunit/fname.gunit \
+			  bashast/gunit/function.gunit \
+			  bashast/gunit/list.gunit \
+			  bashast/gunit/param_main.gunit \
+			  bashast/gunit/pipeline.gunit \
+			  bashast/gunit/proc_sub.gunit \
+			  bashast/gunit/redir.gunit \
+			  bashast/gunit/simp_command.gunit \
+			  bashast/gunit/simp_prog.gunit
 
 TESTS = $(GUNIT_TESTS)
 # these get cleaned so only add autogenerated stuff or modify CLEANFILES
@@ -58,18 +58,19 @@ AM_CFLAGS=-x c++ $(AM_CXXFLAGS)
 if HAVE_GTEST
 TESTS += core_unittests builtin_unittests post_check
 check_PROGRAMS = core_unittests builtin_unittests post_check
-core_unittests_SOURCES = test/run_tests.cpp
-core_unittests_SOURCES += src/core/tests/symbols_test.cpp
+
+core_unittests_SOURCES = test/run_tests.cpp \
+						 src/core/tests/symbols_test.cpp
 core_unittests_LDADD = ${GTEST_LIBS}
 
-builtin_unittests_SOURCES = test/run_tests.cpp
-builtin_unittests_SOURCES += src/builtins/tests/echo_tests.cpp
-builtin_unittests_SOURCES += src/builtins/tests/boolean_tests.cpp
+builtin_unittests_SOURCES = test/run_tests.cpp \
+							src/builtins/tests/echo_tests.cpp \
+							src/builtins/tests/boolean_tests.cpp
 builtin_unittests_LDADD = ${GTEST_LIBS} libcppbash.la
 
-post_check_SOURCES = test/run_tests.cpp
-post_check_SOURCES += test/post_check.cpp
-post_check_SOURCES += test/walker_test.cpp
+post_check_SOURCES = test/run_tests.cpp \
+					 test/post_check.cpp \
+					 test/walker_test.cpp
 post_check_LDADD = ${GTEST_LIBS}\
 				   $(BOOST_SYSTEM_LIB)\
 				   $(BOOST_FILESYSTEM_LIB)\



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-17  9:44 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-17  9:44 UTC (permalink / raw
  To: gentoo-commits

commit:     6e3a2be9506cec19353ef890bc765ae3ec64c8eb
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Mar 12 14:52:23 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Mar 12 16:33:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=6e3a2be9

Fix make distcheck

---
 .gitignore  |    1 +
 Makefile.am |   26 +++++++++++++++++++-------
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index 63a1f7a..3966268 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
 .deps
 .libs
 .dirstamp
+*.tar.gz
 classcheck.stamp
 Makefile.in
 aclocal.m4

diff --git a/Makefile.am b/Makefile.am
index f262751..8e1ed45 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,7 +23,7 @@ include doxygen.am
 ACLOCAL_AMFLAGS = -I m4
 
 TEST_EXTENSIONS= .gunit
-GUNIT_LOG_COMPILER = bashast/gunit/runtests.sh
+GUNIT_LOG_COMPILER = $(srcdir)/bashast/gunit/runtests.sh
 AM_GUNIT_LOG_FLAGS = @antlr_cp@:.
 GUNIT_TESTS = bashast/gunit/arith_main.gunit \
 		bashast/gunit/array.gunit \
@@ -70,18 +70,30 @@ AM_CXXFLAGS=$(BOOST_CPPFLAGS) -std=c++0x
 
 GENERATED_C = bashastLexer.c bashastParser.c
 GENERATED_H = bashastLexer.h bashastParser.h
-CLEANFILES = $(GENERATED_C) $(GENERATED_H) bashast.g $(check_JAVA) bashast/grammar.run grammar.run
+CLEANFILES = $(GENERATED_C) \
+			 $(GENERATED_H) \
+			 bashast.g \
+			 $(check_JAVA) \
+			 bashast/grammar.run \
+			 grammar.run \
+			 bashast/bashast.tokens \
+			 bashast.tokens
 lib_LTLIBRARIES = libcppbash.la
-libcppbash_la_SOURCES = src/cppbash_builtin.cpp
-libcppbash_la_SOURCES += src/builtins/echo_builtin.cpp
-libcppbash_la_SOURCES += $(GENERATED_C)
+libcppbash_la_SOURCES = src/cppbash_builtin.cpp \
+						src/cppbash_builtin.h \
+						src/builtins/echo_builtin.cpp \
+						src/builtins/echo_builtin.h \
+						src/builtins/boolean_builtins.h \
+						$(GENERATED_C)
 libcppbash_la_CPPFLAGS = $(BOOST_CPPFLAGS)
 
+EXTRA_DIST = bashast/bashast.g $(GUNIT_TESTS) $(GUNIT_LOG_COMPILER)
+
 coding_standard.pdf: coding_standard/coding_standard.tex
 	@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
 
 grammar.run: bashast.g
-	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 $<
+	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 -fo . $<
 	touch $@
 
 $(GENERATED_C): grammar.run
@@ -91,7 +103,7 @@ bashast.g: bashast/bashast.g
 	sed -e 's/CommonTree/pANTLR3_BASE_TREE/g' -e 's/Java/C/g' $< > $@
 
 bashast/grammar.run: bashast/bashast.g
-	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 $<
+	@JAVA@ -classpath @antlr_cp@ -Xmx1024m org.antlr.Tool -Xconversiontimeout 20000 -fo bashast $<
 	touch $@
 
 $(check_JAVA): bashast/grammar.run



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-12 11:53 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-12 11:53 UTC (permalink / raw
  To: gentoo-commits

commit:     b3e3d24438e50a3a4a98ef860a72b04d154b3c88
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sat Mar 12 11:48:44 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Mar 12 11:52:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=b3e3d244

Turn on color-tests for automake

---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index d704dda..045fb49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ dnl #############################################
 AC_PREREQ(2.65)
 AC_CONFIG_MACRO_DIR([m4])
 AC_INIT([libbash],[0.1],[powerofazure@gmail.com])
-AM_INIT_AUTOMAKE([foreign parallel-tests subdir-objects])
+AM_INIT_AUTOMAKE([foreign parallel-tests color-tests subdir-objects])
 AC_PROG_CXX
 LT_INIT
 AX_BOOST_BASE(1.43.0,[:],[AC_MSG_ERROR([Needed boost not found])])



^ permalink raw reply related	[flat|nested] 60+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: /
@ 2011-03-06 12:05 Petteri Räty
  0 siblings, 0 replies; 60+ messages in thread
From: Petteri Räty @ 2011-03-06 12:05 UTC (permalink / raw
  To: gentoo-commits

commit:     f67465937c87b0887c1e0094e921b6469fc557a1
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sun Mar  6 12:01:51 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun Mar  6 12:01:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=f6746593

Merge branch 'buildsystem'

Conflicts:
	Makefile.am


 Makefile.am       |    8 ++++++++
 bashast/bashast.g |   42 +++++++++++++++++++++---------------------
 configure.ac      |   36 ++++++++++++++++++------------------
 3 files changed, 47 insertions(+), 39 deletions(-)

diff --cc Makefile.am
index 33064bb,09d7311..3f2cbab
--- a/Makefile.am
+++ b/Makefile.am
@@@ -35,8 -34,11 +35,11 @@@ builtin_unittests_SOURCES += src/builti
  builtin_unittests_LDADD = ${GTEST_LIBS} libcppbash.la
  endif
  
 -AM_CXXFLAGS=-std=c++0x
 +AM_CXXFLAGS=$(BOOST_CPPFLAGS) -std=c++0x
  
+ GENERATED_C = bashastLexer.c bashastParser.c
+ GENERATED_H = bashastLexer.h bashastParser.h
+ CLEANFILES = $(GENERATED_C) $(GENERATED_H) bashast.g
  lib_LTLIBRARIES = libcppbash.la
  libcppbash_la_SOURCES = src/cppbash_builtin.cpp
  libcppbash_la_SOURCES += src/builtins/echo_builtin.cpp
diff --cc configure.ac
index 7b361f9,cbd5058..d9da894
--- a/configure.ac
+++ b/configure.ac
@@@ -19,10 -19,10 +19,10 @@@ dnl ###################################
  AC_PREREQ(2.65)
  AC_CONFIG_MACRO_DIR([m4])
  AC_INIT([libbash],[0.1],[powerofazure@gmail.com])
- AM_INIT_AUTOMAKE([parallel-tests subdir-objects])
+ AM_INIT_AUTOMAKE([foreign parallel-tests subdir-objects])
  AC_PROG_CXX
  LT_INIT
 -AX_BOOST_BASE
 +AX_BOOST_BASE(1.43.0,[:],[AC_MSG_ERROR([Needed boost not found])])
  AC_PATH_PROG([JAVA],[java],"no")
  if test "$JAVA" = "no"; then
  	AC_MSG_ERROR([No java executable found])



^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2012-08-19 14:54 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-26 13:38 [gentoo-commits] proj/libbash:master commit in: / Petteri Räty
  -- strict thread matches above, loose matches on Subject: below --
2012-08-19 14:54 Petteri Räty
2012-06-03  9:08 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 13:53 Petteri Räty
2011-07-20 14:01 Petteri Räty
2011-07-08 14:03 Petteri Räty
2011-07-08 14:03 Petteri Räty
2011-07-03 20:21 Petteri Räty
2011-06-26 13:38 Petteri Räty
2011-06-25 10:30 Petteri Räty
2011-06-25 10:05 Petteri Räty
2011-06-16 16:53 Petteri Räty
2011-06-11  8:52 Petteri Räty
2011-06-11  8:52 Petteri Räty
2011-06-11  8:24 Petteri Räty
2011-06-03 14:48 Petteri Räty
2011-06-03 12:43 Petteri Räty
2011-05-27 23:03 Petteri Räty
2011-05-24 14:50 Petteri Räty
2011-05-14 14:58 Petteri Räty
2011-05-14 14:58 Petteri Räty
2011-05-12 14:06 Petteri Räty
2011-05-11  7:19 Petteri Räty
2011-05-08 13:07 Petteri Räty
2011-05-07 12:25 Petteri Räty
2011-04-27 15:11 Petteri Räty
2011-04-20 11:26 Petteri Räty
2011-04-17 10:58 Petteri Räty
2011-04-14  4:50 Petteri Räty
2011-04-14  4:50 Petteri Räty
2011-04-12 18:29 Petteri Räty
2011-04-11  6:50 Petteri Räty
2011-04-09 13:08 Petteri Räty
2011-04-08 11:12 Petteri Räty
2011-04-07 16:44 Petteri Räty
2011-04-03 13:46 Petteri Räty
2011-04-03 13:46 Petteri Räty
2011-04-02 15:50 Petteri Räty
2011-03-30 12:48 Petteri Räty
2011-03-27  8:56 Petteri Räty
2011-03-26 19:08 Petteri Räty
2011-03-26 19:08 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-25 12:11 Petteri Räty
2011-03-17  9:44 Petteri Räty
2011-03-12 11:53 Petteri Räty
2011-03-06 12:05 Petteri Räty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox