Re: [PATCH] Reject non-pure decimal tuple indexes.

2021-06-25 Thread Mark Wielaard
021 19:37:11 +0200 Subject: [PATCH] Reject non-pure decimal tuple indexes. Tuple indexes should be pure decimal integer literals. But the parser just sees an integer literal. Fix this by introducing a new type hint CORETYPE_PURE_DECIMAL. This doesn't conflict with any existing type hints sinc

[PATCH] Reject non-pure decimal tuple indexes.

2021-06-25 Thread Mark Wielaard
Tuple indexes should be pure decimal integer literals. But the parser just sees an integer literal. Fix this by introducing a new type hint CORETYPE_PURE_DECIMAL. This doesn't conflict with any existing type hints since a pure decimal doesn't have a type suffix. Introduce a

Re: tuple indexes

2021-06-24 Thread Philip Herron
On 23/06/2021 21:15, Mark Wielaard wrote: > On Wed, Jun 23, 2021 at 12:51:34AM +0200, Mark Wielaard wrote: >> Finally, the The Rust Reference says "A tuple index is used to refer >> to the fields of tuples, tuple structs, and tuple variants." I don't >> understand how this would work for tuple vari

Re: tuple indexes

2021-06-23 Thread Mark Wielaard
On Wed, Jun 23, 2021 at 12:51:34AM +0200, Mark Wielaard wrote: > Finally, the The Rust Reference says "A tuple index is used to refer > to the fields of tuples, tuple structs, and tuple variants." I don't > understand how this would work for tuple variants. Does anybody have > an example of how to

Re: tuple indexes

2021-06-23 Thread Philip Herron
On 23/06/2021 17:06, Mark Wielaard wrote: > Hi Philip, > > On Wed, 2021-06-23 at 10:55 +0100, Philip Herron wrote: >> Small update, I think part of this issue is that the support for >> unit-structs is not there yet in the compiler, so if you remove the unit >> tuple struct and move the other struc

Re: tuple indexes

2021-06-23 Thread Mark Wielaard
Hi Philip, On Wed, 2021-06-23 at 10:55 +0100, Philip Herron wrote: > Small update, I think part of this issue is that the support for > unit-structs is not there yet in the compiler, so if you remove the unit > tuple struct and move the other struct definitions outside of the block > the test case

Re: tuple indexes

2021-06-23 Thread Philip Herron
On 23/06/2021 10:47, Philip Herron wrote: > On 22/06/2021 23:51, Mark Wielaard wrote: >> Hi, >> >> I was looking into https://github.com/Rust-GCC/gccrs/issues/511 "rust >> has two kinds of integer literal" Which explains that integer literals >> used for a tuple index are not general integer litera

Re: tuple indexes

2021-06-23 Thread Philip Herron
On 22/06/2021 23:51, Mark Wielaard wrote: > Hi, > > I was looking into https://github.com/Rust-GCC/gccrs/issues/511 "rust > has two kinds of integer literal" Which explains that integer literals > used for a tuple index are not general integer literals. > > First I wanted to write some tests, and s

tuple indexes

2021-06-22 Thread Mark Wielaard
Hi, I was looking into https://github.com/Rust-GCC/gccrs/issues/511 "rust has two kinds of integer literal" Which explains that integer literals used for a tuple index are not general integer literals. First I wanted to write some tests, and started with some constructs that should pass. But some