Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

@ghost
Copy link

@ghost ghost commented Sep 10, 2015

Issue: #40

rails-grammar-test

@winstliu
Copy link
Contributor

Please add specs to this.

@ghost
Copy link
Author

ghost commented Sep 11, 2015

Sure thing! Can you point me to a example test-case?

@winstliu
Copy link
Contributor

@mkorfmann this might be helpful.

@ghost
Copy link
Author

ghost commented Sep 11, 2015

@50Wliu Thanks!

@ghost
Copy link
Author

ghost commented Sep 11, 2015

Added two tests, there are still some issues though:

1.) Escaped quoting chars end the SQL scope. I tried using negative look-behind, but no luck.
2.) String interpolation should work, this will be even more tricky I guess. The SQL grammar somehow needs to "know", that the '#' in '#{ }' is not a comment.

Does somebody have an idea on how to fix these issues?

Most kindest regards,
Manuel

@winstliu
Copy link
Contributor

winstliu commented Dec 2, 2015

Sorry for the delay in getting back to you on this.

I've seen 1) in numerous other places, but there doesn't seem to be an easy solution to that. Can you try adding a pattern before the source.sql include to catch escaped quotes and see if that works?

Same goes for 2). Not sure if that'll work, but better to start somewhere.

Also, this PR has conflicts now - can you please rebase on top of master? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants