<commit_before>/*
 * Base class for all Fluent AST nodes.
 *
 * All productions described in the ASDL subclass BaseNode, including Span and
 * Annotation.
 *
 */
class BaseNode {
  constructor() {}
}

/*
 * Base class for AST nodes which can have Spans.
 */
class SyntaxNode extends BaseNode {
  addSpan(start, end) {
    this.span = new Span(start, end);
  }
}

export class Resource extends SyntaxNode {
  constructor(body = []) {
    super();
    this.type = "Resource";
    this.body = body;
  }
}

export class Entry extends SyntaxNode {
  constructor() {
    super();
    this.type = "Entry";
    this.annotations = [];
  }

  addAnnotation(annot) {
    this.annotations.push(annot);
  }
}

export class Message extends Entry {
  constructor(id, value = null, attributes = [], comment = null) {
    super();
    this.type = "Message";
    this.id = id;
    this.value = value;
    this.attributes = attributes;
    this.comment = comment;
  }
}

export class Term extends Entry {
  constructor(id, value, attributes = [], comment = null) {
    super();
    this.type = "Term";
    this.id = id;
    this.value = value;
    this.attributes = attributes;
    this.comment = comment;
  }
}

export class Pattern extends SyntaxNode {
  constructor(elements) {
    super();
    this.type = "Pattern";
    this.elements = elements;
  }
}

export class TextElement extends SyntaxNode {
  constructor(value) {
    super();
    this.type = "TextElement";
    this.value = value;
  }
}

export class Placeable extends SyntaxNode {
  constructor(expression) {
    super();
    this.type = "Placeable";
    this.expression = expression;
  }
}

export class Expression extends SyntaxNode {
  constructor() {
    super();
    this.type = "Expression";
  }
}

export class StringLiteral extends Expression {
  constructor(value) {
    super();
    this.type = "StringLiteral";
    this.value = value;
  }
}

export class NumberLiteral extends Expression {
  constructor(value) {
    super();
    this.type = "NumberLiteral";
    this.value = value;
  }
}

export class MessageReference extends Expression {
  constructor(id) {
    super();
    this.type = "MessageReference";
    this.id = id;
  }
}

export class VariableReference extends Expression {
  constructor(id) {
    super();
    this.type = "VariableReference";
    this.id = id;
  }
}

export class SelectExpression extends Expression {
  constructor(expression, variants) {
    super();
    this.type = "SelectExpression";
    this.expression = expression;
    this.variants = variants;
  }
}

export class AttributeExpression extends Expression {
  constructor(ref, name) {
    super();
    this.type = "AttributeExpression";
    this.ref = ref;
    this.name = name;
  }
}

export class VariantExpression extends Expression {
  constructor(ref, key) {
    super();
    this.type = "VariantExpression";
    this.ref = ref;
    this.key = key;
  }
}

export class CallExpression extends Expression {
  constructor(callee, positional = [], named = []) {
    super();
    this.type = "CallExpression";
    this.callee = callee;
    this.positional = positional;
    this.named = named;
  }
}<commit_msg>Remove the abstract Expression AST node<commit_after>/*
 * Base class for all Fluent AST nodes.
 *
 * All productions described in the ASDL subclass BaseNode, including Span and
 * Annotation.
 *
 */
class BaseNode {
  constructor() {}
}

/*
 * Base class for AST nodes which can have Spans.
 */
class SyntaxNode extends BaseNode {
  addSpan(start, end) {
    this.span = new Span(start, end);
  }
}

export class Resource extends SyntaxNode {
  constructor(body = []) {
    super();
    this.type = "Resource";
    this.body = body;
  }
}

export class Entry extends SyntaxNode {
  constructor() {
    super();
    this.type = "Entry";
    this.annotations = [];
  }

  addAnnotation(annot) {
    this.annotations.push(annot);
  }
}

export class Message extends Entry {
  constructor(id, value = null, attributes = [], comment = null) {
    super();
    this.type = "Message";
    this.id = id;
    this.value = value;
    this.attributes = attributes;
    this.comment = comment;
  }
}

export class Term extends Entry {
  constructor(id, value, attributes = [], comment = null) {
    super();
    this.type = "Term";
    this.id = id;
    this.value = value;
    this.attributes = attributes;
    this.comment = comment;
  }
}

export class Pattern extends SyntaxNode {
  constructor(elements) {
    super();
    this.type = "Pattern";
    this.elements = elements;
  }
}

export class TextElement extends SyntaxNode {
  constructor(value) {
    super();
    this.type = "TextElement";
    this.value = value;
  }
}

export class Placeable extends SyntaxNode {
  constructor(expression) {
    super();
    this.type = "Placeable";
    this.expression = expression;
  }
}

export class StringLiteral extends SyntaxNode {
  constructor(value) {
    super();
    this.type = "StringLiteral";
    this.value = value;
  }
}

export class NumberLiteral extends SyntaxNode {
  constructor(value) {
    super();
    this.type = "NumberLiteral";
    this.value = value;
  }
}

export class MessageReference extends SyntaxNode {
  constructor(id) {
    super();
    this.type = "MessageReference";
    this.id = id;
  }
}

export class VariableReference extends SyntaxNode {
  constructor(id) {
    super();
    this.type = "VariableReference";
    this.id = id;
  }
}

export class SelectExpression extends SyntaxNode {
  constructor(expression, variants) {
    super();
    this.type = "SelectExpression";
    this.expression = expression;
    this.variants = variants;
  }
}

export class AttributeExpression extends SyntaxNode {
  constructor(ref, name) {
    super();
    this.type = "AttributeExpression";
    this.ref = ref;
    this.name = name;
  }
}

export class VariantExpression extends SyntaxNode {
  constructor(ref, key) {
    super();
    this.type = "VariantExpression";
    this.ref = ref;
    this.key = key;
  }
}

export class CallExpression extends SyntaxNode {
  constructor(callee, positional = [], named = []) {
    super();
    this.type = "CallExpression";
    this.callee = callee;
    this.positional = positional;
    this.named = named;
  }
}
{'fraction_non_alphanumeric': 0.12052064920456372, 'fraction_numerical': 0.0, 'mean_word_length': 3.0310880829015545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5252350', 'n_tokens_mistral': 1890, 'n_tokens_neox': 1869, 'n_words': 502}