-
Start analyzing OPy compiler output with R.
Andy Chu committedSep 10, 2018 Instead of 'opyc dis' taking an optional report_path, we now have 'opyc dis-tables', which outputs 5 tables related to Python's types.CodeObject: - frames - names - consts - ops - flags Some ad hoc analysis in R already produced some interesting results, e.g. how big the instructions are (~216 KB) vs. all the .pyc files (~918K). The rests is constants, metadata, .pyc headers, etc. Also: Make an intermediate file _build/oil/all-deps-py.txt. Right now we're counting the lines with it, but it make it easier to do metrics in general. (e.g. compilation time)
-
[release] Redesign the oilshell.org/releases.html table.
Also make 0.6.pre4 the latest download on the home page.
-
Add parse error for [[ -f < ]].
Unrelated: - Remove unnecessary code in osh2oil. - Minor cleanups of imports
-
Give a proper error message instead of a crash.
When 'a' in (( a++ )) is an array. Still needs location info.
-
[spec/array] Make stricter OSH behavior the correct one.
OSH is intentionally stricter in two ways: - arrays can't be used as environment bindings! - strings can't be indexed by integers; only arrays
-
-
[osh2oil] Fix crash when translating empty here doc.
Andy Chu committedSep 9, 2018 It seems like has to have another redirect after it. Example: git/t/t4015-diff-whitespace.sh The translation no longer crashes, but it's still wrong.
-
The Eof_Real token was being treated as a substitute for Eof_RParen, which was invalid. Fixes issue #144.
-
Reproduced 2 wild test failures with smaller tests.
- Notes about the span representation. - Update some comments. - 'oshc spans' prints to stdout, no stderr.
-
Tighten up the parser by adding expected errors.
- for something like 'echo a(b)'. - for something like 'do echo hi' This fixed spec tests in more than one file.
-
[osh2oil] Tweaks to avoid crashes.
- Avoid a crash in the special case of the empty file. - The line_id is -1 only in that case, which makes logical sense, but caused a crash. - We might want to have no zero-length spans then? Or say that Eof_Real doesn't produce a span? - Don't crash on ExtGlobPart. Though I'm not sure exactly how to translate this. Also: categorize a few more wild errors. -
Remove unnecessary assertion which caused a crash with nested here docs.
Uncovered by wild tests.
-
Fix parser crash bug exposed by wild tests.
Andy Chu committedSep 8, 2018 This was caused by the main_loop refactoring. Example of file that was crashing, and now parses: illumos-gate/usr/src/lib/libshell/common/tests/expand.sh
-
[osh2oil] Handle the 'until' loop, so it doesn't cause a crash.
Added test cases. Also: - Combine parsing and tree representation of while and until loops. The execution was already unified. - Fix the translation of while and until conditions, and add a test. while (( x == 0 )); now properly turns into while sh-expr ' x == 0 '.
-
'opyc dis' accepts a .py path too.
It will compile it first and then disassemble it.
-
Andy Chu committed
Sep 7, 2018 The gold test somehow doesn't trigger the errexit behavior?
-
Addressing 0.6.pre4 release issues.
Andy Chu committedSep 7, 2018 gold/errexit-confusion.sh: A confusing case in bash execution. The arena test is not failing properly. - Minor update to release index - Update OPy regtest checksums.
-
Found some errors: parser bugs tickled by 'wild' harness, arena test, opy regtest, etc.
-
-
- builtins: alias, unalias, compgen (partial) - modes: strict-word-eval (done), strict-var-eval (speculative) - latest ideas about Oil - including all the compatibility shims like sh-expr
-
Remove the last vestiges of error code handling.
Get rid of Error() and error_stack. We're using exceptions now. - Remove old comments - Rename back to VirtualLineReader
-
Fix 2 alias test cases by threading the ParseContext properly.
Down to 6 failures now, which are all related to aliasing grammatical constructs other than SimpleComamand. Unrealted: removed unused code in bool_parse.py
-
Introduce ParseContext and thread it throughout the code.
This is mainly motivated by 'alias'. Aliases are unfortunately truly global state. It also breaks some longstanding circular imports between word_parse.py and cmd_parse.py, which is nice. All unit, spec, and gold tests pass. Still need to do some cleanup.
-
-
[cleanup] Rename enums/simple ASDL sums used in core/legacy.py.
Andy Chu committedSep 6, 2018 -
Remove lexer code that supported the previous approach to alias.
Remove some other unused code, and add a comment about another approach that is more like dash and bash.
-
A different approach to implementing alias.
The previous approach of PushAliasBuffer() only worked for a single alias expansion. Iteration was a problem. Now we hook into ParseSimpleCommand and expand aliases iteratively. We join the expanded aliases with the rest of the *text* from the SimpleCommand, and then pass that into ParseCommand(). I made some comments about the cases that this doesn't handle. And also some notes about how dash and bash do it -- with global variables strewn throughout the parser. (Although I wonder if we could do that with self._Next() ? ) - Add more alias test cases - Factor some free functions out of CommandParser. All unit, spec, and gold tests pass.
-
Initial implementation of alias.
This isn't totally correct since multiple alias expansion aren't handled. But we go from 22 test cases failing to 6! The alias expansion is detected in CommandParser.ParseCommand(), and then we push a buffer onto the Lexer at that point. This seems to be the correct place to do it. Addresses issue #160.
-
Rename compgen test for consistency.
Use args.UsageError more consistently through core/builtin.py. All spec tests pass.
-
Accept 'shopt -s expand_aliases' as a noop.
Add more spec test cases for alias.
-
Clean up the interface to CommandParser.
- Reorder methods. - Rename ParseOne -> ParseLogicalLine. - Make some methods private (more could be done.) - ParseLogicalLine() and ParseCommandSub() are really the only public methods. The main_loop.ParseWholeFile() is a wrapper around this public interface. -
Clean up the interface to the command parser.
- word_parse.py uses c_parser.ParseCommandSub() for $() and `` - source and eval use main_loop.Batch() to interleave parsing and execution (e.g. so they can have aliases defined.) - ParseTrap uses main_loop.ParseWholeFile() - oshc also uses main_loop.ParseWholeFile() All unit, spec, gold, and osh2oil tests pass.
-
-
Fix another file descriptor bug by removing 'import cgi'.
- Add util.Debug() which logs to a file specified by --debug-file. - Add configure-bug to the list of passing. All gold, spec, and unit tests pass! Finally.