Skip to content

Commit 3efb553

Browse files
committed
PM_SOURCE_ENCODING_NODE
1 parent a24077a commit 3efb553

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

include/mrc_presym.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ MRC_SYM_1(call, 25)
2727
MRC_SYM_1(Kernel, 26)
2828
MRC_SYM_1(Regexp, 27)
2929
MRC_SYM_1(compile, 28)
30-
MRC_SYM_2(nil_p, nil?,29)
31-
MRC_SYM_2(back_ref, $+, 30)
30+
MRC_SYM_1(__ENCODING__, 29)
31+
MRC_SYM_2(nil_p, nil?,30)
32+
MRC_SYM_2(back_ref, $+, 31)

src/codegen_prism.inc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,6 +2823,17 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
28232823
}
28242824
break;
28252825
}
2826+
case PM_SOURCE_ENCODING_NODE:
2827+
{
2828+
genop_3(s, OP_SSEND, cursp(), new_sym(s, MRC_SYM_1(__ENCODING__)), 0);
2829+
push();
2830+
{ // Workaround: increase nregs in case __ENCODING__ called alone
2831+
// (maybe it is a useless use of a literal in void context)
2832+
push();
2833+
pop();
2834+
}
2835+
break;
2836+
}
28262837
default:
28272838
{
28282839
char buf[256];

0 commit comments

Comments
 (0)