Skip to content

Commit

Permalink
fixed warning and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mie6 committed Sep 18, 2023
1 parent 9ce1d82 commit 256755f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import parsley.Parsley, Parsley.notFollowedBy
import parsley.combinator.{many, manyUntil}
import parsley.lift.lift2

import org.typelevel.scalaccompat.annotation._

/** This module contains pre-made combinators that are very useful for a variety of purposes, specialised to `cats`.
*
* In particular, it contains functionality found normally in `parsley.combinator`, but returning the `cats` `NonEmptyList`
Expand Down Expand Up @@ -131,7 +129,7 @@ object combinator {
* @since 1.2.0
*/
def sepEndBy1[A](p: Parsley[A], sep: =>Parsley[_]): Parsley[NonEmptyList[A]] = parsley.combinator.sepEndBy1(p, sep).map { xxs =>
val (x::xs) = xxs: @nowarn
val (x::xs) = xxs: @unchecked
NonEmptyList(x, xs)
}

Expand Down
8 changes: 4 additions & 4 deletions parsley-cats/shared/src/main/scala/parsley/token/cats.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
package parsley.token

import parsley.Parsley
import parsley.cats.combinator.sepBy1

import _root_.cats.data.NonEmptyList
import parsley.cats.combinator._

object cats {
implicit class LexerNonEmpty(val lexer: Lexer) {
object cats {
object lexeme {
object separators {
import lexer.lexeme.symbol
/** This combinator parses '''one''' or more occurrences of `p`, separated by semi-colons.
*
* First parses a `p`. Then parses a semi-colon followed by `p` until there are no more semi-colons.
Expand All @@ -39,7 +39,7 @@ object cats {
* @return a parser that parses `p` delimited by semi-colons, returning the list of `p`'s results.
* @since 1.3.0
*/
def semiSep1[A](p: Parsley[A]): Parsley[NonEmptyList[A]] = sepBy1(p, symbol.semi)
def semiSep1[A](p: Parsley[A]): Parsley[NonEmptyList[A]] = sepBy1(p, lexer.lexeme.symbol.semi)
/** This combinator parses '''one''' or more occurrences of `p`, separated by commas.
*
* First parses a `p`. Then parses a comma followed by `p` until there are no more commas.
Expand All @@ -64,7 +64,7 @@ object cats {
* @return a parser that parses `p` delimited by commas, returning the list of `p`'s results.
* @since 1.3.0
*/
def commaSep1[A](p: Parsley[A]): Parsley[NonEmptyList[A]] = sepBy1(p, symbol.comma)
def commaSep1[A](p: Parsley[A]): Parsley[NonEmptyList[A]] = sepBy1(p, lexer.lexeme.symbol.comma)
}
}
}
Expand Down

0 comments on commit 256755f

Please sign in to comment.