<commit_before>package ducttape.syntax;

import scala.util.parsing.input.Positional

object AbstractSyntaxTree {
  
/** Parent class of all types representing elements in an abstract syntax tree. */
abstract class ASTType extends Positional {}

/** Ducttape hyperworkflow file. */
class WorkflowDefinition(val tasks: Seq[TaskDef]) extends ASTType {
	override def toString = tasks.mkString("\n\n")
}

/** Block of comments. */
class CommentBlock(val comments: Seq[String]) extends ASTType {
	override def toString = comments.toString//comments.mkString("\n");
}


/**
 * Abstract specification of a variable name and its right hand side.
 */
class AbstractSpec[+RValue] (val name: String, val rval: RValue) extends ASTType {
  override def toString = name + "=" + rval;
}

type Spec = AbstractSpec[RValue]

type LiteralSpec = AbstractSpec[Literal]


/** Right hand side type in a variable declaration. */
abstract class RValue extends ASTType;

/** Unbound is the right hand side type in an underspecified variable declaration.
 *  
 *  Conceptually, Unbound can be thought of as the None case if one were to define Option[+RValue].  
 */
case class Unbound extends RValue {
	override def toString = "";
}

/** Type of a literal string value right hand side in a variable declaration. */
case class Literal(value: String) extends RValue {
	override def toString = "'"+value+"'";
}

/** Type of a variable reference right hand side in a variable declaration. */
case class Variable(task: String, value: String) extends RValue {
	override def toString = "${" + task + "}/" + value;
}

/** Branch in a hyperworkflow, defined in the right hand side of a variable declaration. */
case class Branch(val name: String, val specs: Seq[Spec]) extends RValue {
	override def toString = name + " " + specs.toString
}

class TaskHeader(val name: String, val inputs: Seq[Spec], val outputs: Seq[Spec], val params: Seq[Spec]) extends ASTType {
	override def toString = name + " " + " " + inputs + " " + outputs + " " + params;
}

class TaskDef(val name: String,
              val comments: CommentBlock,
              val inputs: Seq[Spec],
              val outputs: Seq[Spec],
              val params: Seq[Spec],
              val commands: Seq[String]) {
  override def toString = 
      "Task name: " + name + 
    "\n comments: " + comments.toString + 
    "\n   inputs: " + inputs + 
    "\n  outputs: " + outputs + 
    "\n   params: " + params + 
    "\n commands: " + commands
}

}<commit_msg>Corrected error. TaskDef now extends ASTType. It should have before, but didn't.<commit_after>package ducttape.syntax;

import scala.util.parsing.input.Positional

object AbstractSyntaxTree {
  
/** Parent class of all types representing elements in an abstract syntax tree. */
abstract class ASTType extends Positional {}

/** Ducttape hyperworkflow file. */
class WorkflowDefinition(val tasks: Seq[TaskDef]) extends ASTType {
	override def toString = tasks.mkString("\n\n")
}

/** Block of comments. */
class CommentBlock(val comments: Seq[String]) extends ASTType {
	override def toString = comments.toString//comments.mkString("\n");
}


/**
 * Abstract specification of a variable name and its right hand side.
 */
class AbstractSpec[+RValue] (val name: String, val rval: RValue) extends ASTType {
  override def toString = name + "=" + rval;
}

type Spec = AbstractSpec[RValue]

type LiteralSpec = AbstractSpec[Literal]


/** Right hand side type in a variable declaration. */
abstract class RValue extends ASTType;

/** Unbound is the right hand side type in an underspecified variable declaration.
 *  
 *  Conceptually, Unbound can be thought of as the None case if one were to define Option[+RValue].  
 */
case class Unbound extends RValue {
	override def toString = "";
}

/** Type of a literal string value right hand side in a variable declaration. */
case class Literal(value: String) extends RValue {
	override def toString = "'"+value+"'";
}

/** Type of a variable reference right hand side in a variable declaration. */
case class Variable(task: String, value: String) extends RValue {
	override def toString = "${" + task + "}/" + value;
}

/** Branch in a hyperworkflow, defined in the right hand side of a variable declaration. */
case class Branch(val name: String, val specs: Seq[Spec]) extends RValue {
	override def toString = name + " " + specs.toString
}

class TaskHeader(val name: String, val inputs: Seq[Spec], val outputs: Seq[Spec], val params: Seq[Spec]) extends ASTType {
	override def toString = name + " " + " " + inputs + " " + outputs + " " + params;
}

class TaskDef(val name: String,
              val comments: CommentBlock,
              val inputs: Seq[Spec],
              val outputs: Seq[Spec],
              val params: Seq[Spec],
              val commands: Seq[String]) extends ASTType {
  override def toString = 
      "Task name: " + name + 
    "\n comments: " + comments.toString + 
    "\n   inputs: " + inputs + 
    "\n  outputs: " + outputs + 
    "\n   params: " + params + 
    "\n commands: " + commands
}

}
{'fraction_non_alphanumeric': 0.11251730274866521, 'fraction_numerical': 0.0, 'mean_word_length': 3.425196850393701, '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': '3776497', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1428, 'n_words': 551}