zen0wu / topcoder-greed

greedy editor for topcoder arena
Apache License 2.0
229 stars 45 forks source link

Skipping '\' in C++ template #143

Closed numatrumpet closed 10 years ago

numatrumpet commented 10 years ago

Using own C++ template, character \ (backslash) is always ignored. For example,

#define DBG2(x,y) { cout << #x << " = " << x << "\t" << #y << " = " << y << endl; }

becomes

#define DBG2(x,y) { cout << #x << " = " << x << "t" << #y << " = " << y << endl; }

Although I'll tackle this problem if there is time, please solve or explain this issue if possible.

vexorian commented 10 years ago

\ in template file will translate into .

So just use:

define DBG2(x,y) { cout << #x << " = " << x << "\t" << #y << " = "

<< y << endl; }

On Fri, Apr 4, 2014 at 11:16 AM, numatrumpet notifications@github.comwrote:

Using own C++ template, character \ (backslash) is always ignored. For example,

define DBG2(x,y) { cout << #x << " = " << x << "\t" << #y << " = " << y << endl; }

becomes

define DBG2(x,y) { cout << #x << " = " << x << "t" << #y << " = " << y << endl; }

Although I'll tackle this problem if there is time, please solve or explain this issue if possible.

Reply to this email directly or view it on GitHubhttps://github.com/shivawu/topcoder-greed/issues/143 .

numatrumpet commented 10 years ago

Thats good. I'll close this issue.

wookayin commented 10 years ago

I think the template itself should be ignorant of escaping. Backslashes are to be rendered as-is. Maybe we could fix this.

vexorian commented 10 years ago

Would break already existing templates that use double backslashes with no added benefit. I think just include a hint about this in documentation.