Write a program or function that takes in a string through STDIN or function parameters, tokenizes it by parenthesis, and outputs the tokens on different lines. If the string contains a parentheses error, the program/function must output a falsey value or error message.
Examples:
Input: abc(def)ghi
Output:
abc ghi def
Input: abc(def(ghi))jklm(n)op((q))rs
Output:
abc jklm op rs def n ghi q
Input: blah(blah)(blah
Output:
Error
Notes:
- The falsey value or error message must be generated by program, and the program must terminate successfully. A built in error message due to a crash does not count.
- This is code golf. I will accept the shortest answer in bytes one month from today (July 30th).
- No standard loopholes.