@@ -65,10 +65,6 @@ def scan_tokens encoder, options
65
65
elsif match = scan ( %r! // [^\n \\ ]* (?: \\ . [^\n \\ ]* )* | /\* (?: .*? \* / | .* ) !mx )
66
66
encoder . text_token match , :comment
67
67
68
- elsif match = scan ( / \# \s * if \s * 0 /x )
69
- match << scan_until ( / ^\# (?:elif|else|endif) .*? $ | \z /xm ) unless eos?
70
- encoder . text_token match , :comment
71
-
72
68
elsif match = scan ( / [-+*=<>?:;,!&^|()\[ \] {}~%]+ | \/ =? | \. (?!\d ) /x )
73
69
label_expected = match =~ /[;\{ \} ]/
74
70
if case_expected
@@ -93,9 +89,6 @@ def scan_tokens encoder, options
93
89
end
94
90
encoder . text_token match , kind
95
91
96
- elsif match = scan ( /\$ / )
97
- encoder . text_token match , :ident
98
-
99
92
elsif match = scan ( /L?"/ )
100
93
encoder . begin_group :string
101
94
if match [ 0 ] == ?L
@@ -105,6 +98,10 @@ def scan_tokens encoder, options
105
98
encoder . text_token match , :delimiter
106
99
state = :string
107
100
101
+ elsif match = scan ( / \# \s * if \s * 0 /x )
102
+ match << scan_until ( / ^\# (?:elif|else|endif) .*? $ | \z /xm ) unless eos?
103
+ encoder . text_token match , :comment
104
+
108
105
elsif match = scan ( /#[ \t ]*(\w *)/ )
109
106
encoder . text_token match , :preprocessor
110
107
in_preproc_line = true
@@ -115,6 +112,9 @@ def scan_tokens encoder, options
115
112
label_expected = false
116
113
encoder . text_token match , :char
117
114
115
+ elsif match = scan ( /\$ / )
116
+ encoder . text_token match , :ident
117
+
118
118
elsif match = scan ( /0[xX][0-9A-Fa-f]+/ )
119
119
label_expected = false
120
120
encoder . text_token match , :hex
0 commit comments