GithubHelp home page GithubHelp logo

parser's People

Contributors

bcoe avatar bycedric avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

parser's Issues

Document all used node types

Most of the existing unist syntax trees have all nodes documented, like nlcst. Would be good to add this once we have the first version of the parser.

Grammar cannot read git trailers

Compare

<footer>          ::= <token>, <separator>, <whitespace>*, <value>
/* "!" should be added to the AST as a <breaking-change> node with the value "!" */
<token>           ::= <breaking-change>
                   |  <type>, "(" <scope> ")", ["!"]
                   |  <type>, ["!"]
<separator>       ::= ":" | " #"
<value>           ::= <text>, <continuation>+
                   |  <text>
<continuation>    ::= <newline>, <whitespace>+, <text>

with https://git-scm.com/docs/git-interpret-trailers

  • "When reading trailers, there can be whitespaces after the token, the separator and the value"
  • "There can also be whitespaces inside the token and the value"
    • This one seems like it makes parsing trailers a lot harder and doesn't seem common

Add debug messages

@byCedric says:

Looks awesome! I'll test run it this weekend too. One thing that could help during development/debugging is adding debug messages. With that, the code path should be visible. (e.g. this)

Refs: #1

refactor: Introduce Node builder

The amount of ritual to setup a Node, update its value, and record its source position is becoming burdensome.

Let's introduce a Node builder that:

  1. provides a helper for rolling back go a prior source position, and or returning the Node.
  2. provides shortcuts for tracking source positions.

CC: @byCedric
Refs #5

Add programmatic context to parsing errors

From: #15 (comment)

I feel like there will be tooling value in having this as as well { line: <line>, column: <column> } on the error. Maybe before line 80 we could add error.position = this.pos?

Another helpful pattern I like to follow (used in node, which is good precedence I think) is to have distinct .code properties for these errors. If we were tooling around errors, checking err.code === 'EOF_ERROR is much better than err.message.startsWith('unexpected token EOF at').

Is this repository still maintained?

πŸ‘‹ Hi! I just was shown this repository - it looks great, thanks for making it. Really nice when tools publish reference implementations ❀️.

I don't see any meaningful maintenance activity since 2021. There are some issues or PRs that have been awaiting triage for a year or more, such as #42. So I'm hesitant to build on top of the published package or contribute if this repo is in a "frozen" state.

Is there >=1 maintainer who's still got time to work on this repo?

CI badge 404s

Seen on both GitHub and npm:

Screenshot of the start of the repo's readme, with the ci badge giving a 404 not found placeholder image

https://github.com/conventional-commits/parser/workflows/ci/badge.svg is not found.

I'm guessing this is because there hasn't been a meaningful action-causing commit since 2021?

Simplify parsing by preventing `!` in Tyoe?

Currently, the grammar only prevents the sequence !:. So someone could have a type like He!!o.

::= <any UTF8-octets except newline or parens or ":" or "!:" or whitespace>+

Personally, I would find this confusing to see but it also would greatly simplify this grammar rule to only be looking at characters rather than sequence of characters.

Grammar does not enforce whitespace after `:` token in footers

As per conventional commits specification v1.0.0 Β§8: β€œEach footer MUST consist of a word token, followed by either a :<space> or <space># separator, followed by a string value.”

However, the reference grammar currently specifies:

<separator>       ::= ":" | " #"
/* missing <space>     ^^ */

This is similar to but distinct from #41. The inconsintency was pointed out in crate-ci/git-conventional#54.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.