aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-12-23 10:58:45 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-12-23 10:58:45 -0800
commit39fe9fcfcd146e726454458621700ca83700296f (patch)
tree958018be5500eb44f91ff0143bd83139963eb044 /builtin.cpp
parentbf80b0db1976cdeffc8481d335b1940fb8d522fc (diff)
Tweak comment handling. Mark a parse node with a new flag when it has comments
Diffstat (limited to 'builtin.cpp')
-rw-r--r--builtin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin.cpp b/builtin.cpp
index e2fd3231..630c0428 100644
--- a/builtin.cpp
+++ b/builtin.cpp
@@ -4022,7 +4022,7 @@ int builtin_parse(parser_t &parser, wchar_t **argv)
const wcstring src = str2wcstring(&txt.at(0), txt.size());
parse_node_tree_t parse_tree;
parse_error_list_t errors;
- bool success = parse_tree_from_string(src, parse_flag_none, &parse_tree, &errors);
+ bool success = parse_tree_from_string(src, parse_flag_include_comments, &parse_tree, &errors);
if (! success)
{
stdout_buffer.append(L"Parsing failed:\n");
@@ -4035,7 +4035,7 @@ int builtin_parse(parser_t &parser, wchar_t **argv)
stdout_buffer.append(L"(Reparsed with continue after error)\n");
parse_tree.clear();
errors.clear();
- parse_tree_from_string(src, parse_flag_continue_after_error, &parse_tree, &errors);
+ parse_tree_from_string(src, parse_flag_continue_after_error | parse_flag_include_comments, &parse_tree, &errors);
}
const wcstring dump = parse_dump_tree(parse_tree, src);
stdout_buffer.append(dump);