Created
October 7, 2011 08:28
-
-
Save blambeau/1269769 to your computer and use it in GitHub Desktop.
Wlang dialect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'wlang' | |
$vars = [] | |
dialect = WLang::dialect do | |
rule "#" do |parser, offset| | |
varname, reached = parser.parse(offset) | |
$vars << varname | |
["#{varname}", reached] | |
end | |
end | |
src = "SELECT * FROM #{table}" | |
context = {} | |
WLang::instantiate(src, context, dialect) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment