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

brace in c# string #86

Closed
fsz1987 opened this issue Aug 8, 2016 · 2 comments
Closed

brace in c# string #86

fsz1987 opened this issue Aug 8, 2016 · 2 comments

Comments

@fsz1987
Copy link

fsz1987 commented Aug 8, 2016

sorry about my poor English 😅

I was using pegasus to build my text template engine.

I use a double brace to escape one of them, as following:

br = '{{' { "{" }

but an error appeared:

PEG0011 Unterminated code section

it seems the braces inside the code section must be paired. but I think a single brace inside a c# string expression should be legal

for now , I have to write like this to bypass this problem:

br = '{{' { "\x007b" }

but it is really hard to read. so is this a bug ?

@otac0n
Copy link
Owner

otac0n commented Aug 8, 2016

Hi, thanks for chiming in.

This is not exactly a bug, but it has been a known issue in Pegasus since the very beginning. (Duplicate of #44)

You'll be happy to hear that I've recently integrated Roslyn into the Pegasus parser, allowing any valid C# to be used in a code section. You can try out the latest release on NuGet, which should work as you expect: https://www.nuget.org/packages/Pegasus/4.0.0-alpha0035

@otac0n otac0n closed this as completed Aug 8, 2016
@fsz1987
Copy link
Author

fsz1987 commented Aug 10, 2016

thanks, I'll try that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants