2009-09-11から1日間の記事一覧

prawn:Prawn::Document::Internals#add_content

まんま #!/usr/bin/env ruby require "prawn" pdf = Prawn::Document.new x1,y1,x2,y2 = 100,500,300,550 pdf.add_content("%.3f %.3f m" % [ x1, y1 ]) # move pdf.add_content("%.3f %.3f l" % [ x2, y2 ]) # draw path pdf.add_content("S") # stroke pdf…

Manual:Lexer:Limitations

まんま >>> from lepl import * >>> matchers = (Integer() | Literal('-'))[:] & Eos() >>> list(matchers.match('1-2')) [(['1', '-2'], ''), (['1', '-', '2'], '')] >>> tokens = (Token(Integer()) | Token(r'\-'))[:] & Eos() >>> list(tokens.match('…