and also for ModifierDeclarations
code = contract Foo {\n\tmodifier bar () returns (string) {\n\t\treturn "Hello";\n\t}\n\n\n\tfunction baz () {}\n}
a = sp.parse (code).body [0]
code.slice (0,a.body [0].end)
returns
contract Foo {\n\tmodifier bar () returns (string) {\n\t\treturn "Hello";\n\t}\n\n\n\t
should've stopped at "}" but also included the whitespace