Commit Graph

50 Commits

Author SHA1 Message Date
ridiculousfish
98297e5234 Teach while loops to not hang forever with no-execute
Fixes #1543
2014-07-11 11:28:10 -07:00
ridiculousfish
195cd130f8 Fix sense of test in parse_execution to issue a barrier if an external
command has run
2014-07-06 18:12:18 -07:00
ridiculousfish
32f5edc9c5 Do not continue execution if argument expansion fails. Fixes #1488 2014-05-31 12:41:27 -07:00
ridiculousfish
97c2ec8dcf Fix a duplicated variable, and defeat some warnings in fish_tests 2014-04-27 18:44:21 -07:00
ridiculousfish
b01d09d704 Set the job property of block_t before expanding arguments associated
with the job, fixing psub. Fixes #1394
2014-04-02 00:32:08 -07:00
ridiculousfish
0d3169ef70 Run restyle.sh to enforce style rules. 2014-03-31 10:01:39 -07:00
ridiculousfish
7248b2213d Fix switch statement syntax highlighting so that the arguemnt to switch
is colored as a parameter, not a command. Promote this from a tok_string
to a symbol_argument in the grammar too.
2014-03-28 17:09:08 -07:00
ridiculousfish
74b28f0a86 Fix for crash with malformed switch statement. Fixes #1376 2014-03-28 16:56:44 -07:00
ridiculousfish
005edf71a8 Fix initially backgrounded jobs. Fixes #1373 2014-03-28 14:39:47 -07:00
ridiculousfish
f2a437bd3b Merge branch 'master' into parser_cleanup
Conflicts:
	parse_constants.h
	parse_tree.h
2014-03-26 13:59:14 -07:00
ridiculousfish
9fece3fdf1 Space and time optimizations for parse_node_t. Reduced size from 48
bytes to 20 bytes.
2014-03-25 20:06:34 -07:00
ridiculousfish
b520a03c57 Prefer swap() member function to std::swap. We were hitting the
inefficient generic std::swap for some derived types.
2014-03-25 12:44:21 -07:00
ridiculousfish
ad6367018b Excise use of parser_t's error() functionality. Thread a
parse_error_list_t through all of the expand functions, enabling them to
report errors more directly. Improve aspects of error reporting for
expansion failures.
2014-03-21 17:13:33 -07:00
ridiculousfish
1305c02579 Rewrite parser_t::current_line() to respect new parser 2014-03-20 21:32:02 -07:00
ridiculousfish
3cfdc6d126 Fix line number reporting in new parser 2014-03-20 21:32:02 -07:00
ridiculousfish
cc12225142 Clean up various block types and state as part of new parser 2014-03-02 13:46:30 -08:00
ridiculousfish
d232a0f951 Implement status -n (line number) with new parser 2014-03-01 16:04:13 -08:00
ridiculousfish
be33d3f2a4 Revert "Merge pull request #1317 from pullreq/cpp"
This reverts commit 74135c0600, reversing
changes made to 6d749789ce.

See discussion in #1317
2014-02-28 02:16:48 -08:00
Geoff Nixon
18dd6f58e3 Fixes .c -> .cpp in comments. For doxygen. 2014-02-27 06:23:40 -08:00
Geoff Nixon
ddcd2b0810 Dead stores 2014-02-27 06:23:40 -08:00
ridiculousfish
bc43409624 Expand the variable name as an ordinary parameter in for loops. Added
test for it too.
2014-02-21 18:20:51 -08:00
ridiculousfish
2e1024d275 Tweak error reporting in new parser to use fewer lines 2014-02-17 14:52:08 -08:00
ridiculousfish
1fbf633817 Reimplement exec parsing. Instead of special-casing exec as a command,
promote it to a decoration (like 'command' or 'builtin'). This makes tab
completion and syntax highlighting treat exec's first argument as a
command and is otherwise a nice simplification. Fixes #1300
2014-02-13 10:10:49 -08:00
ridiculousfish
29ddb68da4 Tests and fix to allow return to work correctly within if statements. Closes #1297. 2014-02-12 01:39:06 -08:00
ridiculousfish
414530c9c2 Partially rework profiling. Fix profiling crash with new parser. Fixes
1295
2014-02-09 14:04:43 -08:00
ridiculousfish
e632d39b1f Make if statements always return success at the end, matching other
shells. Fixes #1061.
2014-02-07 17:57:53 -08:00
ridiculousfish
bac3b39227 Highlight the entire variable name, not just the dollar sign. Fixes #1201 2014-02-03 14:16:00 -08:00
ridiculousfish
53814983ff Update style and formatting to conform to fish style guide. 2014-01-15 01:40:40 -08:00
ridiculousfish
6fc1d7dc77 Further cleanup and improvements to error messages 2014-01-13 03:57:59 -08:00
ridiculousfish
d9056081e7 Added tests for piping an fd other than stdout 2014-01-13 02:49:41 -08:00
ridiculousfish
25b25e3e49 Include missing algorithm header in parse_execution.cpp 2014-01-12 23:52:33 -08:00
ridiculousfish
0e9d159bc2 Improvements to error reporting. In particular, we now append a newline
in reader_shell_test, so that there's always a statement terminator.
Otherwise commands like 'echo |' would not be considered an error (just
incomplete).
2014-01-08 18:20:55 -08:00
ridiculousfish
b34721b3f4 Miscellaneous optimizations to reduce string copying 2014-01-07 14:57:58 -08:00
ridiculousfish
cb6be2a50d Support for "simple block" optimization, where we can run blocks
directly if there are no arguments or redirections to the block itself
2014-01-07 10:45:36 -08:00
ridiculousfish
45852f0497 Add a convenience method next_node_in_node_list which can be used for
iterating over lists in a parse tree
2014-01-05 15:23:42 -08:00
ridiculousfish
993148552e Support for Ctrl-C cancellation in new parser. Added tests for it too. 2014-01-02 16:19:33 -08:00
ridiculousfish
fb882f0b69 Support for stack overflow and infinite recursion detection in new
parser
2014-01-01 15:29:56 -08:00
ridiculousfish
27cba56761 Further improvements to error reporting with new parser 2014-01-01 00:04:02 -08:00
ridiculousfish
7356a0f6c8 Clean up and rationalize error handling in parse_execution.cpp 2013-12-31 14:37:37 -08:00
ridiculousfish
a9787b769f Support for implicit cd, no-exec, and the exit builtin. All tests now
pass (!). Error reporting still unsteady.
2013-12-29 16:23:26 -08:00
ridiculousfish
a42711e31c Support for break/continue with new parser execution 2013-12-28 22:52:06 -08:00
ridiculousfish
c632307eaa Make eval_node_at_offset return an error indication instead of the exit
status of the last command
2013-12-28 16:33:26 -08:00
ridiculousfish
0f9de11a67 Fix issues related to redirections and block level IO with new parser 2013-12-28 16:18:38 -08:00
ridiculousfish
715823a666 Bringup of function definitions, switch statements with new parser 2013-12-27 03:58:42 -08:00
ridiculousfish
6ce4b344e4 Hook up for statements, if statements, and function definition in new
parser
2013-12-27 01:38:43 -08:00
ridiculousfish
c1a13ae8bc Fix a few errors identified by testing new parser 2013-12-26 13:36:43 -08:00
ridiculousfish
6536ffe178 Facilities for turning on new AST-based parser. 2013-12-26 13:24:10 -08:00
ridiculousfish
562946d055 Cleanup thrashing around in parser_t. New parser execution lives in
parse_execution.cpp
2013-12-26 12:55:10 -08:00
ridiculousfish
924b8cbe24 New ideas about how to use new parser for execution. Beginnings of
implementation.
2013-12-26 12:24:00 -08:00
ridiculousfish
5b1a532652 Factor execution aspects from parser_t to parse_execution_context_t .
Still searching for best way to use new parser for execution.
2013-12-24 13:17:24 -08:00