aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Parser&Walker: allow multiple arithmetic expressionsMu Qiao2012-02-281-78/+79
|
* Parser&Walker: support nested arithmetic expansionMu Qiao2011-08-021-0/+1
|
* Parser: remove tokens for assignmentMu Qiao2011-08-021-10/+10
| | | | | These tokens would prevent the parser doing parameter expansions. Now this is fixed.
* Parser: remove tokens for += and -=Mu Qiao2011-08-021-2/+2
| | | | This makes ${a:-=} and ${a:+=} work properly.
* Parser: support == in arithmetic comparisonMu Qiao2011-08-021-0/+1
|
* Parser: remove global backtrackingMu Qiao2011-07-201-21/+19
| | | | | | | Now several tests are not working: var_expansion.bash, isolated_functions.bash, compound_command.bash, test_expr.bash, test/ast_printer_test.sh, and test/verify_bashs_test.sh. We will fix them in later commits.
* Parser: support writing C++ code in the grammarMu Qiao2011-06-211-1/+1
|
* Parser: support != in arithmetic expansionMu Qiao2011-06-091-0/+1
|
* Parser: allow spaces at the end of arithmetic expansionMu Qiao2011-06-011-0/+1
|
* Parser: prevent arithmetic assign to numbersPetteri Räty2011-04-201-0/+1
| | | | | | Within arithmetic expressions digits can't be variables so doing $((3=7)) is not valid. Now we don't allow digits to match variable names in arithmetic. This also silences warnings.
* Parser: fix warnings from unary rulePetteri Räty2011-04-201-0/+3
|
* Parser: deprecated syntax for arithmetic expansionPetteri Räty2011-04-171-0/+1
| | | | | | Eclasses seem to be using a deprecated form of arithmetic expansion with square brackets that bash does not document anywhere. This is now supported by the parser.
* Support arithmetic assignment for variable expansionMu Qiao2011-04-141-0/+3
| | | | | Our parser grammar didn't support arithmetic assignment inside variable expansion like $((${foo[5]}=3)). Now it's supported.
* Fix parameter expansion in arithmetic expansionMu Qiao2011-04-141-4/+4
| | | | | Parameter expansion happens before arithmetic expansion when it's used in arithmetic expansion. So the AST is changed to reflect it.
* Support array element in arithmetic expansionMu Qiao2011-04-141-0/+3
| | | | | Array element reference and assignment in arithmetic expansion is supported now.
* Remove warning from arithmetic_partPetteri Räty2011-04-091-2/+2
| | | | | There's no need to list both alternatives as the first choice falls through to the second any way.
* Improve support for arithmetic expressionsPetteri Räty2011-04-091-10/+12
| | | | | | | Things like double negation $((!!a)) were not supported. Fixing this resulted in bubbled changes elsewhere. The main change is that we have less specialized tokens so that we don't end up with special tokens in wrong contexts.
* Rename tdm to times_division_modulusPetteri Räty2011-04-081-1/+1
|
* Support arithmetic expansion in double quoted stringMu Qiao2011-04-031-3/+3
| | | | A virtual token is added to avoid ambiguity.
* Split ARITH_ASSIGN into independent tokensMu Qiao2011-03-291-0/+9
| | | | | It would be easier for the walker to deal with arithmetic assignment if the ARITH_ASSIGN is splitted into independent tokens.
* Refer to git log for copyright informationPetteri Räty2011-03-261-1/+1
| | | | | | | Having to manually keep the year and names updated in each source file is prone to not remembering to keep it up to date. The same information can be found from git so just refer people to that. In most places it's not a requirement to explicitly state such things.
* Fix copyright format, add missing copyrightMu Qiao2011-03-261-13/+14
| | | | | Use the format according to http://www.gnu.org/licenses/gpl-howto.html, unify indentation.
* Naive interpreter implementationMu Qiao2011-03-241-5/+7
| | | | | Arithmetic operations are implemented. A slight change is made to grammar to avoid ambiguity.
* DOUBLE/SINGLE_QUOTED_STRING virtual tokensNathan Eloe2010-08-041-1/+1
| | | | | | | | Adds a virtual token to differentiate between quoted and non-quoted strings. This will be useful for programs like repoman that will use the tree directly. examples: "abc" -> (STRING (DOUBLE_QUOTED_STRING abc)) 'abc'123 -> (STRING (SINGLE_QUOTED_STRING abc) 123)
* Arithmetic expansion: $(( ))Nathan Eloe2010-08-011-0/+5
| | | | | Parser now supports arithmetic expansion using the $(( )) construct. Within the (( )) construct, variable names no longer need a $ to reference.
* Bug fix: arithmetic expansion missing featuresNathan Eloe2010-08-011-0/+12
| | | | | Adds support for the following arithmetic constructs: Arithmetic assignment, arithmetic conditionals, and the comma operator.
* Language agnostic grammar fileNathan Eloe2010-07-181-4/+4
| | | | | | | | | | | | | | | The bashast grammar no longer relies on Java specific constructs and names. In order to use with other languages, the "language=" line must be changed. Also, the "ASTLabelType=" line must be changed for languages other than Java. These changes will be made by the build system for the project. Token aggregation in parser rules has been removed. Now, parts of aggregated tokens are grouped under new virtual tokens. This removes the problems with the $label.text addition in C. Some rule names conflicted with preexisiting functions or keywords in C. These rules (exp, bitand, bitor, bitxor) have been renamed: exponential, bitwiseand, bitwiseor, bitwisexor.
* Merging fragment ASTs into main ASTNathan Eloe2010-06-241-0/+95
Incorporates arithmetic expansion, conditional statements, parameters into AST. Moves redirect operator tokens to parser rules to avoid conflicts. Implements unit tests for new functionality of main AST grammar. Grammars for fragment ASTs needed to be rewritten to fit with current grammar. As such, some changes have been made: * AST for arithmetic expansion has been simplified, removing virt. tokens. * New virtual token: LIST_EXPAND for var_exp, avoid ambiguity NOTE: Because of conflicts, comments must be preceded with a space or EOL. As such, a comment can no longer be the first line in a program. A blank line may be the first line, thus allowing a comment first.