World: r3wp
[REBOL Syntax] Discussions about REBOL syntax
older newer | first last |
Maxim 14-Feb-2012 [13] | if you mean value-syntax... actually no it doesn't :-) but this does (in current implementation of file) rebol-syntax: [ some [ comment-syntax | value-syntax | whitespace ] ] |
Ladislav 14-Feb-2012 [14x2] | that is called IMPLICIT-BLOCK and is there |
(slightly different than your code) | |
Maxim 14-Feb-2012 [16] | ah.. hehe my browser had an old version of the rules... did a page refresh and there it was ;-) |
Steeve 14-Feb-2012 [17] | Ladislav, I see what you did there ;-) Tuples: Each number is 3 digit max Leading and trailing zeros are optional .0. == 0.0.0 |
Maxim 14-Feb-2012 [18] | actually, the rule should load the digits and fail if the integer it represents is higher than 255. |
Steeve 14-Feb-2012 [19] | yes but it's hard to do it without code evaluation. Same remarks apply to integer! and decimal! datatypes. |
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). | |
older newer | first last |