Skip to content
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

Prelexer alternatives fails with 7 arguments #745

Closed
xzyfer opened this issue Dec 22, 2014 · 9 comments · Fixed by #747
Closed

Prelexer alternatives fails with 7 arguments #745

xzyfer opened this issue Dec 22, 2014 · 9 comments · Fixed by #747

Comments

@xzyfer
Copy link
Contributor

xzyfer commented Dec 22, 2014

During the development of #744 I ran into issue with this

sequence< interpolant, alternatives< identifier, 
                          percentage, 
                          dimension, 
                          hex, 
                          number, 
                          string_constant, 
                          exactly<'%'> > >(src);

it works however if any argument is removed.

@QuLogic
Copy link
Contributor

QuLogic commented Dec 22, 2014

What's the error? It appears that alternatives is defined for up to 8 arguments. But the 7 and 8 versions include rslt = src which the lesser argument versions don't. Maybe that's all that could fix it?

@xzyfer
Copy link
Contributor Author

xzyfer commented Dec 22, 2014

No error, it would just fail to match. I took a (really?) quick look for difference between the 6 and 7 arg versions.

You're probably right. I'll give it a shot.

@akhleung
Copy link

I guess that's what I get for copying and pasting code :-/. If you're already committed to using C++11, then maybe the sequence and alternatives prelexers could be rewritten to use variadic templates.

@xzyfer
Copy link
Contributor Author

xzyfer commented Dec 22, 2014

We're committed to unordered_map at least for the foreseeable future so it's probably worth going all in on cpp11

@mgreter
Copy link
Contributor

mgreter commented Dec 22, 2014

I would speak against using the full feature set of cpp11, it already intoduced some headaches for the node-sass people since they provide prebuilt binaries. Some people still seem to be on systems which only provide gcc 4.4. ...

@xzyfer
Copy link
Contributor Author

xzyfer commented Dec 22, 2014

Cool. It'd be good to have guidelines on what will cause pain for people in gcc <= 4.4.

@mgreter
Copy link
Contributor

mgreter commented Dec 22, 2014

Pretty funny that this emerges the day I tried to compile it with gcc 4.4.4 => mgreter@14e1d7a
We would be able to replace pretty much anything with std C C++ beside uniform_real_distribution and unordered_map (with the latter beeing available for gcc 4.4.4).

@xzyfer
Copy link
Contributor Author

xzyfer commented Dec 22, 2014

Needless to say replacing things with C does not thrill me.

@mgreter
Copy link
Contributor

mgreter commented Dec 22, 2014

Sorry, should be std c++ 99 😉 But I know, C++11 has some nice syntax sugar. Specially looping over containers, which is what we mostly use beside the other two features, which are much harder to replace (I guess).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants