ridiculousfish
27dd37ebb4
Fix to indent comments in blocks properly ( #1710 )
...
This makes two changes to parse trees:
1. Unmaterialized nodes no longer have an invalid source location
For example, with the code `while false;end` there are no tokens
associated with the while loop's job_list, and therefore it is
unmaterialized. Previously it would have had a SOURCE_OFFSET_INVALID.
But now it has a zero source length, but an offset equal to the end of
the while loop (i.e. the semicolon), and a zero length. Correspondingly,
the has_source function now checks the length instead of the offset.
2. Special (comment and error) nodes have always been "disconnected,"
meaning they are not the child of any other node. However, they now have
their parent offsets set to whatever the top of the node stack was when
the node was encountered. This gives us a sense of which node the
comment is "in", e.g. if we are constructing a job list then the
comment's parent will be the job list. This lets us determine the
comment's indent.
2014-09-29 11:30:21 -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
005edf71a8
Fix initially backgrounded jobs. Fixes #1373
2014-03-28 14:39:47 -07:00
ridiculousfish
62b3ed17ba
Teach parser_t how to parse an argument list that contains newlines, for
...
complete -a support. Fixes #1369
2014-03-27 11:17:05 -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
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
e5ef45e4c0
Rewrite parser_t::test_args and parser_t::eval_args to use new parser
2014-03-20 21:32:02 -07:00
ridiculousfish
8d6b0c8d76
Allow the caller to specify the goal node when parsing a string via the
...
new parser. This enables parsing either a job list or an argument list.
2014-03-04 02:54:08 -08:00
ridiculousfish
1fa9167f25
Allow the caller to specify the goal node when parsing a string via the
...
new parser. This enables parsing either a job list or an argument list.
2014-03-02 16:03:05 -08:00
ridiculousfish
858b6aa257
Correct some mistakes in the fish grammar comment
2014-02-27 20:34:42 -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
53814983ff
Update style and formatting to conform to fish style guide.
2014-01-15 01:40:40 -08:00
ridiculousfish
28c7094f5b
Fix for issue where 'function' would not define a function if the
...
arguments came before its name. Fixes #1240
2014-01-14 02:29:53 -08:00
ridiculousfish
dc8014562b
Fix for issue where unterminated quotes would attempt to be executed,
...
instead of continuing edit onto the next line.
2014-01-14 00:02:18 -08:00
ridiculousfish
212eeaa77c
Correctly report errors for 'and' and 'or' in pipelines with new parser
2014-01-13 13:19:58 -08:00
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
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
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
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
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
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
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
Konrad Borowski
e8ba3c2f4d
Fix compilation errors under Clang.
2013-10-14 09:12:45 +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
e763345f25
Reduce child_count in node structure to 8 bits
2013-10-09 03:45:58 -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
b133137a1f
Removed templates (yay)
2013-07-28 15:19:38 -07:00