r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[REBOL Syntax] Discussions about REBOL syntax

Andreas
14-Feb-2012
[20x2]
We are aiming for a purely syntactic description. So semantic checks 
at a later stage are out of the picture for now (no action blocks 
in general, and here: no loading of digits in particular).
But basic accuracy is important :)
Ladislav
14-Feb-2012
[22]
Yes, 1000.1000.1000 is recognized as a tuple. The fact that it is 
"too big" is another check.
Andreas
14-Feb-2012
[23x2]
So ".0." should be recognised as valid, that's important. ".1234." 
being invalid, not so much.
(Same for integer and decimal overflows, as Steeve already remarked.)
Steeve
14-Feb-2012
[25]
tuple-syntax: [0 3 digit #"." 1 3 digit #"." 0 7 [1 3 digit #"."] 
and termination]

I know there is still the need to check the overflow but I think 
it's slightly better than using some or any digits
Andreas
14-Feb-2012
[26x3]
No need to check overflow, as stated above.
But it has to match syntactically valid tuples :)
The above would fail for "0000..", no?
Steeve
14-Feb-2012
[29x2]
no, but it would fail another cases. I forgot the last number
tuple-syntax: [0 3 digit #"." 1 3 digit #"." 0 7 [1 3 digit #"."] 
0 3 digit and termination]
Andreas
14-Feb-2012
[31]
Still fails for {0000..}.
Steeve
14-Feb-2012
[32x2]
to get rid of the 3-digit enforcement:

tuple-syntax: [any digit #"." some digit #"." 0 7 [some digit #"."] 
any digit and termination]
wait...
Andreas
14-Feb-2012
[34]
0..0
 :)
Steeve
14-Feb-2012
[35x4]
yep
replace some by any
But but... it's not only the leading and trailing zeros that can 
be removed.
It takes me time......
So the initial implementation of ladislav was right from the start
Ladislav
14-Feb-2012
[39]
adding the termination is needed, though
Steeve
14-Feb-2012
[40x4]
let me try again :-)
the only requested digit is the second  one.
.0.... is valid
or/and the first one
0..... is valid
.0..... is valid
Ladislav
14-Feb-2012
[44]
aha, did not check the second one, needs a correction, then
Steeve
14-Feb-2012
[45x2]
tuple-syntax: [[some digit 2 9 [#"." any digit] | #"." some digit 
1 8 [#"." any digit] ] and termination]
should be better
Ladislav
14-Feb-2012
[47]
OK
Steeve
14-Feb-2012
[48]
Fiouuuu.... that one was hard :-)
Endo
14-Feb-2012
[49]
Well.. may be silly question, but can I use those parse magics in 
my projects? I didn't see license information.
Andreas
14-Feb-2012
[50]
A very good question. No license attached, yet. We'll fix that.
Endo
14-Feb-2012
[51]
Ok, thanks.
Steeve
15-Feb-2012
[52]
Andreas and Ladislav, already off ?
Andreas
15-Feb-2012
[53]
I'm around.
Steeve
15-Feb-2012
[54]
Still miss some datatypes ;-)
Andreas
15-Feb-2012
[55]
Have a go at adding some more, then :)
Steeve
15-Feb-2012
[56]
I don't want a collision. I thought your or Ladislav would finish 
it with the others making comments
GrahamC
15-Feb-2012
[57]
Can do a merge ...
Steeve
16-Feb-2012
[58x5]
The slash words are weird. Didn't know that specific syntax.
It works with R2 not with R3 anymore.

Maybe it was a mistake to allow such syntax in R2, so it's why it 
has been deprecated by Carl.
Should we keep it ?
(See the last update of Ladislav)
Not working though (the first part is a valid refinement in R2 ):
>> [///x//]
== [///x //]
Definitivly, I don't think we should  keep  such syntax even in R2. 
It makes no sense to use such (it was an error corrected in R3).
Maxim
16-Feb-2012
[63]
I think it was mainly meant as a way to make / based ops   things 
like //  and  ///  .  I don't see why it should be removed.  it can 
only contain  "/"  characters.  otherwise its a refinement.
Steeve
16-Feb-2012
[64x3]
there's no way [///x] should be a valid refinement. It will fail 
when evaluated
But yeah it's another problem
I mixed things, but there is something wrong with the both datatypes 
in R2 (it"s why it has been corrected in R3)
Maxim
16-Feb-2012
[67x2]
yeah, except when we use refinements as such within dialects, then 
it doesn't matter, since they are not being used as paths.
but its ugly so,  ///x  shouldn't be "promoted"  IMHO.   if its an 
un-intended loophole in the lexical analysis, then it shouldn't be 
within the syntax.r code.
Steeve
16-Feb-2012
[69]
about the more-less-word rule:
>> and << are allowed