lib/qlang/lexer/wrap_lexer.rb in qlang-0.0.14142135 vs lib/qlang/lexer/wrap_lexer.rb in qlang-0.0.27000000
- old
+ new
@@ -1,11 +1,17 @@
+require 'pry'
module Qlang
module Lexer
class WrapLexer < Base
- rule(/[fgh]\(\w( ?, ?\w)*\) ?= ?[^\r\n]+/) { :FUNC }
- rule(/[fgh]\( ?\d( *, *\d)* *\)/) { :EFUNC }
- rule(/S *\(.+\)\[.+\]/) { :ITGL }
- rule(/d\/d[a-zA-Z] .*/) { :DIFF }
+ rule(%r@#{FUNCCV}#{ANYSP}=#{ANYSP}#{NONL}+@) { :def_func }
+ rule(%r@#{FUNCCN}@) { :eval_func }
+ rule(/S#{ANYSP}#{LPRN}#{ANYSTR}#{RPRN}\[#{ANYSTR}\]/) { :integral }
+ rule(/d\/d#{VAR} .*/) { :differential }
+ rule(%r@#{LPRN}#{NUMS_BY_SP}#{RPRN}@) { :vector }
+ rule(%r@#{LPRN}#{NUMS_BY_SP_BY_SCLN}#{RPRN}t@) { :tmatrix }
+ rule(%r@#{LPRN}#{NUMS_BY_SP_BY_SCLN}#{RPRN}@) { :matrix }
+
+
rule(/\(/) { :LPRN }
rule(/\)/) { :RPRN }
rule(/\{/) { :LBRC }
rule(/\}/) { :RBRC }