File: strscan.rb

package info (click to toggle)
libstrscan-ruby 0.6.7-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 152 kB
  • ctags: 327
  • sloc: ruby: 1,117; ansic: 670; makefile: 119
file content (36 lines) | stat: -rw-r--r-- 782 bytes parent folder | download
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
35
36
#
# strscan.rb
#
# Copyright (c) 1999-2003 Minero Aoki <aamine@loveruby.net>
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU General Public License version 2 or later.
#

unless defined? ScanError then
  class ScanError < StandardError; end
end

require 'rscan.rb'
begin
  require 'cscan.so'
  StringScanner = StringScanner_C
  class StringScanner
    Revision_C = Id_C.split[2]
    Id = Id_C
    Version = Version_C
    Revision = Revision_C
    Version_R = StringScanner_R::Version_R
    Revision_R = StringScanner_R::Revision_R
  end
rescue LoadError
  StringScanner = StringScanner_R
  class StringScanner
    Id = Id_R
    Version = Version_R
    Revision = Revision_R
    Version_C = nil
    Revision_C = nil
  end
end