Skip to content
Merged

ci #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Rust

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- run: rustup install nightly && rustup default nightly && rustup component add rustfmt clippy

- run: cargo +nightly fmt --check

- run: cargo +nightly clippy --all-targets --all-features

- run: cargo +nightly build

- run: cargo +nightly test
33 changes: 0 additions & 33 deletions .gitlab-ci.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion kfl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"

[dependencies]
kfl-derive = { path = "../kfl-derive", version = "0", optional = true }
chumsky = { version = "1.0.0-alpha.7" }
chumsky = { version = "= 1.0.0-alpha.7" }
thiserror = "2"
miette = "7"

Expand Down
33 changes: 21 additions & 12 deletions kfl/src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,13 @@ fn ml_comment<'a>() -> impl Parser<'a, I<'a>, (), Extra> + Clone {
})
.map_err_with_state(|err, span, _| {
let span = Span::from(span);
if matches!(&err, ParseError::Unexpected {
found: TokenFormat::Eoi,
..
}) && span.len() > 2
if matches!(
&err,
ParseError::Unexpected {
found: TokenFormat::Eoi,
..
}
) && span.len() > 2
{
err.merge(ParseError::Unclosed {
label: "comment",
Expand Down Expand Up @@ -254,10 +257,13 @@ fn escaped_string<'a>() -> impl Parser<'a, I<'a>, Box<str>, Extra> + Clone {
)
.then_ignore(just('"'))
.map_err_with_state(|err: ParseError, span, _| {
if matches!(&err, ParseError::Unexpected {
found: TokenFormat::Eoi,
..
}) {
if matches!(
&err,
ParseError::Unexpected {
found: TokenFormat::Eoi,
..
}
) {
err.merge(ParseError::Unclosed {
label: "string",
opened_at: Span(span.start, span.start + 1), //span.before_start(1),
Expand Down Expand Up @@ -393,10 +399,13 @@ fn nodes<'a>() -> impl Parser<'a, I<'a>, Vec<Node>, Extra> {
recursive(|nodes| {
let braced_nodes = just('{').ignore_then(nodes.then_ignore(just('}')).map_err_with_state(
|err, span, _| {
if matches!(&err, ParseError::Unexpected {
found: TokenFormat::Eoi,
..
}) {
if matches!(
&err,
ParseError::Unexpected {
found: TokenFormat::Eoi,
..
}
) {
let span = Span::from(span);
err.merge(ParseError::Unclosed {
label: "curly braces",
Expand Down