Prolog (SWI), 116 bytes
It worked out to be shorter to write directly to stdout inside the predicate. The more idiomatic way of implementing something like this in Prolog would be to have third parameter for the predicate which would be the output from interpreting the program.
+A:-string_codes(A,B),0+B. A+[E|T]:-E=35,!,C is A mod 127,char_code(D,C),write(D),0+T;E=59,!,B is A+1,B+T;A+T. _+[].