require "hemingway/block/block_nodes" require "hemingway/block/list/list" require "hemingway/block/verbatim/verbatim" require "hemingway/block/quote/quote" module Hemingway grammar Block include List include Verbatim include Quote # Example: # \begin{itemize} # \item[Chewbacca] Wookie # \item[Han] Smuggler # \item[Anakin] Savant # \end{itemize} rule block ( block_start type:list_type "}" whitespace content:list whitespace block_end list_type "}" &{ |seq| seq[1].text_value == seq[7].text_value } / block_start type:verbatim_type "}" whitespace content:verbatim whitespace block_end verbatim_type "}" / block_start type:quote_type "}" whitespace content:quote_entry whitespace block_end quote_type "}" ) end rule block_start "\\begin{" end rule block_end "\\end{" end end end