And-predicate for Scala?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

And-predicate for Scala?

tomtung
It seems to be a silly question...but how to use And-predicate in Parboiled for Scala? In the document:

https://github.com/sirthias/parboiled/wiki/Rule-Construction-in-Scala

it says it should be something like "&a". But this doesn't seem to work (and I am not sure whether & is a legal unary operator). I saw that "test" method in "Parser" trait as well as "~:?" and "~?" methods in "Rule" class provide a similar functionality, but none of them allows me to just use rules as predicates.

Is it not yet implemented or have I missed something?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: And-predicate for Scala?

mathias
Administrator
Tom,

yes, the docs very not quite correct there, I just fixed this.
It should be "&(a)" rather than "&a" since, as you say, the & operator cannot actually be used as a unary operator.

Thanks for the report and cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 14.02.2012, at 12:11, Tom Dong [via parboiled users] wrote:

> It seems to be a silly question...but how to use And-predicate in Parboiled for Scala? In the document:
>
> https://github.com/sirthias/parboiled/wiki/Rule-Construction-in-Scala
>
> it says it should be something like "&a". But this doesn't seem to work (and I am not sure whether & is a legal unary operator). I saw that "test" method in "Parser" trait as well as "~:?" and "~?" methods in "Rule" class provide a similar functionality, but none of them allows me to just use rules as predicates.
>
> Is it not yet implemented or have I missed something?
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/And-predicate-for-Scala-tp3743341p3743341.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.
> NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: And-predicate for Scala?

tomtung
Thanks:)

Using parboiled for Scala, I have just built a simple tool that parses LaTeX markups and attempts to convert them to human-readable Unicode strings. Maybe it can serve as another example of using parboiled in Scala.

Source code: https://github.com/tomtung/latex2unicode
Online demo: http://latex2unicode.herokuapp.com/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: And-predicate for Scala?

mathias
Administrator
Tom,

cool!
LaTeX2Unicode looks like something quite useful...

Thanks for sharing and cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 21.02.2012, at 10:56, tomtung [via parboiled users] wrote:

> Thanks:)
>
> Using parboiled for Scala, I have just built a simple tool that parses LaTeX markups and attempts to convert them to human-readable Unicode strings. Maybe it can serve as another example of using parboiled in Scala.
>
> Source code: https://github.com/tomtung/latex2unicode
> Online demo: http://latex2unicode.herokuapp.com/ 
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/And-predicate-for-Scala-tp3743341p3763092.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.
> NAML

Loading...