summaryrefslogtreecommitdiff
path: root/src/bindings.rs
AgeCommit message (Collapse)AuthorFilesLines
2023-12-27bindings: Add warnings for missing capture names or missing capture typesDaniel Silverstone1-11/+42
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2023-12-27bindings: Remember filename when loading bindingsDaniel Silverstone1-25/+123
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2023-12-25feat: typeset scenarios by typesetting stepsLars Wirzenius1-4/+10
Typeset each step in a scenario, including captures in the steps. Previously the scenario was just one <pre> element, now things can be styled with CSS. Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2023-11-11Merge branch 'fix-320' into 'main'Lars Wirzenius1-2/+4
Make bindings parsing more strict, and validate that strictness Closes #320 See merge request subplot/subplot!364
2023-11-11bindings: Be more strict about fields in bindings filesDaniel Silverstone1-2/+4
2023-11-04feat: generate library documentation from bindings filesLars Wirzenius1-13/+38
Add a `doc` field to a binding. It's a string meant to contain markdown. Add subcommand `subplot libdocgen YAML -o MD` to read a bindings file and output a markdown file documenting the steps in the bindings file, and the type of captures, and the documentation for the step. Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2023-08-12subplot: Enable passing of location into the template expansionDaniel Silverstone1-1/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2023-08-12steps: Pass location information into scenarios and scenario steps for error ↵Daniel Silverstone1-10/+17
messages Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2023-02-11chore: use variables in Rust format stringsLars Wirzenius1-5/+5
Change this: format!("{}", foo) into this: format!("{foo}") Support for this feature was added in Rust 1.58 (see https://github.com/rust-lang/rust/releases/tag/1.58.0) and in 1.67 clippy suggests about this. Because the new style seems to be where the Rust ecosystem is going, I think Subplot should follow to avoid being needlessly different from most other projects. Sponsored-by: author
2022-11-12chore: fix unnecessary borrows found by clippyLars Wirzenius1-1/+1
Sponsored-by: author
2022-10-22(bindings): Add path type to bindings supportDaniel Silverstone1-0/+8
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2022-07-30chore: handle write! errorsLars Wirzenius1-1/+1
Sponsored-by: author
2022-07-02(bindings): use Write macro for cleaner string updateDaniel Silverstone1-2/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2022-05-06refactor: replace SubplotError::RegexError with a simpler oneLars Wirzenius1-1/+2
SubplotError::RegexError was a struct variant in the enum. Replace it with a more usual variant with the regex::Error as a source field, for better error messaging. Sponsored-by: author
2022-05-06refactor: replace SubplotError::YamlError with more specific oneLars Wirzenius1-1/+2
SubplotError::YamlError is quite generic. We only parse YAML as part of document metadata, so replace the error with a more specific one. Sponsored-by: author
2022-05-05refactor: drop the subplot::Result type aliasLars Wirzenius1-8/+12
Replace subplot::Result<T> with Result<T, SubplotError>. I find this now to be clearer, as I don't need to remind myself which Result is being used where. This should not be a breaking change. Sponsored-by: author
2022-03-24feat! change logging to use log/env_logger instead of tracingLars Wirzenius1-13/+4
We don't use async in Subplot, and the mental overhead of learning tracing and the code overhead to add support for logging custom values (implementing the Value trait for Subplot internal types) does not seem worthwhile. Sponsored-by: author
2021-12-11chore: tidy up minor issues found by clippyLars Wirzenius1-7/+1
Sponsored-by: author
2021-09-07subplot: Properly support polyglot bindingsDaniel Silverstone1-17/+22
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Parse polyglot bindingsDaniel Silverstone1-12/+50
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Remove redundant function/cleanupDaniel Silverstone1-27/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Initial move toward multi-lingual bindingsDaniel Silverstone1-133/+42
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Refactor function+cleanup into a structDaniel Silverstone1-6/+59
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07chore: Unwind global template nameDaniel Silverstone1-2/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04bindings: Example chained error for parsing bindingsDaniel Silverstone1-1/+3
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04tracing: Add a bunch of TRACE level tracingDaniel Silverstone1-1/+15
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04chore: Fix unnecessary borrow lintsDaniel Silverstone1-3/+3
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-07-20feat: when more than one bindings match a step, list all of themLars Wirzenius1-10/+18
Sponsored-by: author
2021-05-20chore: Fix a bunch of clippy lintsDaniel Silverstone1-41/+33
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-04-09chore: Clear some clippy lintsDaniel Silverstone1-2/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-01-09chore: Simplify to use resource::read_as_stringDaniel Silverstone1-4/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-01-09resource: Step one of VFS support, redirect all opensDaniel Silverstone1-3/+2
This redirects all file reading via the new resource module which will be used to control where files come from. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-18bindings: Change typemap to use an enumDaniel Silverstone1-39/+108
Since we're validating and restricting types/kinds to the given set of valid values, we may as well actually enforce that by means of an enumeration. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-18bindings: Add check that captured text matches the kind patternsDaniel Silverstone1-2/+27
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-18bindings: Add tests for simple-pattern and typemap scenariosDaniel Silverstone1-0/+58
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-18bindings: Use/amend the typemap when parsing simple patternsDaniel Silverstone1-16/+48
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-18bindings: Refactor kinds into a lazy static for reuseDaniel Silverstone1-14/+23
We want to use kind patterns elsewhere so refactoring them into a lazy static seemed sensible. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-18bindings: Support parameter type mapDaniel Silverstone1-14/+101
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-18bindings: use matches macroDaniel Silverstone1-12/+12
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-05Revert "clippy: Use matches macro"Lars Wirzenius1-12/+12
This reverts commit 7015e69a2c8bc2894f89b3b7f85fc2bff653933e. matches! doesn't work with Debian buster's rustc. Our CI uses that rustc, for now, so I think we should avoid matches! until we've updated the CI.
2020-12-03clippy: Use matches macroDaniel Silverstone1-12/+12
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-11-05chore: Use more efficient to_string, thanks clippyDaniel Silverstone1-1/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-10-22chore: use as_ref().map instead of matchLars Wirzenius1-4/+1
Debian 10 (buster) now has a sufficiently new rustc that this cleaner and shorter code works.
2020-09-26add: simple word pattern kindsLars Wirzenius1-4/+112
2020-06-20feat: Case insensitive matching by defaultDaniel Silverstone1-20/+85
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-06-20test: Ensure case insensitive bindings workDaniel Silverstone1-6/+6
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-06-20feat: Ensure keys in bindings files are case insensitiveDaniel Silverstone1-3/+11
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-06-06bindings: Verify that the correct error is returned from Bindings::find()Daniel Silverstone1-2/+28
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-06-06bindings: Change to take ownership of passed bindingsDaniel Silverstone1-8/+8
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-06-06feat: Support reporting error when more than one binding matches a stepDaniel Silverstone1-13/+10
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>