Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
Fix lexing of await in Rust lexer (rouge-ruby#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 and mattt committed May 19, 2021
1 parent aac560f commit c5ef46e
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 c5ef46e

Please sign in to comment.