hamzaremmal/amy

View on GitHub
compiler/src/main/scala/amyc/parsing/modifiers.scala

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
package amyc.parsing

import scala.collection.mutable.ListBuffer

/**
  * Should we add them in parsing or in core or
  * have 2 separate structures in both parsing and core ?
  */
object modifiers :

  enum Modifier:
    case infix
    case native

  // ==============================================================================================
  // =================================== Utility methods ==========================================
  // ==============================================================================================

  /* Generate a component (such as regex or parser) for all the modifiers */
  def map[A](f: Modifier => A): List[A] =
    Modifier.values.toList.map(f)