This class provides some utility methods to work with strings in macro context.

Static methods

staticformatString(s:String, pos:Position):Expr

Available on macro

Formats String s using the usual interpolation rules.

The returned expression is a concatenation of string parts and escaped elements.


Available on macro

Tells if e is a format string, i.e. uses single quotes ' as delimiters.

statictoDotPath(pack:Array<String>, name:String):String

Converts a path given by package pack and name name to a String separated by dots.

If pack has no elements, the result is name.

If pack is null, the result is unspecified.

Otherwise the elements of pack are joined with a separating dot, with an appended dot separating the result from name.

statictoFieldExpr(sl:Array<String>, ?pos:Position):Expr

Converts an array of Strings sl to a field expression.

If sl has no elements, the result is null.

If sl has one element, the result is EConst(CIdent(sl[0]).

Otherwise the result is a chain of EField nodes.

If sl is null, the result is unspecified.