Repository navigation
feat(steps): quotes around typed step parameters are optional, decided by the type - #166
Merged
Merged
Conversation
…d by the type (bddkit#79) A bare {x} in a step declaration takes its quotes from the parameter's type: uint, int, float, word and method accept 5 and "5"; text and secret require "..."; any is as written. Quotes written into a declaration stay literal, and a parameter is bare only when an even number of double quotes precede it. I sleep and both 'I expect the next assertion to pass within' steps drop their literal quotes; the quoted forms still match. Typed parameters use a compact <<...>> slot shape in the step regex, because the exact vars::PLACEHOLDER costs about 0.5 s per use in a debug build once the expressions crate expands it. A typed argument that starts with << but is not a whole slot makes the step match nothing, so validate::check still refuses it before the first request. word no longer matches a double quote, and the numeric types use ASCII digits. BREAKING CHANGE: a macro template with an untyped quoted {x} before a bare typed parameter can overlap a builtin ending in a quoted any parameter and is refused at startup (write {x:text}); a bare {x:text} or {x:secret} in a macro template now requires quotes; word no longer matches a double quote.
sergeym
force-pushed
the
feat/issue-79-optional-quotes
branch
from
October 28, 2026 21:23
165bf83 to
e1efa0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #79.
A bare
{x}takes its quotes from the parameter's type:uint,int,float,word,methodaccept5and"5";text/secretrequire"…";anyis as written. Quotes written in a declaration stay literal.I sleepand the twowithin …steps drop their quotes; the quoted forms still match.Breaking for macro templates:
{x}before a bare typed parameter can overlap a builtin ending in a quotedanyand is refused at startup — write{x:text};{x:text}/{x:secret}now requires quotes;wordno longer matches".Typed parameters use a compact
<<…>>slot shape in the step regex (the exactPLACEHOLDERcost ~0.5 s per use in debug via the expressions crate); a typed argument that is not a whole slot makes the step match nothing, so it is still refused before the first request.