glslify / glsl-tokenizer

r/w stream of glsl tokens
MIT License
51 stars 6 forks source link

Parse glsl files with windows carriage returns #12

Closed wvl closed 8 years ago

wvl commented 8 years ago

Ran into an upstream failure in stackgl/headless-gl when parsing preprocessor lines with windows carriage returns (\r\n).

This adds a test case, and fixes it in two possible ways:

  1. replace all \r with \n before parsing, or
  2. on the preprocessor line, end at \r or \n.

The second fix is the smallest possible fix for the issue I was running into. But the first fix seems like a more general solution.

mattdesl commented 8 years ago

lgtm – @gre / @hughsk / @mikolalysenko should I merge?

mikolalysenko commented 8 years ago

:+1:

wvl commented 8 years ago

Any chance of getting this merged? I was hoping not to need a fork to deploy this. Thanks

mattdesl commented 8 years ago

Ah yeah, will do when I'm back at work. 👌

Sent from my iPhone

On May 26, 2016, at 9:07 AM, Wayne Larsen notifications@github.com wrote:

Any chance of getting this merged? I was hoping not to need a fork to deploy this. Thanks

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

mattdesl commented 8 years ago

Should be in 2.1.2, thanks again!