Dub seems to be using an earlier version of the dependency that I tell it to use
vnr
cfcr at gmail.com
Fri Jan 22 15:34:04 UTC 2021
Hello 😊
I'm trying to use the combinator Pry parser library
(https://code.dlang.org/packages/pry/0.3.2), but, as I'll explain
in the rest of this message, it seems to be a bad version of the
lib that dub downloads me.
So, simply by adding pry as a dependency on a virgin project, and
using features that are present in the documentation and
examples, dub indicates that these features are non-existent. I
have identified the following combinators that were not
recognized: `delimited`, `optional`, `skipWs`, `slice`,
`utfString` and also the `stk `atom. There may be others.
Searching in the code and in the different versions, it seems
that the combinators I quoted are not part of the old versions
(under 0.3.2), but it is indeed this version that I included in
the blank project...
Here is a simple example (by the way, the examples in the
"example" folder don't work for me either):
```d
import pry;
import std.stdio;
void main()
{
alias S = SimpleStream!string;
with(parsers!S)
{
auto p = delimited(range!('0', '9').rep, tk!',');
auto s = "3,3,4".stream;
string[] values;
S.Error err;
auto r = p.parse(s, values, err);
writeln(r);
}
}
```
With the following dub.sdl :
```sdl
name "test"
dependency "pry" version="~>0.3.2"
```
By building, I get:
```bash
$ dub build
pry 0.3.2: target for configuration "library" is up to date.
test ~master: building configuration "application"...
source\app.d(9,12): Error: undefined identifier delimited
```
What's wrong with all this? How come I'm using the "newest"
version of pry, but an older version of the library seems to be
used instead?
Is there a problem with the way I use dub, or is the library too
old (4 years old anyway)?
I only need to analyze a very simple format, so changing library
or method won't be complicated, but since I already have a base
with this lib, I was wondering if there was not a way to continue
with it.
Thanks for your help! 😃
More information about the Digitalmars-d-learn
mailing list