Skip to content

Commit

Permalink
Version bump to 4.2 (#145)
Browse files Browse the repository at this point in the history
* Version bump to 4.2

* Fixed badges

* Improved `position` API (#146)

* Added positions object

* deprecated old position stuff

* Stopped coverage run unless it's actually needed (pr to master, or on master)

* Fixed CI test coverage skipping

* Apparently base_ref is a different style to ref...

* Changed deprecation for Lexer inheritance to now, backport/4.1 needs to undo its deprecation

* Deprecated old error combinators, added unexpectedLegacy (#147)

* disabled test coverage for deprecated fastfail and fastunexpected

* Replaced deprecated implementations by slow (but stable versions)

* Error pattern combinators (#148)

* Added the VerifiedErrors extension class in patterns object, added correct partial amending semantics

* satisfied MiMA

* Changed names of new combinators, no need to jump through so many hoops now!

* verify -> verified

* Added intrinsic, needs testing

* Added correct partial amend behaviour onto deprecated deoptimised combinators

* Fixed bug where string terminal escapes relabelling

* removed partial amend semantics on verifiedX, because it's evil: we won't be exposing it!

* Added comment about the future improved partial amend

* Fix name of instruction

* Doc stubs

* Add `dislodge` and `amendThenDislodge` combinators (#149)

* Exposed amendThenDislodge and dislodge

* Added tests

* documentation

* Introduce `unexpectedWhenWithReason` (#151)

* Added combinator and generalised machinery

* Removed defunct combinators from lexer

* documentation

* tests written

* Added comment about spanWith, I'm not going to include it for now

* Renamed combinator, it's a bit better with the When at the end

* Documented the 1 indexing

* Added position tests

* position module description

* Added positions to rootdoc

* patterns documentation

* sbt and README updated

* update workflow

* Fixed style issues

* Added tests for verifiedFail

* Full testing of new verified errors combinators
  • Loading branch information
j-mie6 authored Jan 22, 2023
1 parent 19bb048 commit f4f164c
Show file tree
Hide file tree
Showing 27 changed files with 534 additions and 276 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ jobs:

coverage:
name: Run Test Coverage and Upload
if: github.ref == 'refs/heads/master' || (github.event_name == 'pull_request' && github.base_ref == 'master')
strategy:
matrix:
os: [ubuntu-latest]
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Parsley is a fast and modern parser combinator library for Scala based loosely o
Parsley is distributed on Maven Central, and can be added to your project via:

```scala
libraryDependencies += "com.github.j-mie6" %% "parsley" % "4.1.1"
libraryDependencies += "com.github.j-mie6" %% "parsley" % "4.2.0"
```

Documentation can be found [**here**](https://javadoc.io/doc/com.github.j-mie6/parsley_2.13/latest/index.html)
Expand Down Expand Up @@ -151,13 +151,14 @@ make porting feasible.

_An exception to this policy is made for any version `3.x.y`, which reaches EoL effective immediately (December 2022) excluding exceptional circumstances._

| Version | Released On | EoL Status |
|:-------:|:-------------------|:----------------------------|
| `3.3.0` | January 7th 2022 | EoL reached |
| `4.0.0` | November 30th 2022 | EoL reached |
| `4.1.0` | January 18th 2023 | Enjoying indefinite support |
| Version | Released On | EoL Status |
|:-------:|:-------------------|:-------------------------------|
| `3.3.0` | January 7th 2022 | EoL reached |
| `4.0.0` | November 30th 2022 | EoL reached |
| `4.1.0` | January 18th 2023 | Supported until 22nd July 2023 |
| `4.2.0` | January 22th 2023 | Enjoying indefinite support |

## Bug Reports [![Percentage of issues still open](https://isitmaintained.com/badge/open/j-mie6/Parsley.svg)](https://isitmaintained.com/project/j-mie6/Parsley "Percentage of issues still open") [![Maintainability](https://img.shields.io/codeclimate/maintainability/j-mie6/parsley)](https://codeclimate.com/github/j-mie6/Parsley) [![Test Coverage](https://img.shields.io/codeclimate/coverage-letter/j-mie6/parsley)](https://codeclimate.com/github/j-mie6/Parsley)
## Bug Reports [![Percentage of issues still open](https://isitmaintained.com/badge/open/j-mie6/Parsley.svg)](https://isitmaintained.com/project/j-mie6/Parsley "Percentage of issues still open") [![Maintainability](https://img.shields.io/codeclimate/maintainability/j-mie6/parsley)](https://codeclimate.com/github/j-mie6/parsley) [![Test Coverage](https://img.shields.io/codeclimate/coverage-letter/j-mie6/parsley)](https://codeclimate.com/github/j-mie6/parsley)

If you encounter a bug when using Parsley, try and minimise the example of the parser (and the input) that triggers the bug.
If possible, make a self contained example: this will help to identify the issue without too much issue.
Expand Down
10 changes: 8 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ val Java8 = JavaSpec.temurin("8")
val JavaLTS = JavaSpec.temurin("11")
val JavaLatest = JavaSpec.temurin("17")

val mainBranch = "master"

Global / onChangedBuildSource := ReloadOnSourceChanges

val isInPublish = Option(System.getenv("GITHUB_JOB")).contains("publish")
val releaseFlags = Seq("-Xdisable-assertions", "-opt:l:method,inline", "-opt-inline-from", "parsley.**", "-opt-warnings:at-inline-failed")

inThisBuild(List(
tlBaseVersion := "4.1",
tlBaseVersion := "4.2",
organization := "com.github.j-mie6",
startYear := Some(2018),
homepage := Some(url("https://github.com/j-mie6/parsley")),
Expand All @@ -38,14 +40,17 @@ inThisBuild(List(
ProblemFilters.exclude[MissingClassProblem]("parsley.token.predicate$_CharSet$"),
ProblemFilters.exclude[MissingFieldProblem]("parsley.token.predicate._CharSet"),
ProblemFilters.exclude[MissingClassProblem]("parsley.token.errors.ErrorConfig$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("parsley.errors.combinator#ErrorMethods.unexpected"),
ProblemFilters.exclude[MissingClassProblem]("parsley.token.errors.FilterOps"),
ProblemFilters.exclude[MissingClassProblem]("parsley.token.errors.FilterOps$"),
),
tlVersionIntroduced := Map(
"2.13" -> "1.5.0",
"2.12" -> "1.5.0",
"3" -> "3.1.2",
),
// CI Configuration
tlCiReleaseBranches := Seq("master"),
tlCiReleaseBranches := Seq(mainBranch),
tlSonatypeUseLegacyHost := false,
githubWorkflowJavaVersions := Seq(Java8, JavaLTS, JavaLatest),
// We need this because our release uses different flags
Expand Down Expand Up @@ -91,6 +96,7 @@ def testCoverageJob(cacheSteps: List[WorkflowStep]) = WorkflowJob(
id = "coverage",
name = "Run Test Coverage and Upload",
scalas = List(Scala213),
cond = Some(s"github.ref == 'refs/heads/$mainBranch' || (github.event_name == 'pull_request' && github.base_ref == '$mainBranch')"),
steps =
WorkflowStep.Checkout ::
WorkflowStep.SetupJava(List(JavaLTS)) :::
Expand Down
1 change: 1 addition & 0 deletions parsley/js/rootdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ is defined as being an object which mocks a package):
context-sensitive functionality in the form of registers.
- [[parsley.token `parsley.token`]] contains the [[parsley.token.Lexer `Lexer`]] class that provides
a host of helpful lexing combinators when provided with the description of a language.
- [[parsley.position `parsley.position`]] contains parsers for extracting position information.
- [[parsley.genericbridges$ `parsley.genericbridges`]] contains some basic implementations of
the ''Parser Bridge'' pattern (see
[[https://dl.acm.org/doi/10.1145/3550198.3550427 Design Patterns for Parser Combinators in Scala]],
Expand Down
1 change: 1 addition & 0 deletions parsley/rootdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ is defined as being an object which mocks a package):
context-sensitive functionality in the form of registers.
- [[parsley.token `parsley.token`]] contains the [[parsley.token.Lexer `Lexer`]] class that provides
a host of helpful lexing combinators when provided with the description of a language.
- [[parsley.position `parsley.position`]] contains parsers for extracting position information.
- [[parsley.genericbridges$ `parsley.genericbridges`]] contains some basic implementations of
the ''Parser Bridge'' pattern (see
[[https://dl.acm.org/doi/10.1145/3550198.3550427 Design Patterns for Parser Combinators in Scala]],
Expand Down
65 changes: 9 additions & 56 deletions parsley/shared/src/main/scala/parsley/Parsley.scala
Original file line number Diff line number Diff line change
Expand Up @@ -944,13 +944,6 @@ final class Parsley[+A] private [parsley] (private [parsley] val internal: front
* useful; in particular, `pure` and `unit` can be put to good use in injecting results into a parser
* without needing to consume anything, or mapping another parser.
*
* @groupprio pos 10
* @groupname pos Position-Tracking Parsers
* @groupdesc pos
* These parsers provide a way to extract position information during a parse. This can be important
* for when the final result of the parser needs to encode position information for later consumption:
* this is particularly useful for abstract syntax trees.
*
* @groupprio monad 100
* @groupname monad Expensive Sequencing Combinators
* @groupdesc monad
Expand Down Expand Up @@ -1218,66 +1211,26 @@ object Parsley {
* @group basic
*/
val unit: Parsley[Unit] = pure(())
// $COVERAGE-OFF$
/** This parser returns the current line number of the input without having any other effect.
*
* When this combinator is ran, no input is required, nor consumed, and
* the current line number will always be successfully returned. It has no other
* effect on the state of the parser.
*
* @example {{{
* scala> import parsley.Parsley.line, parsley.character.char
* scala> line.parse("")
* val res0 = Success(1)
* scala> (char('a') *> line).parse("a")
* val res0 = Success(1)
* scala> (char('\n') *> line).parse("\n")
* val res0 = Success(2)
* }}}
*
* @return a parser that returns the line number the parser is currently at.
* @group pos
* @deprecated Moved to [[position.line `position.line`]], due for removal in 5.0.0
*/
@deprecated("Position parsing functionality was moved to `parsley.position`; use `position.line` instead as this will be removed in 5.0.0", "4.2.0")
def line: Parsley[Int] = position.line
/** This parser returns the current column number of the input without having any other effect.
*
* When this combinator is ran, no input is required, nor consumed, and
* the current column number will always be successfully returned. It has no other
* effect on the state of the parser.
*
* @example {{{
* scala> import parsley.Parsley.col, parsley.character.char
* scala> col.parse("")
* val res0 = Success(1)
* scala> (char('a') *> col).parse("a")
* val res0 = Success(2)
* scala> (char('\n') *> col).parse("\n")
* val res0 = Success(1)
* }}}
*
* @return a parser that returns the column number the parser is currently at.
* @note in the presence of wide unicode characters, the value returned may be inaccurate.
* @group pos
* @note in the presence of wide unicode characters, the column value returned may be inaccurate.
* @deprecated Moved to [[position.col `position.col`]], due for removal in 5.0.0
*/
@deprecated("Position parsing functionality was moved to `parsley.position`; use `position.line` instead as this will be removed in 5.0.0", "4.2.0")
def col: Parsley[Int] = position.col
/** This parser returns the current line and column numbers of the input without having any other effect.
*
* When this combinator is ran, no input is required, nor consumed, and
* the current line and column number will always be successfully returned. It has no other
* effect on the state of the parser.
*
* @example {{{
* scala> import parsley.Parsley.pos, parsley.character.char
* scala> pos.parse("")
* val res0 = Success((1, 1))
* scala> (char('a') *> pos).parse("a")
* val res0 = Success((1, 2))
* scala> (char('\n') *> pos).parse("\n")
* val res0 = Success((2, 1))
* }}}
*
* @return a parser that returns the line and column number the parser is currently at.
* @note in the presence of wide unicode characters, the column value returned may be inaccurate.
* @group pos
* @deprecated Moved to [[position.pos `position.pos`]], due for removal in 5.0.0
*/
@deprecated("Position parsing functionality was moved to `parsley.position`; use `position.line` instead as this will be removed in 5.0.0", "4.2.0")
def pos: Parsley[(Int, Int)] = position.pos
// $COVERAGE-ON$
}
Loading

0 comments on commit f4f164c

Please sign in to comment.