Lukas Wirth
4b577e2bc8
Support c string literals
2023-05-18 11:06:05 +02:00
Daniel Eades
b196e5b2f6
fixup
2022-12-31 09:26:58 +00:00
Daniel Eades
ba5067a6f0
suppress 'clippy::approx_constant' lint in test case
2022-12-30 11:28:06 +00:00
Yuri Astrakhan
e16c76e3c3
Inline all format arguments where possible
...
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.
The change was automatically created with, so there are far less change
of an accidental typo.
```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00
Noritada Kobayashi
2340d7059e
Add test code for unescaping byte strings
2022-11-07 23:39:02 +09:00
Noritada Kobayashi
bdf8547013
Clarify the intent
...
Thanks to Lukas Wirth for a suggestion.
2022-11-07 22:51:29 +09:00
Noritada Kobayashi
180b4cedec
Fix the length displayed for byte string literals with escaped newlines
...
The length of byte strings containing escaped newlines is displayed two
bytes longer when the first escaped character is a newline.
This is due to a small bug in handling the first escaped newline in
string literals.
Closes #13567
2022-11-07 20:07:16 +09:00
Chayim Refael Friedman
2eec4ed69d
Lower float literals with underscores
2022-09-01 00:11:32 +00:00
feniljain
1f4870ff1c
fix: f32 and f64 representation during lowering
2022-05-26 20:03:05 +05:30
Jonas Schievink
9bd11459ba
Revert "Auto merge of #12149 - jonas-schievink:literally-just-a-literal, r=jonas-schievink"
...
This reverts commit cc9ae2b89e
, reversing
changes made to 7dfd1cb572
.
2022-05-13 15:08:14 +02:00
Jonas Schievink
1bc3305d95
Split float literal tokens at the .
2022-05-05 16:28:58 +02:00
Jonas Schievink
502c519e7d
Wrap float literals in their own node
2022-05-05 16:28:14 +02:00
Laurențiu Nicola
9856144b0b
Lower values of char and byte literals
2022-05-05 08:12:08 +03:00
Matthias Krüger
1f70886b15
fix clippy::single_char_pattern
2022-03-12 16:50:49 +01:00
Lukas Wirth
91279db2b4
Move format specifier lexing from syntax to ide_db
2022-01-15 13:14:59 +01:00
Lukas Wirth
c3148cb396
Slightly cleanup HasFormatSpecifier::lex_format_specifier
2022-01-13 19:12:39 +01:00
Lukas Wirth
08adce61a1
Better interface for doc comment and attribute processing
2022-01-07 14:14:33 +01:00
Oleg Matrokhin
60605a24d4
Reuse results from split_into_parts()
2021-12-13 21:16:04 +03:00
Oleg Matrokhin
8b03b41b7a
Add number representation assists
2021-12-13 19:35:38 +03:00
Lukas Wirth
1294bfce86
Migrate to edition 2021
2021-10-21 20:10:40 +02:00
Aramis Razzaghipour
9583dd5725
Replace if let
with match
where appropriate
2021-10-05 09:00:21 +11:00
Aramis Razzaghipour
eff195852d
Fix miscellaneous Clippy lints
2021-10-03 23:53:30 +11:00
Aramis Razzaghipour
55c0b86cde
Add semicolons for consistency
...
`clippy::semicolon_if_nothing_returned`
2021-10-03 23:39:43 +11:00
Maan2003
c9b4ac5be4
clippy::redudant_borrow
2021-06-13 09:24:16 +05:30
Jade
73023c0299
Support length for ByteStrings
...
I am not confident that my added byte string parsing is right.
2021-05-12 21:22:46 -07:00
Aleksey Kladov
e33959a888
Simplify code
...
changelog: skip
2021-03-23 19:41:15 +03:00
Matthias Krüger
202b51bc7b
a lot of clippy::style fixes
2021-03-21 16:15:41 +01:00
Lukas Wirth
ec824a92d0
Better handling of block doc comments
2021-03-17 14:48:57 +01:00
John Renner
9eecba4dbf
Implement line<->block comment assist
2021-02-24 17:13:00 -08:00
Lukas Wirth
6c2ce55150
Fix ast::String::value not properly escaping in some cases
2021-01-30 16:31:19 +01:00
Aleksey Kladov
46b4f89c92
.
2021-01-20 01:56:11 +03:00
Jeremy Kolb
26a1675764
Remove some redundant allocations
2020-12-12 12:27:09 -05:00
Lukas Wirth
f8823e8cbc
Properly fetch inner and outer docs on hir-level
2020-12-09 09:22:41 +01:00
Lukas Wirth
3174e941db
Simplify ast::Comment api surface
2020-12-08 14:15:41 +01:00
Lukas Wirth
b064f6da9e
Keep doc attribute order
2020-12-07 20:38:28 +01:00
bors[bot]
dc09d97fb2
Merge #6649
...
6649: Accept more than just the standard rust literal suffixes in *Number::suffix r=matklad a=Veykril
I am not entirely sure whether to keep or remove the `SUFFIXES` but I figured we can always bring them back once they are needed.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-02 13:13:01 +00:00
Lukas Wirth
49fbfffb48
Add ast::*Number::suffix tests unit tests
2020-11-28 16:22:28 +01:00
Lukas Wirth
347da74eda
Avoid allocation in ast::String::value if the string needs no unescaping
2020-11-27 12:03:58 +01:00
Lukas Wirth
931493e949
Accept more than just the standard rust literal suffixes in *Number::suffix
2020-11-27 00:00:18 +01:00
Roland Ruckerbauer
a15dda48c6
format string highlighting: handle hex + debug type specifier
2020-11-15 17:43:14 +01:00
Aleksey Kladov
81ac99f60a
Simplify code
2020-11-12 11:45:18 +01:00
Aleksey Kladov
5db789df9c
Cleanup API
2020-11-06 22:52:42 +01:00
Aleksey Kladov
6158304f8b
Simplify
2020-11-06 22:30:58 +01:00
Aleksey Kladov
5ba4f949c2
Kill RAW_ literals
...
Syntactically, they are indistinguishable from non-raw versions, so it
doesn't make sense to separate then *at the syntax* level.
2020-11-06 22:23:14 +01:00
Aleksey Kladov
eb46033390
More orthogonal API
2020-11-06 19:09:01 +01:00
Aleksey Kladov
735aaa7b39
Move int parsing to IntNumber token
2020-11-06 18:54:01 +01:00
Aleksey Kladov
6bcc33e5b7
Better imports
2020-11-06 18:39:09 +01:00
Aleksey Kladov
a1c187eef3
Rename ra_syntax -> syntax
2020-08-12 18:30:53 +02:00