Skip to content

Commit

Permalink
Allow rust tuple indexing
Browse files Browse the repository at this point in the history
`lorem.0` is now supported
  • Loading branch information
hugopeixoto committed Sep 7, 2020
1 parent a9fdd44 commit f7a89c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rouge/lexers/rust.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def macro_closed?

rule %r/([.]\s*)?#{id}(?=\s*[(])/m, Name::Function
rule %r/[.]\s*#{id}/, Name::Property
rule %r/[.]\s*\d+/, Num::Integer
rule %r/(#{id})(::)/m do
groups Name::Namespace, Punctuation
end
Expand Down
5 changes: 5 additions & 0 deletions spec/visual/samples/rust
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,8 @@ async fn learn_and_sing() {
let song = learn_song().await;
sing_song(song).await;
}

fn tuple_access() {
let t: (i32, i32) = (42, 13);
let f: t.0;
}

0 comments on commit f7a89c0

Please sign in to comment.