Sha256: 79d0eb82ffc808bd5b4a50801232c0ae57a6867616166158e5c36bf0a58e1b79

Contents?: true

Size: 430 Bytes

Versions: 5

Compression:

Stored size: 430 Bytes

Contents

module Qlang
  module Parser
    module MatrixParser
      include Base
      def execute(lexed_string, trans: false)
        lexed_string.rms!(')','(', 't')
        rows = lexed_string.split(/ *; */).map(&:split_by_sp)
        rows.all? { |row| row.count == rows.first.count }
        if trans
          rows = rows.transpose
        end
        MatrixApi.execute(rows)
      end
      module_function :execute
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
qlang-0.0.27182000 lib/qlang/parser/matrix_parser.rb
qlang-0.0.27180000 lib/qlang/parser/matrix_parser.rb
qlang-0.0.27100000 lib/qlang/parser/matrix_parser.rb
qlang-0.0.27000000 lib/qlang/parser/matrix_parser.rb
qlang-0.0.27 lib/qlang/parser/matrix_parser.rb