@@ -13,9 +13,6 @@ class E < Scanner
13
13
file_extension 'e'
14
14
title 'e'
15
15
16
- # TODO: 0b0101
17
- # TODO: -- I am a comment
18
- # TODO: 0x0000_0FFF
19
16
# TODO: DUT'unique_name
20
17
21
18
KEYWORDS = [
@@ -68,6 +65,8 @@ def scan_tokens encoder, options
68
65
69
66
elsif match = scan ( %r! // [^\n \\ ]* (?: \\ . [^\n \\ ]* )* | /\* (?: .*? \* / | .* ) !mx )
70
67
encoder . text_token match , :comment
68
+ elsif match = scan ( %r! -- [^\n \\ ]* (?: \\ . [^\n \\ ]* )* !mx )
69
+ encoder . text_token match , :comment
71
70
72
71
elsif match = scan ( / \# \s * if \s * 0 /x )
73
72
match << scan_until ( / ^\# (?:elif|else|endif) .*? $ | \z /xm ) unless eos?
@@ -121,14 +120,18 @@ def scan_tokens encoder, options
121
120
label_expected = false
122
121
encoder . text_token match , :char
123
122
124
- elsif match = scan ( /0[xX][0-9A -Fa-f]+/ )
123
+ elsif match = scan ( /0[xX][0-9_A -Fa-f]+/ )
125
124
label_expected = false
126
125
encoder . text_token match , :hex
127
126
128
127
elsif match = scan ( /(?:0[0-7]+)(?![89.eEfF])/ )
129
128
label_expected = false
130
129
encoder . text_token match , :octal
131
130
131
+ elsif match = scan ( /0[b][0-9_]+/ )
132
+ label_expected = false
133
+ encoder . text_token match , :binary
134
+
132
135
elsif match = scan ( /(?:\d +)(?![.eEfF])L?L?/ )
133
136
label_expected = false
134
137
encoder . text_token match , :integer
0 commit comments