-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email address causes Alice to look for a fixture file #780
Comments
regexes for emails are difficult, I think the easiest way is either to check if we have non empty a Alternatively just escape it: |
This would be a new lexer that comes after
I'll have to try this tomorrow. Not sure I like having to escape the @ symbol, but if it works it works. |
A simpler way I think would be to decorate the lexer and modify the list of tokens accordingly. IIRC this is already done somewhere to transform all the successive |
I created a PR with a new lexer that does what I think you're saying. Edit: As an alternative, I tried changing the reference escaper regex to include numbers like I showed in my OP, but it causes some integration tests to fail, so it's not as simple as it seems. |
Odd problem. I was on 3.0.0-RC.1 and tried updating to dev-master, but it still bugs out.
My fixture file is as follows, somewhat matching the example provided in the docs:
and trying to load fixtures results in:
Setting a breakpoint and stepping through, I see that the email property is being parsed into a ListValue containing 2 values:
Trying to figure out why it's doing that,
UniqueValueDenormalizer::denormalize
is called with[email protected]
SimpleValueDenormalizer::denormalize
is called with[email protected]
SimpleValueDenormalizer::parseValue
is called with[email protected]
FunctionFixtureReferenceParser::parse
is called with[email protected]
StringMergerParser::parse
is called with[email protected]
SimpleParser::parse
is called with[email protected]
EmptyValueLexer::lex
is called with[email protected]
ReferenceEscaperLexer::lex
is called with[email protected]
GlobalPatternsLexer::lex
is called with[email protected]
FunctionLexer::lex
is called with[email protected]
SubPatternsLexer::lex
is called with[email protected]
!!!!! This lexer turns
[email protected]
into 3 tokens:I think this is ultimately caused by the regex pattern in
ReferenceEscaperLexer
not matching against[email protected]
.The current pattern is
(\p{L})@
which matches against any letter, but does not include numbers. I think the pattern needs to be(\p{L}|\p{N})@
.See https://regex101.com/r/4yUIOk/1 for failing regex test.
See https://regex101.com/r/d8VSyt/1 for working regex test.
The text was updated successfully, but these errors were encountered: