Quoted constructor

Quoted(
  1. String str,
  2. String content,
  3. {bool escaped,
  4. int index,
  5. FileInfo currentFileInfo}
)

Implementation

Quoted(String str, String content,
    {bool escaped, int index, FileInfo currentFileInfo}) {
  this.index = index;
  this.currentFileInfo = currentFileInfo;

  this.escaped = escaped ?? true;
  value = content ?? '';
  quote = str.isNotEmpty ? str[0] : '';
  if (!(quote == '"' || quote == "'" || quote == '')) quote = ''; // also ~ ?

  variableRegex = RegExp(r'@\{([\w-]+)\}');
  propRegex = RegExp(r'\$\{([\w-]+)\}');
  allowRoot = escaped ?? false;

//3.10.3 20190823
// var Quoted = function (str, content, escaped, index, currentFileInfo) {
//     this.escaped = (escaped == null) ? true : escaped;
//     this.value = content || '';
//     this.quote = str.charAt(0);
//     this._index = index;
//     this._fileInfo = currentFileInfo;
//     this.variableRegex = /@\{([\w-]+)\}/g;
//     this.propRegex = /\$\{([\w-]+)\}/g;
//     this.allowRoot = escaped;
// };
}