Commit Graph

51 Commits

Author SHA1 Message Date
ridiculousfish
95f87cdd56 Support for special && and || error messages in new parser 2014-01-13 02:24:11 -08:00
ridiculousfish
096f850433 Eliminate class parse_t 2014-01-12 22:39:12 -08:00
ridiculousfish
ec469782c8 Improvements to error messages with new parser. In particular, "naked
builtins" now print their help (e.g. just 'while')
2014-01-12 15:10:59 -08:00
ridiculousfish
89069fdaa4 Miscellaneous minor fixes based on cppcheck static analyzer 2014-01-12 13:33:35 -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
bf75731bbe Fix for wrong syntax highlighting in the face of tokenizer errors, e.g.
"echo 'hi"
2014-01-03 17:42:25 -08:00
ridiculousfish
c8eec109b2 Support in parse_dump_tree for "forests", which occur when there's a
parse error
2014-01-03 16:54:34 -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
4402f73bf7 Improve error reporting for tokens ending with newlines 2013-12-31 16:37:15 -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
a6ca809a4e Fix for issue where last job_list in tree would have a -1 production_idx
because we never actually sent the terminal token type
2013-12-26 14:52:15 -08:00
ridiculousfish
b6af3e51ab Very early work in adopting new parser for actual execution of commands.
Not turned on yet.
2013-12-23 14:53:56 -08:00
ridiculousfish
3e9153d955 Clean up some error messages. Don't show the line in the error message
if it's the first line and we're interactive, since then it's obvious
2013-12-16 16:52:23 -08:00
ridiculousfish
5cf59de676 Finish rewriting detect_errors to use new parser. All tests now pass (!) 2013-12-12 18:18:07 -08:00
ridiculousfish
d5d9b9284a Initial work towards rewriting detect_errors to use new parser.
Low-level tests currently pass; high level tests fail.
2013-12-11 18:34:28 -08:00
ridiculousfish
383b6aabf5 Improve error reporting in new parser. Tests now pass. 2013-12-08 22:29:02 -08:00
ridiculousfish
7a3f5afee7 Initial work towars improved error reporting. Tests currently fail. 2013-12-08 21:54:06 -08:00
ridiculousfish
dd0cc5ed9f Rewriting indenting functionality to use new parser 2013-12-08 13:41:12 -08:00
ridiculousfish
2a1fd421bd Correctly detect unbalanced 'end' in syntax highlighting 2013-11-25 00:48:01 -08:00
ridiculousfish
b06e798373 Revert "Remove undefined behavior from parse_error()."
Per my understanding this is not undefined behavior. No ABI depends on the called function reading
variadic arguments, nor does any standard require it. So if this is crashing something else must be going
on.

This reverts commit 22d22f6aa8.
2013-10-16 01:25:47 -07:00
Konrad Borowski
22d22f6aa8 Remove undefined behavior from parse_error().
Having function that takes arbitrary number of arguments without
actually reading them is undefined behavior, as it could cause stack
to be in the corrupted state. Now arguments after token are parsed,
even if they aren't needed.

See also: http://asciinema.org/a/5904
2013-10-14 11:45:29 +02:00
ridiculousfish
ce857b0770 Syntax highlighting for file redirections 2013-10-13 16:58:40 -07:00
ridiculousfish
ddf98661e4 Adopt new parser in tab completions 2013-10-12 18:17:03 -07:00
ridiculousfish
ddec870d25 Rework decision process for whether to interpret keywords as structural
or as commands (for LL parser). Will allow 'builtin --' to parse as a
plain statement, instead of a decorated statement '--'
2013-10-12 02:46:49 -07:00
ridiculousfish
77e358a001 Support for parsing e.g. 'command --' as a plain statement, instead of
executing the command '--'.
2013-10-12 01:47:31 -07:00
ridiculousfish
5490f54d00 Make parse_t::parse a static method so we don't have to create lots of
useless parse_t objects
2013-10-12 01:17:55 -07:00
ridiculousfish
58447c147f Make the new parser LL(2). Support for correct handling of e.g. 'command
--help'
2013-10-09 20:37:07 -07:00
ridiculousfish
7b86b2e05a Adoption of new parser in abbreviations 2013-10-09 02:03:50 -07:00
ridiculousfish
c6eef16664 Autosuggestion adoption of new parser 2013-10-08 15:05:30 -07:00
ridiculousfish
4f718e83b3 Syntax highlighting now correctly handles cd 2013-10-07 03:56:09 -07:00
ridiculousfish
20ccda69f4 Command highlighting works 2013-10-07 01:04:37 -07:00
ridiculousfish
14741518a7 Command highlighting now works 2013-10-06 16:23:45 -07:00
ridiculousfish
e58b73179f More work on new parser 2013-08-11 00:35:00 -07:00
ridiculousfish
8e07e55c1f More work on new parser 2013-08-08 15:06:46 -07:00
ridiculousfish
680ac41bb1 Clean up some error handling 2013-07-28 15:44:09 -07:00
ridiculousfish
b133137a1f Removed templates (yay) 2013-07-28 15:19:38 -07:00
ridiculousfish
4f8d4f378c AST no templates 2013-07-25 15:24:22 -07:00
ridiculousfish
3e3eefc2dc Improvements to new parser. All functions and completions now parse. 2013-07-22 18:26:15 -07:00
ridiculousfish
77b6b0a9b2 Move production logic into templates 2013-07-21 15:22:11 -07:00
ridiculousfish
93f27666db More work 2013-07-10 23:45:09 -07:00
ridiculousfish
66d5436789 Fix for extra token_end 2013-07-04 14:05:42 -07:00
ridiculousfish
70b83a3bbb Implement support for switch 2013-06-30 15:38:31 -07:00
ridiculousfish
eba5b0e4c5 If statements parse 2013-06-27 15:12:27 -07:00
ridiculousfish
66af0c1a53 More work on the AST. block statements worked out a bit more. 2013-06-24 12:33:40 -07:00
ridiculousfish
d840643cb3 More work on new parser 2013-06-23 02:09:46 -07:00
ridiculousfish
b771e97ac6 More work on simulating execution of parse trees. Pipes are totally screwed up. 2013-06-18 23:35:04 -07:00
ridiculousfish
4ca46b7883 Beginning support for new parser error messages 2013-06-15 15:21:35 -07:00
ridiculousfish
827a9d640c Added parse builtin for testing. Lots of work on simulated execution. 2013-06-15 14:32:38 -07:00
ridiculousfish
e2a506e54a More work on new parser 2013-06-11 09:37:51 -07:00