Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updates to shasta for bash * Implemented all types of bash redirects * update redirection structure * fix time node implementation * all bash tests pass shasta * Shasta passing all bash scripts including those with SOH * bug fixes to make sure we're still compatible with dash * minor bug fix * bug fix for arith nodes * bug fix eof edge case * Integrate bash and dash tests * Add global BASH_MODE Somewhat of a bad practice but, otherwise, every class that calls string_of_arg would have to have a bash_mode field to change behavior for it * Don't escape dollar signs for bash mode Currently, bash mode interprets all characters as CArgChar, relying on the user to manually expand as necessary. This breaks string_of_arg, since it escapes all '$' CArgChars, assuming that it shouldn't be interprted as variable interpolation when it's pretty printed. This disables escaping in bash mode. * Backport bash changes to python 3.8 Only requires adding a few "from __future__ import annotations" to allow type hints like list[int] to be used instead of List[int] * Add BashNode superclass marker * Fix type hinting as possible Type hinting is only being used for documentation at this time, but it's good to use specific and syntactically correct type hints. However, to use the type checker in a useful way, you'd have to use isinstance instead of string tags for the AstNodes (or an equivalent "is_type(*AstNode)" function). * Remove unused bash code * Add bash documentation * Add libbash as dependency * Remove libbash as dependency See #5 (comment) For tests, libbash (and now libdash) are dev dependencies. * Fix typo * Format new code * Fix linting errors * Refactor utf-8 check * Refactor BASH_MODE for global variable Caused very annoying bug in that bash_node was being set in the bash parsing code, but then dash parsing code is called internally, then bash parsed objects print out in dash mode. Side note: this is why they teach that globals are bad in intro to CS! * Fix code typo * Update shasta version Signed-off-by: Bolun Thompson <[email protected]> * Add case fall through support Signed-off-by: Bolun Thompson <[email protected]> * Fix case bug Signed-off-by: Bolun Thompson <[email protected]> --------- Signed-off-by: Bolun Thompson <[email protected]> Co-authored-by: sethsabar <[email protected]>
- Loading branch information