Examples of DefinitionArgumentListElements


Examples of com.puppetlabs.geppetto.pp.dsl.services.PPGrammarAccess.DefinitionArgumentListElements

    // ;
    //
    // DefinitionArgument returns pp::DefinitionArgument
    // : argName = UNION_VARIABLE_OR_NAME ((op = '=' | op = '=>') value = AssignmentExpression)?
    // ;
    final DefinitionArgumentListElements access = grammarAccess.getDefinitionArgumentListAccess();
    while(itor.hasNext()) {
      IDomNode n = itor.next();
      EObject ge = n.getGrammarElement();
      if(ge == access.getLeftParenthesisKeyword_1()) {
        IDomNode nextLeaf = DomModelUtils.nextLeaf(n);
        if(DomModelUtils.isWhitespace(nextLeaf))
          if(breakAndAlign)
            nextLeaf.getStyles().add(StyleSet.withStyles(styles.oneLineBreak(), styles.indent()));
          else
            nextLeaf.getStyles().add(StyleSet.withStyles(styles.indent()));
      }
      else if(ge == access.getRightParenthesisKeyword_4()) {
        IDomNode prevLeaf = DomModelUtils.previousLeaf(n);
        if(DomModelUtils.isWhitespace(prevLeaf))
          prevLeaf.getStyles().add(StyleSet.withStyles(styles.dedent()));
      }
      else if(breakAndAlign) {
        if(ge == access.getCommaKeyword_2_1_0()) {
          IDomNode nextLeaf = DomModelUtils.nextLeaf(n);
          if(DomModelUtils.isWhitespace(nextLeaf))
            nextLeaf.getStyles().add(StyleSet.withStyles(styles.oneLineBreak()));
        }
        // Break on endcomma does not look good - here is how it would be done though...
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.