Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def logical_lines:
  2. foreach inputs as $line (
  3. {buf: [], out: null};
  4. if (.buf | length) == 0 or ($line | test("^\\s+\\S")) then
  5. # continuation line
  6. { buf: (.buf + [$line]), out: null }
  7. else
  8. # output line
  9. { buf: [$line], out: (.buf | join("")) }
  10. end;
  11. if .out != null then .out else empty end);
  12.  
  13. logical_lines
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement