Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoyToIncrementalDomSrcCompiler issue on Windows #111

Closed
mairatma opened this Issue Sep 23, 2016 · 11 comments

Comments

Projects
None yet
6 participants
@mairatma
Copy link

mairatma commented Sep 23, 2016

The most recent version of the compiler available in maven is currently throwing errors when building soy files that were edited in Windows.

For example, take this simple soy file created on a Windows machine:

{namespace Modal}

/**
 *
 */
{template .render}
  <div>Hello World</div>
{/template}

It triggers the following error:

errors during Soy compilation
In file src/Modal.soy:1:18: parse error at '
': expected eof, {alias, {deltemplate, or {template
{namespace Modal}

@jbalsas jbalsas referenced this issue Sep 23, 2016

Closed

LPS-67772 #43396

@sparhami

This comment has been minimized.

Copy link
Contributor

sparhami commented Sep 23, 2016

The error message seems to come from the parsing pass before the Incremental DOM code generation. Could you confirm whether or not this happens when trying to compile the same file to Java or JavaScript?

@mairatma

This comment has been minimized.

Copy link
Author

mairatma commented Sep 23, 2016

Yes, same thing happens when using SoyToJsSrcCompiler instead.

@mairatma

This comment has been minimized.

Copy link
Author

mairatma commented Oct 14, 2016

@sparhami do you have an idea of when a fix for Windows could be released (either on maven or npm)? We have some developers on Windows which are being blocked by this :(

@sparhami

This comment has been minimized.

Copy link
Contributor

sparhami commented Oct 17, 2016

Could you upload an example file that exhibits the problem somewhere?

@mairatma

This comment has been minimized.

Copy link
Author

mairatma commented Oct 17, 2016

Sure, here it is: Modal.soy.zip

@sparhami

This comment has been minimized.

Copy link
Contributor

sparhami commented Oct 17, 2016

Looks like adding the windows newline to the list of skipped characters here works for that error. That is, add | "\r\n" to

But this brings up another error:

Modal.soy:3:1: error: parse error at '/**
': expected eof, {alias, {deltemplate, or {template
/**
^

Looking at a hexdump of the file, it looks like the /** is actually "2f0a 2a2a" or / followed by a line feed, followed by **. I think this confuses the part of the parser that would be looking for a comment start. The parser doesn't completely strip whitespace, it just ignores it as it goes. So what looks like the start of a comment there does not actually match what it would consider the start of a comment.

I'm not sure what to do about this one.

@mairatma

This comment has been minimized.

Copy link
Author

mairatma commented Oct 17, 2016

Just so you know, it seems like this used to work with the compiler available in npm. At least windows users were using it without any problems back then.

@damishaziz

This comment has been minimized.

Copy link

damishaziz commented Oct 18, 2016

i am facing the same issue on Windows. You have to just modify your soy file like this...

{namespace Modal}/****/{template .render}

Hello World
{/template}

i mean remove the Enter key.

@lukesandberg

This comment has been minimized.

Copy link
Contributor

lukesandberg commented Oct 26, 2016

Looks like this breakage was introduced by e1a9d36 due to what appears to have been an accidental change in our grammar.

A fix should be available soon.

@tipsy

This comment has been minimized.

Copy link

tipsy commented Jan 3, 2017

@lukesandberg any update on this?

@prasannasv

This comment has been minimized.

Copy link

prasannasv commented Jan 18, 2017

@lukesandberg any ETA on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.