[code] Update to DMD lexer

From: Brian Schott <briancschott.att.gmail.com>
Date: Sun, 25 May 2014 22:48:22 +0000

Summary: Add support for the "virtual" keyword that will be in the next
compiler release, and fix a bug where hex numbers with underscores were
not highlighted properly.

diff -r 8658359a348f lexers/dmd.lua
--- a/lexers/dmd.lua Fri May 16 15:00:03 2014 -0400
+++ b/lexers/dmd.lua Sun May 25 22:46:01 2014 +0000
@@ -34,9 +34,10 @@

  -- Numbers.
  local dec = l.digit^1 * ('_' * l.digit^1)^0
+local hex_num = l.hex_num * ('_' * l.xdigit^1)^0
  local bin_num = '0' * S('bB') * S('01_')^1
  local oct_num = '0' * S('01234567_')^1
-local integer = S('+-')^-1 * (l.hex_num + oct_num + bin_num + dec)
+local integer = S('+-')^-1 * (hex_num + oct_num + bin_num + dec)
  local number = token(l.NUMBER, (l.float + integer) * S('uUlLdDfFi')^-1)

  -- Keywords.
@@ -49,8 +50,8 @@
    'null', 'out', 'override', 'pragma', 'private', 'protected',
'public', 'pure',
    'ref', 'return', 'scope', 'shared', 'static', 'super', 'switch',
    'synchronized', 'this', 'throw','true', 'try', 'typeid', 'typeof',
'unittest',
- 'version', 'volatile', 'while', 'with', '__gshared', '__thread',
'__traits',
- '__vector', '__parameters'
+ 'version', 'virtual', 'volatile', 'while', 'with', '__gshared',
'__thread',
+ '__traits', '__vector', '__parameters'
  })

  -- Types.

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sun 25 May 2014 - 18:48:22 EDT

This archive was generated by hypermail 2.2.0 : Mon 26 May 2014 - 06:32:10 EDT