-
Notifications
You must be signed in to change notification settings - Fork 641
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
Add elseif case ("alias" of elif) to parseIf #826
Conversation
Can you add a test for this? |
Sure, I'd be happy to do that. Any suggestions for what exactly to test? I was thinking I'd replicate an expect(function() {
parser.parse('hello {% if sdf %} data');
}).to.throwException(/expected elif, else, or endif/); |
Heh, looks like the existing testing of |
(by "works as expected" I just mean something simple like |
Tests look great, thanks! And sorry I forgot to mention this in the first round, but would you also be willing to add a changelog entry (in the 2.x section), following the pattern of the existing entries? Thanks! |
Sure thing. Also, not sure if you want docs updated or not, but I could change:
to:
|
Sure, please do update the docs as well. |
Ok, I think I have everything in there, and I hope I didn't make too much of a mess out of the merge I just did. I thanked myself in the changelog, which was weird, but it fit the pattern, so what the heck. |
Looks great, thank you! |
* Add elseif case ("alias" of elif) to parseIf * Add elif/elseif compiler tests * Update changelog and docs for elseif addition
@carljm @kswedberg (Hi Karl, long time to talk!) I'm currently using
I'm not sure that I want to bump any dependencies at the moment. |
Hey @naterkane ! Hope you're well. Are you sure you're using 2.5+? If you go into |
yes, I'm currently using
|
Huh. that's strange. So, |
Sure. Template files in github.com/naterkane/raml2html there's a single use
of `elif`
- sent from my potato
…On Jan 7, 2017 11:05 AM, "Karl Swedberg" ***@***.***> wrote:
Huh. that's strange. So, elif works, but elseif doesn't? if there's any
way I can take a look at your setup, I'd be happy to help investigate
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#826 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABVqjXDLXx3qvgkCVRgq9Udz2GbBVNlks5rP7fNgaJpZM4JxxmO>
.
|
ok, cool. I cloned the repo and Is there some other way I should be testing this? Tried running |
It uses a git submodule (at the moment) going to refactor to use a npm
module to provide the RAML examples tomorrow.
- sent from my potato
…On Jan 7, 2017 11:57 AM, "Karl Swedberg" ***@***.***> wrote:
ok, cool. I cloned the repo and npm installed. Changed elif to elseif in
lib/resource.nunjucks and then ran node script from inside examples
directory. No errors.
Is there some other way I should be testing this? Tried running npm run
examples, but that didn't work for other reasons (both elif and elseif)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#826 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABVqhhnRsmZu8re1PO_qWtlk3AgAu1bks5rP8QPgaJpZM4JxxmO>
.
|
ah, ok. I got the submodule in there and ran |
Very strange. I'll look more into it tonight. If you want to PR your
`elseif` change that would be great.
- sent from my potato
On Jan 7, 2017 12:56 PM, "Karl Swedberg" <[email protected]> wrote:
ah, ok. I got the submodule in there and ran npm run examples, still with
no errors. everything looks good. if there's somewhere in particular where
you're seeing things break, more information would be helpful. so far,
though, I can't seem to reproduce the problem.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#826 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABVqmB6rEXvrXCxEgEleGl1lc3N9zBoks5rP9HngaJpZM4JxxmO>
.
|
This commit adds an
elseif
case that falls through toelif
. Havingelseif
provides consistency between nunjucks and twig so the same templates can be used with either one.