File: node.rb

package info (click to toggle)
mikutter 5.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,780 kB
  • sloc: ruby: 22,912; sh: 186; makefile: 21
file content (34 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-


module MIKU
  module Node
    def miku_eval_another(symtable, node)
      if(node.is_a? Node) then
        node.miku_eval(symtable)
      else
        node
      end
    end
  end

  module StaticCode
    attr_accessor :staticcode_line, :staticcode_file

    def staticcode_copy_info(src)
      if src.is_a? Array
      @staticcode_line = src[0]
      @staticcode_file = src[1]
      else
        @staticcode_line = src.staticcode_line
        @staticcode_file = src.staticcode_file end
      self end

    def staticcode_dump
      [@staticcode_file, @staticcode_line] end

    def self.extended(obj)
      obj.staticcode_line = 1
      obj.staticcode_file = 'runtime-code' end end

end