We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying the following. I have used regular expression [a-zA-Z]+. While it seems to match lower letters, it does not match the upper case letters.
import ctpg; import std.array: join; import std.conv: to; import std.stdio; import std.algorithm;
mixin(genParsers( q{ @_setSkip(skip)
// root parser string root = addExp $; // addition and subtraction string addExp = mulExp !"+" addExp >> (lhs, rhs){ return lhs ~ "+" ~ rhs; } / mulExp !"-" addExp >> (lhs, rhs){ return lhs ~ "-" ~ rhs; } / mulExp; // multiplication and division string mulExp = primary !"*" mulExp >> (lhs, rhs){ return lhs ~ "*" ~ rhs; } / primary !"/" mulExp >> (lhs, rhs){ return lhs ~ "/" ~ rhs; } / primary; string primary = !"(" addExp !")" / [a-zA-Z]+ >> to!string;
}));
void main() { static bool test() { pragma(msg, parse!root("a * b + c * d").value); pragma(msg, parse!root("A * B + C * D").value); return true; };
test();
}
The text was updated successfully, but these errors were encountered:
Fix issue #3
e37656a
Fixed
Sorry, something went wrong.
No branches or pull requests
I am trying the following. I have used regular expression [a-zA-Z]+. While it seems to match lower letters, it does not match the upper case letters.
import ctpg;
import std.array: join;
import std.conv: to;
import std.stdio;
import std.algorithm;
mixin(genParsers(
q{
@_setSkip(skip)
}));
void main()
{
static bool test()
{
pragma(msg, parse!root("a * b + c * d").value);
pragma(msg, parse!root("A * B + C * D").value);
return true;
};
}
The text was updated successfully, but these errors were encountered: