lib/plurimath/latex/parse.rb in plurimath-0.8.12 vs lib/plurimath/latex/parse.rb in plurimath-0.8.13
- old
+ new
@@ -2,11 +2,11 @@
require "parslet"
module Plurimath
class Latex
class Parse < Parslet::Parser
- rule(:base) { arr_to_expression(Constants.wrapper_symbols, :symbols).absent? >> str("_") }
+ rule(:base) { str("_") }
rule(:power) { str("^") }
rule(:slash) { str("\\") }
rule(:under_over) { slash >> underover_classes }
rule(:array_args) { (str("{") >> expression.as(:args) >> str("}")) }
rule(:array_begin) { (str("\\begin{") >> str("array").as(:environment) >> str("}")) }
@@ -205,10 +205,10 @@
first_value = str(expr.to_s)
case name
when :operant
(first_value.as(:operant) | (slashed_value(first_value, :symbols)))
when :symbols
- expr.to_s.start_with?("__{") ? first_value.as(name) : slashed_value(first_value, :symbols)
+ slashed_value(first_value, :symbols)
when :unary
unary_rules(first_value)
when :fonts
(slashed_value(first_value, :fonts) >> (binary_functions | intermediate_exp).as(:intermediate_exp))
when :power_base