Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created February 10, 2016 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewVos/6bd9bc888013f1e7e629 to your computer and use it in GitHub Desktop.
Save AndrewVos/6bd9bc888013f1e7e629 to your computer and use it in GitHub Desktop.
ast = ASTObject.new
ast.scope = OpenStruct.new(page: page, pages: pages)
ast.text = text
current = ast
first = (current.text =~ /\{\{[#\/].*\}\}/)
if first
match = $&
current.text = $`
new = ASTObject.new
new.text = $'
current.nodes << new
end
binding.pry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment