https://svn.lrde.epita.fr/svn/xrm/trunk
Index: ChangeLog
from SIGOURE Benoit <sigoure.benoit(a)lrde.epita.fr>
Extend real-eq.
* src/str/xrm-to-prism.str: Optimize traversals.
* src/str/reals.str: Extend real-eq.
reals.str | 11 ++++++-----
xrm-to-prism.str | 9 ++-------
2 files changed, 8 insertions(+), 12 deletions(-)
Index: src/str/xrm-to-prism.str
--- src/str/xrm-to-prism.str (revision 24)
+++ src/str/xrm-to-prism.str (working copy)
@@ -4,7 +4,7 @@
strategies
xrm-to-prism =
- topdown(repeat(xrm-to-prism-desugar))
+ topdown(try(xrm-to-prism-desugar))
; id // unroll static for loops here
; topdown(try(reorder-module-contents))
@@ -33,7 +33,7 @@
reorder-module-contents =
?Module(name, _)
; {| DeclarationList, CommandList:
- Module(id, map(try(fetch-module-content)))
+ Module(id, map(add-command <+ add-declaration))
; where(
bagof-DeclarationList
; ?dec-list
@@ -43,11 +43,6 @@
|}
; !Module(name, dec-list, cmd-list)
- // we're inside a Module(_, content)
- // each element is either a Command(_, _, _) or a declaration
- fetch-module-content =
- add-command <+ add-declaration
-
// if the current term is a Command, add it in the CommandList DR
add-command =
?Command(_, _, _)
Index: src/str/reals.str
--- src/str/reals.str (revision 24)
+++ src/str/reals.str (working copy)
@@ -3,7 +3,7 @@
strategies
// for some reason the following rules are only defined for integers
- // in the stratego-lib. Here is their equivalant for reals.
+ // in the stratego-lib. Here is their equivalent for reals.
addR = (string-to-real, string-to-real); addr; real-to-string
subtR = (string-to-real, string-to-real); subtr; real-to-string
mulR = (string-to-real, string-to-real); mulr; real-to-string
@@ -15,13 +15,14 @@
/**
** tests whether two reals are equal
- ** => tests if there difference is less than 10^-7
+ ** => tests if there difference is less than the precision given in parameter
** operates on the input term (a, b)
- ** eg: <real-eq> ("0.42", "0.43") -> fail
+ ** eg: <real-eq(|0.00001)> ("0.42", "0.43") -> fail
*/
- real-eq =
+ real-eq(|precision) =
(string-to-real, string-to-real)
; subtr
; abs => difference
- ; <not(gtr)>(difference, 0.0000001)
+ ; <not(gtr)>(difference, precision)
+ real-eq = real-eq(|0.0000001)
On 2006-05-11, Nicolas Pouillard <nicolas.pouillard(a)gmail.com> wrote:
> On 5/11/06, Tsuna <tsuna(a)warszawa.lrde.epita.fr> wrote:
>> On 2006-05-10, Nicolas Pouillard <nicolas.pouillard(a)gmail.com> wrote:
>> > On 5/11/06, Tsuna <tsuna(a)warszawa.lrde.epita.fr> wrote:
>> >> On 2006-05-10, Nicolas Pouillard <nicolas.pouillard(a)gmail.com> wrote:
>> >> > On 5/10/06, Tsuna <tsuna(a)warszawa.lrde.epita.fr> wrote:
>> >> >>
>> >> >> Cool thanks for the reply :)
>> >> >> Is it possible to exclude ``.*.sw?'' in ~/.vcs ?
>> >> >>
>> >> >
>> >> > Yes but if you want talk about vim files toto.swp toto.swo this regexp
>> >> > will works better: \.sw.$
>> >> >
>> >>
>> >> ok if it's a perl-like (or ruby-like) regexp, shouldn't it be \..*\.sw.
>> >> ?
>> >>
>> >
>> > It's a ruby regexp (so almost like a perl one).
>> >
>> > Don't forget the $ to anchor the end of the filename: \..*\.sw.$
>> >
>>
>> For some reason it won't work :/
>> $ cat ~/.vcs
>> exclude:
>> - Makefile.in
>> - \..*\.sw.$
>> $ svn st
>> + +committed
>> ? src/tools/.pp-prism.str.swp
>>
>> it's weird since it works for the Makefile.in
>> moreover, if it's a real ruby regexp, shouldn't I have:
>> exclude:
>> - Makefile\.in
>> instead?
>>
>> any idea?
>>
>
> By default the type is a plain string not a regexp, one use "!re" to
> specify the type in Yaml:
>
> exclude:
> - Makefile.in # and not Makefile\.in
> - !re ^\..*\.sw.$
>
> BTW please fix your from address (Tsuna <tsuna(a)**warszawa**.lrde.epita.fr>).
>
Done :)
Thank you very much for your support!
--
SIGOURE Benoit aka Tsuna
_____
/EPITA\ Promo 2008.CSI Rock & tRoll
On 2006-05-10, Nicolas Pouillard <nicolas.pouillard(a)gmail.com> wrote:
> On 5/11/06, Tsuna <tsuna(a)warszawa.lrde.epita.fr> wrote:
>> On 2006-05-10, Nicolas Pouillard <nicolas.pouillard(a)gmail.com> wrote:
>> > On 5/10/06, Tsuna <tsuna(a)warszawa.lrde.epita.fr> wrote:
>> >>
>> >> Cool thanks for the reply :)
>> >> Is it possible to exclude ``.*.sw?'' in ~/.vcs ?
>> >>
>> >
>> > Yes but if you want talk about vim files toto.swp toto.swo this regexp
>> > will works better: \.sw.$
>> >
>>
>> ok if it's a perl-like (or ruby-like) regexp, shouldn't it be \..*\.sw.
>> ?
>>
>
> It's a ruby regexp (so almost like a perl one).
>
> Don't forget the $ to anchor the end of the filename: \..*\.sw.$
>
For some reason it won't work :/
$ cat ~/.vcs
exclude:
- Makefile.in
- \..*\.sw.$
$ svn st
+ +committed
? src/tools/.pp-prism.str.swp
it's weird since it works for the Makefile.in
moreover, if it's a real ruby regexp, shouldn't I have:
exclude:
- Makefile\.in
instead?
any idea?
--
SIGOURE Benoit aka Tsuna
_____
/EPITA\ Promo 2008.CSI Rock & tRoll
On 2006-05-10, Nicolas Pouillard <nicolas.pouillard(a)gmail.com> wrote:
> On 5/10/06, Tsuna <tsuna(a)warszawa.lrde.epita.fr> wrote:
>>
>> Cool thanks for the reply :)
>> Is it possible to exclude ``.*.sw?'' in ~/.vcs ?
>>
>
> Yes but if you want talk about vim files toto.swp toto.swo this regexp
> will works better: \.sw.$
>
ok if it's a perl-like (or ruby-like) regexp, shouldn't it be \..*\.sw.
?
--
SIGOURE Benoit aka Tsuna
_____
/EPITA\ Promo 2008.CSI Rock & tRoll