From fa6a9c8b5d8d127bbce810aa14d4468de437469f Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 14 Jan 2017 14:22:28 +0700 Subject: Break some overly long lines in the curly config parser. --- src/curly_parser.mly | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/curly_parser.mly b/src/curly_parser.mly index 54443b5..be5aadc 100644 --- a/src/curly_parser.mly +++ b/src/curly_parser.mly @@ -56,16 +56,20 @@ values: ; leaf_node: - | comment = opt_comment; inactive = boption(INACTIVE); ephemeral = boption(EPHEMERAL); name = IDENTIFIER; values = values; SEMI + | comment = opt_comment; inactive = boption(INACTIVE); ephemeral = boption(EPHEMERAL); + name = IDENTIFIER; values = values; SEMI { Vytree.make_full {values=(List.rev values); comment=comment; inactive=inactive; ephemeral=ephemeral} name []} - | comment = opt_comment; inactive = boption(INACTIVE); ephemeral = boption(EPHEMERAL); name = IDENTIFIER; SEMI (* valueless node *) + | comment = opt_comment; inactive = boption(INACTIVE); ephemeral = boption(EPHEMERAL); + name = IDENTIFIER; SEMI (* valueless node *) { Vytree.make_full {default_data with comment=comment; inactive=inactive; ephemeral=ephemeral} name [] } ; node: - | comment = opt_comment; inactive = boption(INACTIVE); ephemeral = boption(EPHEMERAL); name = IDENTIFIER; LEFT_BRACE; children = list(node_content); RIGHT_BRACE + | comment = opt_comment; inactive = boption(INACTIVE); ephemeral = boption(EPHEMERAL); + name = IDENTIFIER; LEFT_BRACE; children = list(node_content); RIGHT_BRACE { - let node = Vytree.make_full {default_data with comment=comment; inactive=inactive; ephemeral=ephemeral} name [] in + let node = + Vytree.make_full {default_data with comment=comment; inactive=inactive; ephemeral=ephemeral} name [] in let node = List.fold_left Vytree.adopt node (List.rev children) |> Vytree.merge_children merge_data in try List.iter find_duplicate_children (Vytree.children_of_node node); @@ -77,10 +81,12 @@ node: ; tag_node: - | comment = opt_comment; inactive = boption(INACTIVE); ephemeral = boption(EPHEMERAL); name = IDENTIFIER; tag = IDENTIFIER; LEFT_BRACE; children = list(node_content); RIGHT_BRACE + | comment = opt_comment; inactive = boption(INACTIVE); ephemeral = boption(EPHEMERAL); + name = IDENTIFIER; tag = IDENTIFIER; LEFT_BRACE; children = list(node_content); RIGHT_BRACE { let outer_node = Vytree.make_full default_data name [] in - let inner_node = Vytree.make_full {default_data with comment=comment; inactive=inactive; ephemeral=ephemeral} tag [] in + let inner_node = + Vytree.make_full {default_data with comment=comment; inactive=inactive; ephemeral=ephemeral} tag [] in let inner_node = List.fold_left Vytree.adopt inner_node (List.rev children) |> Vytree.merge_children merge_data in let node = Vytree.adopt outer_node inner_node in try -- cgit v1.2.3