lib/hilbert/parser/formula_parser.rb in hilbert-0.0.2700410 vs lib/hilbert/parser/formula_parser.rb in hilbert-0.0.2700420
- old
+ new
@@ -7,10 +7,19 @@
def self.execute(str)
lexed = Lexer::FormulaLexer.new(str)
time = Time.now
loop do
- fail "I'm so sorry, something wrong. Please feel free to report this. [DEBUGG CODE31]" if Time.now > time + 10
+ if Time.now > time + 10
+ fail <<-ERROR
+I'm so sorry, something wrong. Please feel free to report this. [DEBUG CODE31]
+
+========== DEBUG INFO ==========
+str: #{str}
+lexed.token_str: #{lexed.token_str}
+
+ERROR
+ end
case lexed.token_str
when /:EXP(\d+)/
new_ope = $meta_info.lang == :ruby ? '**' : '^'
lexed.parsed!(new_ope, $1)
when /:MUL(\d+)/