BUG: ast fails on windows newlines

@adamrp, can you review?