Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | eshtrans/backend: Add support for static vars and functions | P. J. McDermott | 2016-02-22 | 2 | -0/+64 |
| | |||||
* | eshtrans/backend: Generate translation unit ID | P. J. McDermott | 2016-02-22 | 5 | -3/+21 |
| | |||||
* | eshtrans: Add proper user interface | P. J. McDermott | 2016-02-21 | 1 | -95/+69 |
| | |||||
* | Remove old demo parsing code | P. J. McDermott | 2016-02-21 | 4 | -1838/+0 |
| | |||||
* | eshtrans/frontend: Fix line numbers | P. J. McDermott | 2016-02-21 | 2 | -2/+6 |
| | |||||
* | eshtrans/frontend: Escape "$" in patterns | P. J. McDermott | 2016-02-21 | 1 | -3/+3 |
| | |||||
* | eshtrans: Accept any input file | P. J. McDermott | 2016-02-21 | 1 | -3/+5 |
| | | | | eshtrans is now able to compile itself. | ||||
* | eshtrans/frontend: Fix validation patterns in accept() | P. J. McDermott | 2016-02-21 | 1 | -4/+6 |
| | |||||
* | eshtrans/frontend: Handle T_IO_NUMBERs | P. J. McDermott | 2016-02-21 | 4 | -3/+34 |
| | | | | Also fix a couple bugs in accept(). | ||||
* | eshtrans/frontend: Don't trim trailing tokens from scanners | P. J. McDermott | 2016-02-21 | 2 | -28/+19 |
| | | | | | | | | | | | | | | | | | | Before we'd get things like this: Input: $(foo bar) Output: $(foo ) Input: $(($(foo bar) + 1)) Output: $(($(foo ) + 1)) Now we get things like this: Input: $(foo bar) Output: $(foo bar ) Input: $(($(foo bar) + 1)) Output: $(($(foo bar ) + 1)) | ||||
* | eshtrans/backend: Don't add a space after "(" | P. J. McDermott | 2016-02-21 | 2 | -5/+8 |
| | |||||
* | eshtrans/frontend: Count singly quoted newlines | P. J. McDermott | 2016-02-21 | 2 | -2/+7 |
| | |||||
* | eshtrans/frontend: Fix missing ";;" | P. J. McDermott | 2016-02-21 | 1 | -0/+1 |
| | | | | | eshtrans caught an actual syntax error in itself (!), although oddly other shells didn't consider this an error. | ||||
* | eshtrans/frontend: Fix handling of single quote in double quotes | P. J. McDermott | 2016-02-21 | 2 | -2/+13 |
| | |||||
* | eshtrans/frontend: Don't eat char after wordexp in arithmetic | P. J. McDermott | 2016-02-21 | 2 | -3/+6 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: Trying script: $(($foo + 1)) Tokens: T_FNAME<US>$(($foo+ 1))<RS>T_NEWLINE<RS>T_EOF<RS> Token: function name "$(($foo+ 1))" Token: newline Token: end of file Generated code: $(($foo+ 1)) Trying script: $((1 + $foo)) stdin:1: Syntax error: Arithmetic expansion: ")" unexpected FAIL After: Trying script: $(($foo + 1)) Tokens: T_FNAME<US>$(($foo + 1))<RS>T_NEWLINE<RS>T_EOF<RS> Token: function name "$(($foo + 1))" Token: newline Token: end of file Generated code: $(($foo + 1)) Trying script: $((1 + $foo)) Tokens: T_FNAME<US>$((1 + $foo))<RS>T_NEWLINE<RS>T_EOF<RS> Token: function name "$((1 + $foo))" Token: newline Token: end of file Generated code: $((1 + $foo)) | ||||
* | eshtrans/frontend: Fix handling of words beginning with "\" | P. J. McDermott | 2016-02-21 | 2 | -14/+42 |
| | |||||
* | eshtrans: Add tests with comments and leading linebreaks | P. J. McDermott | 2016-02-21 | 1 | -1/+4 |
| | |||||
* | eshtrans/frontend: Accept leading linebreaks | P. J. McDermott | 2016-02-21 | 1 | -0/+1 |
| | |||||
* | Copy everything into a new eshtrans/ directory | P. J. McDermott | 2016-02-21 | 8 | -0/+2003 |
| | | | | | | | Split out and rename functions and variables where appropriate. Also add license headers. (The old scripts under parsing/ can be used under the same license.) | ||||
* | accept(): Use toktext() | P. J. McDermott | 2016-02-21 | 2 | -5/+7 |
| | |||||
* | tokname(): Quote symbols | P. J. McDermott | 2016-02-21 | 1 | -35/+35 |
| | |||||
* | toktext(): Move to tokens.sh | P. J. McDermott | 2016-02-21 | 2 | -60/+60 |
| | |||||
* | Add a couple more tests | P. J. McDermott | 2016-02-21 | 1 | -1/+3 |
| | |||||
* | Don't loop forever on unterminated singly quoted string in words | P. J. McDermott | 2016-02-21 | 2 | -7/+14 |
| | |||||
* | Improve backslash and quote handling in words | P. J. McDermott | 2016-02-21 | 2 | -5/+30 |
| | |||||
* | Preserve leading backslashes in words | P. J. McDermott | 2016-02-21 | 2 | -3/+9 |
| | |||||
* | Remove quotes in here-document delimiters | P. J. McDermott | 2016-02-21 | 2 | -3/+4 |
| | |||||
* | Improve demo output | P. J. McDermott | 2016-02-21 | 1 | -5/+8 |
| | |||||
* | Fix handling of newlines with here-documents | P. J. McDermott | 2016-02-21 | 1 | -12/+8 |
| | | | | | Sequential here-documents were getting indented. Everything after a newline was being considered a here-document. | ||||
* | Fix handling of multiple here-documents on a line | P. J. McDermott | 2016-02-21 | 2 | -45/+44 |
| | |||||
* | Drop mentions of arithmetic stack elements | P. J. McDermott | 2016-02-21 | 1 | -5/+1 |
| | |||||
* | Don't indent lines in generated code | P. J. McDermott | 2016-02-21 | 1 | -2/+9 |
| | | | | Doing so can break here-documents. | ||||
* | Implement here-document | P. J. McDermott | 2016-02-21 | 2 | -4/+156 |
| | | | | Also fix some I/O redirection operator bugs. | ||||
* | Implement arithmetic expansion | P. J. McDermott | 2016-02-20 | 2 | -9/+68 |
| | |||||
* | Reticulate splines | P. J. McDermott | 2016-02-20 | 1 | -8/+6 |
| | |||||
* | scan_wordexp_param_brace(): New function | P. J. McDermott | 2016-02-20 | 2 | -123/+137 |
| | |||||
* | scan_wordexp(): Catch and rethrow some uncaught exceptions | P. J. McDermott | 2016-02-20 | 1 | -3/+10 |
| | |||||
* | Rewrite codegen | P. J. McDermott | 2016-02-20 | 3 | -18/+78 |
| | | | | | | | | The previous version didn't handle nested or multiple command substitutions. The stack format has also been extended to support arithmetic expansions. | ||||
* | s/pgetc/lgetc/ | P. J. McDermott | 2016-02-20 | 1 | -47/+47 |
| | | | | It reads input characters for the lexer, not the parser. | ||||
* | Organize lexer functions | P. J. McDermott | 2016-02-20 | 1 | -44/+64 |
| | |||||
* | Move parse_sub() logic into lexer | P. J. McDermott | 2016-02-20 | 2 | -63/+48 |
| | | | | | | | | | | Now the parser starts the lexer, which in turn starts the parser. Previously, the parser started both the lexer and itself and then asked the lexer all kinds of personal questions, like "Where are you?", "Whatcha doin'?", and "What are you wearing?". No one wants to know what their lexer is wearing. Seriously, don't ask. Parsers should mind their own business. Social interactions and personal questions between code modules should be kept to a minimum. | ||||
* | Don't eat the first token after a command substitution | P. J. McDermott | 2016-02-20 | 2 | -16/+15 |
| | |||||
* | Remove some "echo"s | P. J. McDermott | 2016-02-20 | 1 | -2/+0 |
| | |||||
* | Fix command substitution (warning: still ugly) | P. J. McDermott | 2016-02-20 | 1 | -1/+6 |
| | |||||
* | Implement command substitution (warning: ugly and broken) | P. J. McDermott | 2016-02-20 | 2 | -10/+63 |
| | |||||
* | Add code generation | P. J. McDermott | 2016-02-20 | 2 | -6/+97 |
| | |||||
* | Prepare for command substitution | P. J. McDermott | 2016-02-20 | 2 | -6/+34 |
| | |||||
* | Fix function definition parsing | P. J. McDermott | 2016-02-20 | 1 | -0/+2 |
| | | | | Well that was easy. | ||||
* | Fully trace most parser functions | P. J. McDermott | 2016-02-20 | 1 | -26/+114 |
| | |||||
* | Fix command separation | P. J. McDermott | 2016-02-20 | 1 | -9/+17 |
| | | | | | | `foo bar ( baz )` no longer gets parsed as `foo bar` and `( baz )`. Also restrict function names. |