if then else expressions #100

Merged
merged 1 commit into from Apr 3, 2017

Conversation

Projects
None yet
5 participants
Contributor

cjllanwarne commented Mar 26, 2017 edited

Allows expressions of the form:

Boolean b = ...

Int memory = if b then "2GB" else "5GB"
String docker = if b then "ubuntu:latest" else "my:docker"
grammar.hgr
@@ -49,6 +51,8 @@ grammar {
javascript: "'([^\\\\\\'\\n]|\\\\[\\\"\\'nrbtfav\\\\?]|\\\\[0-7]{1,3}|\\\\x[0-9a-fA-F]+|\\\\[uU]([0-9a-fA-F]{4})([0-9a-fA-F]{4})?)*'"
} -> wdl_unescape(:string)
+ r'else' -> :else
+ r'then' -> :then
@cjllanwarne

cjllanwarne Mar 26, 2017

Contributor

Actually suspect this wouldn't be necessary... but if it is, then it's probably also required in the output expression section too

Member

geoffjentry commented Mar 26, 2017 edited

don't forget to update the spec, at least once the syntax is squared away

Collaborator

katevoss commented Mar 26, 2017

Collaborator

katevoss commented Apr 3, 2017

@knoblett and @vdauwera there are updates to the Spec, looks good to me but it would be great to get your review too.

Contributor

Horneth commented Apr 3, 2017 edited by briandmaher

👍

Approved with PullApprove

Collaborator

vdauwera commented Apr 3, 2017

👍

@cjllanwarne cjllanwarne merged commit 3cdd802 into develop Apr 3, 2017

1 check was pending

code-review/pullapprove Approval required by 1 of: geoffjentry, jsotobroad, katevoss, kcibul, kshakir, mcovarr, ruchim
Details

cjllanwarne deleted the cjl_if_else_expressions branch Apr 3, 2017

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