Skip to content

Commit 77d2a4b

Browse files
committed
\c is suppose to support control codes too
1 parent 5c9ffcf commit 77d2a4b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/HLL/Actions.nqp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ class HLL::Actions {
211211
}
212212

213213
method charspec($/) {
214-
make $<charnames> ?? $<charnames>.made !! nqp::chr(self.string_to_int( $/, 10 ));
214+
make $<charnames>
215+
?? $<charnames>.made
216+
!! nqp::chr($<control>
217+
?? nqp::ord($<control>) +^ 64
218+
!! self.string_to_int( $/, 10 )
219+
);
215220
}
216221
}

src/HLL/Grammar.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ grammar HLL::Grammar {
121121
[
122122
| '[' <charnames> ']'
123123
| \d+ [ _ \d+]*
124-
| <[ ?..Z ]>
124+
| <control=[ ?..Z ]>
125125
| <.panic: 'Unrecognized \\c character'>
126126
]
127127
}

0 commit comments

Comments
 (0)