File: atomic_expression.rb

package info (click to toggle)
ruby-treetop 1.6.14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 956 kB
  • sloc: ruby: 8,918; makefile: 5
file content (14 lines) | stat: -rw-r--r-- 323 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Treetop
  module Compiler
    class AtomicExpression < ParsingExpression
      def inline_modules
        []
      end
      
      def single_quote(string)
        # Double any backslashes, then backslash any single-quotes:
        "'#{string.gsub(/\\/) { '\\\\' }.gsub(/'/) { "\\'"}}'"
      end
    end
  end
end