private LiquidNode parseLoop(String cnt) throws FHIRException { int i = 0; while (!Character.isWhitespace(cnt.charAt(i))) i++; LiquidLoop res = new LiquidLoop(); res.varName = cnt.substring(0, i); while (Character.isWhitespace(cnt.charAt(i))) i++; int j = i; while (!Character.isWhitespace(cnt.charAt(i))) i++; if (!"in".equals(cnt.substring(j, i))) throw new FHIRException("Script "+name+": Script "+name+": Error reading loop: "+cnt); res.condition = cnt.substring(i).trim(); parseList(res.body, new String[] { "endloop"} ); return res; }
private LiquidNode parseIf(String cnt) throws FHIRException { LiquidIf res = new LiquidIf(); res.condition = cnt.substring(3).trim(); String term = parseList(res.thenBody, new String[] { "else", "endif"} ); if ("else".equals(term)) term = parseList(res.elseBody, new String[] { "endif"} ); return res; }
private LiquidNode parseLoop(String cnt) throws FHIRException { int i = 0; while (!Character.isWhitespace(cnt.charAt(i))) i++; LiquidLoop res = new LiquidLoop(); res.varName = cnt.substring(0, i); while (Character.isWhitespace(cnt.charAt(i))) i++; int j = i; while (!Character.isWhitespace(cnt.charAt(i))) i++; if (!"in".equals(cnt.substring(j, i))) throw new FHIRException("Script "+name+": Script "+name+": Error reading loop: "+cnt); res.condition = cnt.substring(i).trim(); parseList(res.body, new String[] { "endloop"} ); return res; }
private LiquidNode parseIf(String cnt) throws FHIRException { LiquidIf res = new LiquidIf(); res.condition = cnt.substring(3).trim(); String term = parseList(res.thenBody, new String[] { "else", "endif"} ); if ("else".equals(term)) term = parseList(res.elseBody, new String[] { "endif"} ); return res; }
public LiquidDocument parse(String name) throws FHIRException { this.name = name; LiquidDocument doc = new LiquidDocument(); parseList(doc.body, new String[0]); return doc; }
public LiquidDocument parse(String name) throws FHIRException { this.name = name; LiquidDocument doc = new LiquidDocument(); parseList(doc.body, new String[0]); return doc; }