All Downloads are FREE. Search and download functionalities are using the official Maven repository.

parsley.token.symbol.LexemeSymbol.scala Maven / Gradle / Ivy

There is a newer version: 5.0.0-M6
Show newest version
/*
 * Copyright 2020 Parsley Contributors 
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
package parsley.token.symbol

import parsley.Parsley
import parsley.token.Lexeme

private [token] class LexemeSymbol(symbol: Symbol, lexeme: Lexeme) extends Symbol {
    override def apply(name: String): Parsley[Unit] = lexeme(symbol.apply(name))
    override def apply(name: Char): Parsley[Unit] = lexeme(symbol.apply(name))
    override def softKeyword(name: String): Parsley[Unit] = lexeme(symbol.softKeyword(name))
    override def softOperator(name: String): Parsley[Unit] = lexeme(symbol.softOperator(name))

    override val implicits: ImplicitSymbol = new ImplicitSymbol {
        /** @inheritdoc */
        implicit def implicitSymbol(s: String): Parsley[Unit] = lexeme(symbol.apply(s).uo(s""""$s""""))
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy