| Class | Ritex::Parser |
| In: |
lib/ritex.rb
lib/ritex/parser.rb |
| Parent: | Racc::Parser |
| FORMATS | = | [:mathml, :raw] |
| Racc_arg | = | [ racc_action_table, racc_action_check, racc_action_default, racc_action_pointer, racc_goto_table, racc_goto_check, racc_goto_default, racc_goto_pointer, racc_nt_base, racc_reduce_table, racc_token_table, racc_shift_n, racc_reduce_n, racc_use_result_var ] |
| Racc_token_to_s_table | = | [ "$end", "error", "NUMBER", "VAR", "SYMBOL", "FUNC0", "FUNC1", "FUNC2", "FUNC3", "MACRO0", "MACRO1", "MACRO2", "MACRO3", "ENV", "DOUBLEBACK", "DEFINE", "LEFT", "RIGHT", "ARRAY", "ARRAYOPTS", "ROWOPTS", "CELLOPTS", "COLALIGN", "ROWALIGN", "ALIGN", "PADDING", "EQUALCOLS", "EQUALROWS", "ROWLINES", "COLLINES", "FRAME", "ROWSPAN", "COLSPAN", "SPACE", "OPERATOR", "\"-\"", "\"^\"", "\"_\"", "\"{\"", "\"}\"", "\".\"", "\"[\"", "\"]\"", "\"&\"", "\",\"", "\";\"", "\":\"", "\"<\"", "\">\"", "\"=\"", "\"#\"", "\"!\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"|\"", "$start", "exp", "atom", "nontoken", "subsup", "symbol", "func", "macro", "arg", "array", "macrodef", "delim", "token", "string", "stringel", "escapeme", "rawtoken", "rawdelimtoken", "symspec", "arrayopts", "ainnards", "arrayoptsinnards", "arow", "arow1", "acell", "cellopts", "celloptsinnards" ] |
| Racc_debug_parser | = | false |
| format | [R] | |
| merror | [RW] |
If true, Ritex will output a
|
Parse a string. Returns the MathML output in string form. Note that macro definitions are cumulative and persistent across calls to parse. If you don’t want this behavior, you must explicitly call flush_macros after every parse call.
opts is a hash of options:
nowrap, if true, will omit wrapping the output in a top-level XML math tag. Only useful if you’re generating these tags yourself.
display, if true, emits display markup, as opposed to inline markup. For mathml output this only has an effect if nowrap is true.