Re: byte/char string representation (Was: [PATCH] Fix byte char and byte string lexing code)

2021-10-03 Thread Mark Wielaard
Hi Philip, On Thu, Sep 30, 2021 at 11:46:30AM +0100, Philip Herron wrote: > Your patch was 99% of the way there to fix the type > resolution so I finished it off for you: > > https://github.com/Rust-GCC/gccrs/pull/698/files And you added the actual backend code needed! So I'll probably say I was

Re: byte/char string representation (Was: [PATCH] Fix byte char and byte string lexing code)

2021-09-30 Thread Philip Herron
Hi Mark, Thanks for clarifying this, I was getting mixed up between normal str's and byte strings. Your patch was 99% of the way there to fix the type resolution so I finished it off for you: https://github.com/Rust-GCC/gccrs/pull/698/files The missing piece was that References and Array's are a

Re: byte/char string representation (Was: [PATCH] Fix byte char and byte string lexing code)

2021-09-25 Thread Mark Wielaard
Hi Philip, On Fri, Sep 24, 2021 at 12:01:42PM +0100, Philip Herron wrote: > This is really useful information, will this mean that the lexer token will > need to represent strings differently as well? Or is the std::string in the > lexer still ok? I think the respresentation as std::string is fin

Re: byte/char string representation (Was: [PATCH] Fix byte char and byte string lexing code)

2021-09-24 Thread Philip Herron
Hi Mark, This is really useful information, will this mean that the lexer token will need to represent strings differently as well? Or is the std::string in the lexer still ok? The change you made above has the problem that reference types like, arrays are forms of what rust calls covariant types

byte/char string representation (Was: [PATCH] Fix byte char and byte string lexing code)

2021-09-23 Thread Mark Wielaard
On Thu, Sep 23, 2021 at 04:10:59PM +0200, Arthur Cohen wrote: > > Something I was thinking about outside of the scope of that patch was > about the utf8 how do they get represented? Is it some kind of wchar_t? > > Do you mean in C++ or in rustc? In rustc, they are represented as Unicode > Scalar V

Re: [PATCH] Fix byte char and byte string lexing code

2021-09-23 Thread Arthur Cohen via Gcc-rust
> Something I was thinking about outside of the scope of that patch was about the utf8 how do they get represented? Is it some kind of wchar_t? Do you mean in C++ or in rustc? In rustc, they are represented as Unicode Scalar Values which are 4 bytes wide. >From the docs over here: [https://doc.ru

Re: [PATCH] Fix byte char and byte string lexing code

2021-09-23 Thread Philip Herron
Hi guys, Thanks, Thomas for raising the PR it is currently being merged. We will raise the next PR to get bootstrapable builds working which will be really nice there is a GitHub automation for that at the moment. Something I was thinking about outside of the scope of that patch was about the utf

Re: [PATCH] Fix byte char and byte string lexing code

2021-09-22 Thread Mark Wielaard
Hi Thomas, On Wed, Sep 22, 2021 at 11:48:56AM +0200, Thomas Schwinge wrote: > That's . > [...] > That's . Ah, sorry, I don't really track the github issues and had missed those. But good to see the analysis m

Re: [PATCH] Fix byte char and byte string lexing code

2021-09-22 Thread Thomas Schwinge
Hi Mark! On 2021-09-22T00:54:30+0200, Mark Wielaard wrote: > There were two warnings in lexer parse_byte_char and parse_byte_string > code for arches with signed chars: > > rust-lex.cc: In member function > ‘Rust::TokenPtr Rust::Lexer::parse_byte_char(Location)’: > rust-lex.cc:1564:2

[PATCH] Fix byte char and byte string lexing code

2021-09-21 Thread Mark Wielaard
There were two warnings in lexer parse_byte_char and parse_byte_string code for arches with signed chars: rust-lex.cc: In member function ‘Rust::TokenPtr Rust::Lexer::parse_byte_char(Location)’: rust-lex.cc:1564:21: warning: comparison is always false due to limited