Skip to content

Commit

Permalink
Fix lexing of await in Rust lexer (#1587)
Browse files Browse the repository at this point in the history
Currently, `await` is tokenised as `Name::Property`. It should be tokenised as
`Keyword` in the same way as `async` is tokenised. This commit fixes that
mistake.
  • Loading branch information
nsfisis authored Oct 13, 2020
1 parent bb35b76 commit da6d96c
Showing 1 changed file with 1 addition 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 @@ -99,6 +99,7 @@ def macro_closed?
rule %r/[*\/!@~&+%^<>=\?-]|\.{2,3}/, Operator

rule %r/([.]\s*)?#{id}(?=\s*[(])/m, Name::Function
rule %r/[.]\s*await\b/, Keyword
rule %r/[.]\s*#{id}/, Name::Property
rule %r/[.]\s*\d+/, Name::Attribute
rule %r/(#{id})(::)/m do
Expand Down

0 comments on commit da6d96c

Please sign in to comment.