Module: LangScan::Autoconf

Defined in:
lib/langscan/autoconf.rb

Constant Summary collapse

Pattern =
[[:comment, "#.*"],
[:string, "\"", "\""],
[:string, "'", "'"],
[:integer, "\\d+"],
[:ident, "\\w+"],
[:keyword, "AC_\\w+"]]
Types =
[]
Keywords =
%w(
  if then else elif fi continue for in do done case esac exit
)

Class Method Summary collapse

Class Method Details

.abbrevObject



21
22
23
# File 'lib/langscan/autoconf.rb', line 21

def abbrev
  "autoconf"
end

.extnamesObject



25
26
27
# File 'lib/langscan/autoconf.rb', line 25

def extnames
  [".ac"]
end

.nameObject



17
18
19
# File 'lib/langscan/autoconf.rb', line 17

def name
  "Autoconf"
end

.scan(input, &block) ⇒ Object

LangScan::Autoconf.scan iterates over autoconf file. It yields for each Fragment.



44
45
46
47
# File 'lib/langscan/autoconf.rb', line 44

def scan(input, &block)
  scanner = EasyScanner.new(Pattern, Types, Keywords)
  scanner.scan(input, &block)
end