Commit Graph

14 Commits

Author SHA1 Message Date
Paul Daniel Faria
a6af0272f7 Move semantic logic into Semantics, fix missing tag for safe amp operator, using functional methods rather than clunky inline closure 2020-08-10 08:46:34 -04:00
Paul Daniel Faria
55633f3404 Fix rebase errors 2020-08-10 08:44:54 -04:00
bors[bot]
8a57afe5a4
Merge #5684
5684: Semantic highlighting for unsafe union field access r=jonas-schievink a=Nashenas88

This change adds support for unions in inference and lowering, then extends on that to add the unsafe semantic modifier on field access only. The `is_possibly_unsafe` function in `syntax_highlighting.rs` could be extended to support fns and static muts so that their definitions are not highlighted as unsafe, but only their usage.

Also, each commit of this PR updates the tests. By reviewing the files by commit, it's easy to see how the changes in the code affected the tests.

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
2020-08-08 16:45:37 +00:00
Paul Daniel Faria
be935b2b56 Apply unsafe semantic highlighting to union field access 2020-08-08 11:29:56 -04:00
Paul Daniel Faria
3bf033e548 Add support for unions in inference and lowering 2020-08-08 11:29:56 -04:00
Paul Daniel Faria
a6532905a9 Add test for unsafe union field access highlighting 2020-08-06 21:15:31 -04:00
Paul Daniel Faria
8e657f663d Mark static mutable names as unsafe 2020-08-06 20:07:42 -04:00
Paul Daniel Faria
6be528da0d Add test for accessing static mut 2020-08-06 19:58:37 -04:00
GrayJack
a662228de4
Assingment semantic highlight 2020-07-20 12:36:23 -03:00
GrayJack
54ebb2ce30
Handle semantic highlight when STAR is part of the *{const, mut} 2020-07-20 11:21:40 -03:00
Leander Tentrup
119e71d9ea Add new Punctuation highlight tag 2020-07-15 16:42:47 +02:00
Leander Tentrup
33832d43fc Highlight punctuation as HighlightTag::Operator 2020-07-15 16:40:38 +02:00
Aleksey Kladov
e1d6b7f7c4 Use dedicated semantic highlight tag for parameters
closes #5106
2020-07-11 14:51:41 +02:00
Aleksey Kladov
05d67a9a0e Move test data to test_data directory 2020-07-01 11:26:09 +02:00