ballercat / walt

:zap: Walt is a JavaScript-like syntax for WebAssembly text format :zap:
https://ballercat.github.io/walt/
MIT License
4.64k stars 122 forks source link

CRLF lines not supported #153

Closed lbyonder closed 5 years ago

lbyonder commented 5 years ago

Bug Report

Overview

Windows style line endings give a syntax error.

Expected

Documentation should explain what line endings are supported. Does webassembly itself support CRLF?

ballercat commented 5 years ago

Thank you for reporting this. Seems like a straightforward bug in the tokenizer. We don't match Window line endings only \n so it's invalid syntax. WebAssembly itself isn't opinionated about that type of thing because it's a binary format.

https://github.com/ballercat/walt/blob/7ca5eb833b4d827b326378a78843b1c13bcda687/packages/walt-syntax/src/tokens.js#L76-L102

Should be straightforward to fix with a better regex for newline.

ballercat commented 5 years ago

Fixed by #154

I'll publish a patched version to npm later today.