Child pages
  • TextGen

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Operation

Arguments

append

any number of:

  • {string value}
  • \n
  • $list{node.list} - list without separator
  • $list{node.list with ,} - with separator
  • $ref{node.reference}
  • ${node.child}

found error

error text

decrease depth

decrease indentation level from now onwards

increase depth

increase indentation level from now on

indent buffer

apply indentation to the current line

with indent { <code> } indented

code block increase indentation level for the <code>

Examples

  1. Here is an example of the text gen component for the ForeachStatement (jetbrain.mps.baseLanguage).
    Code Block
    text gen component for concept ForeachStatement {
      (node, context, buffer)->void {
        if (node.loopLabel != null) {
          append \n ${node.loopLabel.name} {:} ;
        } else if (node.label != null) {
          append \n ${node.label} {:} ;
        }
        append \n ;
        indent buffer ;
        append {for (} ${node.variable} { : } ${node.iterable} {) {} ;
        with indent {
          append ${node.body} ;
        }
        append \n {}} ;
      }
    }
    

...