changeset 105:f1be2d5abc8a

fix camel2snake
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Thu, 21 Nov 2019 14:45:01 +0900
parents 9bfc4fbb5502
children 547c20b052dc
files src/gearsTools/trans_impl.pl src/impl/PipeRead.cbc
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gearsTools/trans_impl.pl	Wed Nov 20 20:15:12 2019 +0900
+++ b/src/gearsTools/trans_impl.pl	Thu Nov 21 14:45:01 2019 +0900
@@ -59,6 +59,7 @@
     $instance_inter = $1;
   }
   my $instance_impl = lcfirst $impl_ir->{name};
+  $instance_impl =~ s/([A-Z])/_\l$1/g;
 
   print $out <<"EOF";
 $impl_ir->{isa}* create$impl_ir->{name}(struct Context* cbc_context) {
@@ -97,6 +98,7 @@
     $instance_inter = $1;
   }
   my $instance_impl = lcfirst $impl_ir->{name};
+  $instance_impl =~ s/([A-Z])/_\l$1/g;
   my $data_gear_types = {};
 
   for my $code_ir (@{$inter_ir->{codes}}) {
--- a/src/impl/PipeRead.cbc	Wed Nov 20 20:15:12 2019 +0900
+++ b/src/impl/PipeRead.cbc	Thu Nov 21 14:45:01 2019 +0900
@@ -11,9 +11,9 @@
 
 SysRead* createPipeRead(struct Context* cbc_context) {
     struct SysRead* sys_read  = new SysRead();
-    struct PipeRead* pipeRead = new PipeRead();
-    sys_read->sys_read = (union Data*)pipeRead;
-    pipeRead->num = NULL;
+    struct PipeRead* pipe_read = new PipeRead();
+    sys_read->sys_read = (union Data*)pipe_read;
+    pipe_read->num = NULL;
     sys_read->read = C_readPipeRead;
     sys_read->ret = C_retPipeRead;
     sys_read->next = C_nextPipeRead;