summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-09-08 01:20:43 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-09-08 01:20:43 +0900
commit89e9df26819b9555fb790a16662f4ad2b9cbb2e2 (patch)
tree22aab88afbb6e0a861d5f496c4efc23b205f4cfe /src/parse.y
parentcc98f191fad94409fa4a6edef0c788fb45c82587 (diff)
downloadmruby-89e9df26819b9555fb790a16662f4ad2b9cbb2e2.tar.gz
mruby-89e9df26819b9555fb790a16662f4ad2b9cbb2e2.zip
fixed wandering filename problem
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y
index e77085332..00d784d81 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -62,7 +62,12 @@ typedef unsigned int stack_type;
#define CMDARG_P() BITSTACK_SET_P(p->cmdarg_stack)
#define SET_LINENO(c,n) ((c)->lineno = (n))
-#define NODE_LINENO(c,n) do {if (n) ((c)->lineno = (n)->lineno);} while (0)
+#define NODE_LINENO(c,n) do {\
+ if (n) {\
+ (c)->filename_index = (n)->filename_index;\
+ (c)->lineno = (n)->lineno;\
+ }\
+} while (0)
#define sym(x) ((mrb_sym)(intptr_t)(x))
#define nsym(x) ((node*)(intptr_t)(x))