hilbert 0.0.2700000 → 0.0.2700001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +5 -13
  2. data/README.md +16 -16
  3. data/Rakefile +2 -2
  4. data/bin/{qlang → hilbert} +6 -6
  5. data/ext/hilbert/extconf.rb +3 -0
  6. data/ext/{qlang/qlang.c → hilbert/hilbert.c} +2 -2
  7. data/{qlang.gemspec → hilbert.gemspec} +3 -3
  8. data/legacy_rspec/objects/list_spec.rb +1 -1
  9. data/legacy_rspec/objects/matrix_spec.rb +1 -1
  10. data/legacy_rspec/objects/vector_spec.rb +1 -1
  11. data/lib/{qlang → hilbert}/api/func_api.rb +1 -1
  12. data/lib/{qlang → hilbert}/api/integral_api.rb +1 -1
  13. data/lib/{qlang → hilbert}/api/limit_api.rb +1 -1
  14. data/lib/{qlang → hilbert}/api/list_api.rb +1 -1
  15. data/lib/{qlang → hilbert}/api/matrix_api.rb +1 -1
  16. data/lib/{qlang → hilbert}/api/sigma_api.rb +1 -1
  17. data/lib/{qlang → hilbert}/api/vector_api.rb +1 -1
  18. data/lib/hilbert/api.rb +23 -0
  19. data/lib/{qlang → hilbert}/exec.rb +5 -5
  20. data/lib/{qlang → hilbert}/iq.rb +1 -1
  21. data/lib/{qlang → hilbert}/lexer/base.rb +2 -2
  22. data/lib/{qlang → hilbert}/lexer/formula_lexer.rb +1 -1
  23. data/lib/{qlang → hilbert}/lexer/main_lexer.rb +1 -1
  24. data/lib/{qlang → hilbert}/lexer/tokens.rb +1 -1
  25. data/lib/{qlang → hilbert}/lexer.rb +3 -3
  26. data/lib/{qlang → hilbert}/meta_info.rb +1 -1
  27. data/lib/{qlang → hilbert}/parser/base.rb +2 -2
  28. data/lib/{qlang → hilbert}/parser/formula_parser.rb +2 -2
  29. data/lib/{qlang → hilbert}/parser/func_parser.rb +2 -2
  30. data/lib/{qlang → hilbert}/parser/integral_parser.rb +1 -1
  31. data/lib/{qlang → hilbert}/parser/limit_parser.rb +1 -1
  32. data/lib/{qlang → hilbert}/parser/list_parser.rb +1 -1
  33. data/lib/{qlang → hilbert}/parser/matrix_parser.rb +1 -1
  34. data/lib/{qlang → hilbert}/parser/sigma_parser.rb +1 -1
  35. data/lib/{qlang → hilbert}/parser/vector_parser.rb +1 -1
  36. data/lib/{qlang → hilbert}/parser.rb +24 -31
  37. data/lib/hilbert/version.rb +3 -0
  38. data/lib/{qlang.rb → hilbert.rb} +7 -7
  39. data/test/internal/test_tokens.rb +1 -1
  40. data/test/interpreter/base.rb +4 -4
  41. data/test/interpreter/test_limit.rb +1 -1
  42. data/test/minitest_helper.rb +1 -1
  43. data/test/q_matrix/test_q_matrix.rb +2 -2
  44. data/test/test_qlang.rb +3 -3
  45. metadata +51 -51
  46. data/ext/qlang/extconf.rb +0 -3
  47. data/lib/qlang/api.rb +0 -23
  48. data/lib/qlang/version.rb +0 -3
  49. /data/ext/{qlang → hilbert}/QMatrix/q_matrix.c +0 -0
  50. /data/ext/{qlang/qlang.h → hilbert/hilbert.h} +0 -0
  51. /data/lib/{qlang → hilbert}/utils/langs.yml +0 -0
  52. /data/lib/{qlang → hilbert}/utils/ruby_ext.rb +0 -0
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWNmNzJhODczNmNmYTAzZTEwZDMzMzAwMzY3YjYyODk1MGZkZTQzYg==
5
- data.tar.gz: !binary |-
6
- NzY5Mjc1OWIyMjcyNDczZGYzZTljN2UyMDNjMzViMTVjZWQzN2U4Mw==
2
+ SHA1:
3
+ metadata.gz: 8fd42993b7f3a7468a22b3a27c87106933b2d103
4
+ data.tar.gz: 63692355f00bae1ba2f6e64b18dc68430246d82b
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZjUzYzk2MWFjNzk5NmJkMzExNTk0YzM2ZDU1N2QzODZiZGNkOTQ3OWQwNTg3
10
- YWY4MDA4YzZiYmQ4NjZkYmM1NmY2MzM4Y2I3NmQyZmE4MWJhZjlmYTZiZDU2
11
- Y2Y1NWYxODdiMjFjMjZkMWQ2YWQ0Njc1NTUzNGVjYmNkODQ1OGY=
12
- data.tar.gz: !binary |-
13
- ZjNmMTBlZGMxNzc5OGQzNTVmOTg3MzAwYWNlOWJjMzNjMjkzZWYwN2U1Zjkz
14
- NDVmZDQxODFlYzU1YzJjMmI5NjliOTI0MzM3YTM3NjdmZmFhYjU4M2NmZDc5
15
- YTEzYzRmMWQxMjY3YzFjMGI5YzY2ZDA3MjdhYTIwNTgwMGVkZjI=
6
+ metadata.gz: a10b5ce2eb9dc7a5ed093136b0a93f9c71b9efc6c942abe95664344127a7dc6641c7f4785504211d3acbb2cb3e5e3a8a540c0d252331223fb4c419dded3c0e52
7
+ data.tar.gz: 5ba9c0c6320dc87989ef4979d0ab89c783006843b0cd9db6bd881710a46c1c374225b2a788253ff5aa5e60591f7312d5c2dc179565db241acbf040f605659787
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Qlang
1
+ # Hilbert
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/qlang.svg)](http://badge.fury.io/rb/qlang) [![Build Status](https://travis-ci.org/gogotanaka/Q.svg?branch=master)](https://travis-ci.org/gogotanaka/Q) [![Coverage Status](https://coveralls.io/repos/gogotanaka/Q/badge.png?branch=master)](https://coveralls.io/r/gogotanaka/Q?branch=master) [![Code Climate](https://codeclimate.com/github/gogotanaka/Q/badges/gpa.svg)](https://codeclimate.com/github/gogotanaka/Q) [![Dependency Status](https://gemnasium.com/gogotanaka/Q.svg)](https://gemnasium.com/gogotanaka/Q)
3
+ [![Gem Version](https://badge.fury.io/rb/hilbert.svg)](http://badge.fury.io/rb/hilbert) [![Build Status](https://travis-ci.org/gogotanaka/Q.svg?branch=master)](https://travis-ci.org/gogotanaka/Q) [![Coverage Status](https://coveralls.io/repos/gogotanaka/Q/badge.png?branch=master)](https://coveralls.io/r/gogotanaka/Q?branch=master) [![Code Climate](https://codeclimate.com/github/gogotanaka/Q/badges/gpa.svg)](https://codeclimate.com/github/gogotanaka/Q) [![Dependency Status](https://gemnasium.com/gogotanaka/Q.svg)](https://gemnasium.com/gogotanaka/Q)
4
4
 
5
5
  ## Do you know the one best language in this world?
6
6
 
@@ -8,23 +8,23 @@
8
8
 
9
9
  ## How can we deal something as great as mathematics in a discrete world?
10
10
 
11
- #### Q-language is the answer.
11
+ #### Hilbert is the answer.
12
12
 
13
- Q lets you have a sense of mathematics using a keyboard, the same as you would with a pen.
13
+ Hilbert lets you have a sense of mathematics using a keyboard, the same as you would with a pen.
14
14
 
15
15
  ```
16
16
  +---Discrete world---+ +------Mathematics-------+
17
17
  | Ruby | | axiom |
18
- | TeX |<------ Q ------>| Uncountable noun |
18
+ | TeX |<---- Hilbert ---->| Uncountable noun |
19
19
  | Python | | real number topology |
20
20
  +--------------------+ +------------------------+
21
21
  ```
22
22
 
23
23
  ## Demo
24
24
 
25
- The code below is input and output for the q-lang interpreter
25
+ The code below is input and output for the Hilbert interpreter
26
26
 
27
- (you can try it by `qlang -i`)
27
+ (you can try it by `hilbert -i`)
28
28
 
29
29
  ### Differentiate
30
30
 
@@ -96,28 +96,28 @@ f(1, 2)
96
96
 
97
97
  ## How to use
98
98
 
99
- Install qlang gem.
99
+ Install hilbert gem.
100
100
 
101
- $ gem install qlang
101
+ $ gem install hilbert
102
102
 
103
103
  ## Interpreter
104
104
 
105
- $ qlang -i
106
- Q:->
105
+ $ hilbert -i
106
+ Hilbert:->
107
107
 
108
108
  ## Use as native language
109
109
 
110
110
  ### Compile into R
111
111
 
112
- $ qlang -r foo.q
112
+ $ hilbert -r foo.hr
113
113
 
114
114
  ### Compile into Ruby
115
115
 
116
- $ qlang -rb foo.q
116
+ $ hilbert -rb foo.hr
117
117
 
118
118
  ### Compile into Python
119
119
 
120
- $ qlang -py foo.q
120
+ $ hilbert -py foo.hr
121
121
 
122
122
 
123
123
  ## Use as math template within other langs
@@ -131,14 +131,14 @@ class ExampleClass
131
131
 
132
132
  I love mathematics.
133
133
  a = (1 3 4)
134
- # your Q codes
134
+ # your Hilbert codes
135
135
  Q.E.D
136
136
 
137
137
  end
138
138
  end
139
139
  ```
140
140
 
141
- $ qlang -rb example.rb
141
+ $ hilbert -rb example.rb
142
142
 
143
143
 
144
144
  ```rb
data/Rakefile CHANGED
@@ -8,8 +8,8 @@ end
8
8
 
9
9
  require 'rake/extensiontask'
10
10
 
11
- Rake::ExtensionTask.new('qlang') do |ext|
12
- ext.lib_dir = 'lib/qlang'
11
+ Rake::ExtensionTask.new('hilbert') do |ext|
12
+ ext.lib_dir = 'lib/hilbert'
13
13
  end
14
14
 
15
15
  task :compile_and_test do
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'qlang'
3
+ require 'hilbert'
4
4
 
5
5
  # Q command line
6
- require 'qlang/exec'
6
+ require 'hilbert/exec'
7
7
 
8
8
  # Q interpreter
9
- require 'qlang/iq'
9
+ require 'hilbert/iq'
10
10
 
11
11
  # TODO: There are vanch of todo ..
12
12
  case ARGV.first
@@ -15,15 +15,15 @@ when '-i'
15
15
  print 'Q:-> '
16
16
  begin
17
17
  input = $stdin.gets
18
- output = Qlang::Iq.execute(input)
18
+ output = Hilbert::Iq.execute(input)
19
19
  $stdout.puts output
20
20
  rescue => e
21
21
  puts e
22
22
  end
23
23
  end
24
24
  when '-v'
25
- puts Qlang::VERSION
25
+ puts Hilbert::VERSION
26
26
  when '-r', '-rb', '-py'
27
- exec = Qlang::Exec::Compiler.new(ARGV)
27
+ exec = Hilbert::Exec::Compiler.new(ARGV)
28
28
  exec.output!
29
29
  end
@@ -0,0 +1,3 @@
1
+ require 'mkmf'
2
+
3
+ create_makefile('hilbert/hilbert')
@@ -1,4 +1,4 @@
1
- #include "qlang.h"
1
+ #include "hilbert.h"
2
2
  #include <stdio.h>
3
3
  #define Need_Float(x) do {if (!RB_TYPE_P(x, T_FLOAT)) {(x) = rb_to_float(x);}} while(0)
4
4
  #define GET_FLOAT(x) Need_Float(x);(x) = RFLOAT_VALUE(x)
@@ -49,7 +49,7 @@ execute(VALUE self, VALUE a, VALUE b, VALUE n)
49
49
 
50
50
 
51
51
  void
52
- Init_qlang(void)
52
+ Init_hilbert(void)
53
53
  {
54
54
  VALUE rb_mQMatrix = rb_define_class("QMatrix", rb_cObject);
55
55
  rb_define_method(rb_mQMatrix, "execute", execute, 3);
@@ -1,14 +1,14 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'qlang/version'
4
+ require 'hilbert/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'hilbert'
8
- spec.version = Qlang::VERSION
8
+ spec.version = Hilbert::VERSION
9
9
  spec.authors = ['gogotanaka']
10
10
  spec.email = ['mail@tanakakazuki.com']
11
- spec.extensions = ['ext/qlang/extconf.rb']
11
+ spec.extensions = ['ext/hilbert/extconf.rb']
12
12
  spec.summary = %q{Enjoy MATH!}
13
13
  spec.description = %q{Enjoy MATH!}
14
14
  spec.homepage = 'http://q-language.org/'
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Qlang do
3
+ describe Hilbert do
4
4
  describe 'List' do
5
5
  it do
6
6
  # expect(
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Qlang do
3
+ describe Hilbert do
4
4
  describe 'Matrix' do
5
5
  context 'into R' do
6
6
  it do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Qlang do
3
+ describe Hilbert do
4
4
  describe 'Vector' do
5
5
  context 'into R' do
6
6
  it do
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Api
3
3
  module FuncApi
4
4
  def execute(func_name, args, contents)
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Api
3
3
  module IntegralApi
4
4
  def execute(func, delta, range)
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Api
3
3
  module LimitApi
4
4
  def self.execute(formula, var, close_to)
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Api
3
3
  module ListApi
4
4
  def execute(arys)
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Api
3
3
  module MatrixApi
4
4
  def execute(rows)
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Api
3
3
  module SigmaApi
4
4
  def self.execute(formula, var, from, to)
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Api
3
3
  module VectorApi
4
4
  def execute(nums)
@@ -0,0 +1,23 @@
1
+ require 'hilbert/api/matrix_api'
2
+ require 'hilbert/api/vector_api'
3
+ require 'hilbert/api/list_api'
4
+ require 'hilbert/api/func_api'
5
+ require 'hilbert/api/integral_api'
6
+ require 'hilbert/api/limit_api'
7
+ require 'hilbert/api/sigma_api'
8
+
9
+ module Hilbert
10
+ module Api
11
+ class ::Matrix
12
+ def to_q
13
+ rows.map(&:join_by_sp).join('; ').parentheses
14
+ end
15
+ end
16
+
17
+ class ::Vector
18
+ def to_q
19
+ elements.join_by_sp.parentheses
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Exec
3
3
  class Compiler
4
4
  def initialize(args)
@@ -26,11 +26,11 @@ module Qlang
26
26
  def ch_compile_type(lang)
27
27
  case lang
28
28
  when '-rb'
29
- Qlang.to_ruby
29
+ Hilbert.to_ruby
30
30
  when '-r'
31
- Qlang.to_r
31
+ Hilbert.to_r
32
32
  when '-py'
33
- Qlang.to_python
33
+ Hilbert.to_python
34
34
  else
35
35
  print 'Q support only Ruby and R now.'
36
36
  end
@@ -41,7 +41,7 @@ module Qlang
41
41
  input_string = read_file(file)
42
42
  file.close
43
43
  input_string.gsub(/(.*)I love mathematics\.(.*)Q\.E\.D(.*)/m) {
44
- "#{$1}#{Kconv.tosjis(Qlang.compile($2))}#{$3}"
44
+ "#{$1}#{Kconv.tosjis(Hilbert.compile($2))}#{$3}"
45
45
  }
46
46
  end
47
47
 
@@ -1,7 +1,7 @@
1
1
  require 'dydx'
2
2
  include Dydx
3
3
 
4
- module Qlang
4
+ module Hilbert
5
5
  module Iq
6
6
  class Dydx::Algebra::Formula
7
7
  # FIX:
@@ -1,7 +1,7 @@
1
1
  require 'strscan'
2
- require 'qlang/lexer/tokens'
2
+ require 'hilbert/lexer/tokens'
3
3
 
4
- module Qlang
4
+ module Hilbert
5
5
  module Lexer
6
6
  class Base
7
7
  attr_accessor :lexeds
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Lexer
3
3
  class FormulaLexer < Base
4
4
  rule(/\^/) { :EXP }
@@ -1,7 +1,7 @@
1
1
  #!/bin/env ruby
2
2
  # encoding: utf-8
3
3
 
4
- module Qlang
4
+ module Hilbert
5
5
  module Lexer
6
6
  class MainLexer < Base
7
7
  rule(/(#{FUNCCV})#{ANYSP}#{EQL}#{ANYSP}(#{FORMULA})/) { :def_func }
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Lexer
3
3
  module Tokens
4
4
  # NUM
@@ -1,7 +1,7 @@
1
- require 'qlang/lexer/base'
2
- require 'qlang/lexer/main_lexer'
1
+ require 'hilbert/lexer/base'
2
+ require 'hilbert/lexer/main_lexer'
3
3
 
4
- module Qlang
4
+ module Hilbert
5
5
  module Lexer
6
6
  def execute(str)
7
7
  MainLexer.new(str)
@@ -9,7 +9,7 @@ class MetaInfo
9
9
  lang = :r
10
10
  end
11
11
 
12
- # TODO: YAML.load_file("./lib/qlang/utils/langs.yml")['langs']
12
+ # TODO: YAML.load_file("./lib/hilbert/utils/langs.yml")['langs']
13
13
  def langs_hash
14
14
  {
15
15
  r: 'R',
@@ -1,7 +1,7 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Parser
3
3
  module Base
4
- include ::Qlang::Api
4
+ include ::Hilbert::Api
5
5
  end
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
- require 'qlang/lexer/formula_lexer'
1
+ require 'hilbert/lexer/formula_lexer'
2
2
 
3
- module Qlang
3
+ module Hilbert
4
4
  module Parser
5
5
  module FormulaParser
6
6
  include Lexer::Tokens
@@ -1,5 +1,5 @@
1
- require 'qlang/lexer/tokens'
2
- module Qlang
1
+ require 'hilbert/lexer/tokens'
2
+ module Hilbert
3
3
  module Parser
4
4
  module FuncParser
5
5
  include Base
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Parser
3
3
  module IntegralParser
4
4
  include Base
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Parser
3
3
  module LimitParser
4
4
  include Base
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Parser
3
3
  module ListParser
4
4
  include Base
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Parser
3
3
  module MatrixParser
4
4
  include Base
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Parser
3
3
  module SigmaParser
4
4
  include Base
@@ -1,4 +1,4 @@
1
- module Qlang
1
+ module Hilbert
2
2
  module Parser
3
3
  module VectorParser
4
4
  include Base
@@ -1,17 +1,17 @@
1
- require 'qlang/api'
1
+ require 'hilbert/api'
2
2
 
3
- require 'qlang/parser/base'
4
- require 'qlang/parser/matrix_parser'
5
- require 'qlang/parser/vector_parser'
6
- require 'qlang/parser/list_parser'
7
- require 'qlang/parser/func_parser'
8
- require 'qlang/parser/integral_parser'
9
- require 'qlang/parser/limit_parser'
10
- require 'qlang/parser/sigma_parser'
3
+ require 'hilbert/parser/base'
4
+ require 'hilbert/parser/matrix_parser'
5
+ require 'hilbert/parser/vector_parser'
6
+ require 'hilbert/parser/list_parser'
7
+ require 'hilbert/parser/func_parser'
8
+ require 'hilbert/parser/integral_parser'
9
+ require 'hilbert/parser/limit_parser'
10
+ require 'hilbert/parser/sigma_parser'
11
11
 
12
- require 'qlang/parser/formula_parser'
12
+ require 'hilbert/parser/formula_parser'
13
13
 
14
- module Qlang
14
+ module Hilbert
15
15
  module Parser
16
16
  include Lexer::Tokens
17
17
  SYM = '\w+'
@@ -25,26 +25,19 @@ module Qlang
25
25
  when /:(vector)(\d+)/, /:(matrix)(\d+)/, /:(tmatrix)(\d+)/, /:(integral)(\d+)/, /:(def_func)(\d+)/, /:(differential)(\d+)/, /:(limit)(\d+)/, /:(sigma)(\d+)/
26
26
  token_els = lexed.get_els($2)
27
27
 
28
- parsed =
29
- case $1
30
- when 'vector'
31
- VectorParser.execute(token_els)
32
- when 'matrix'
33
- MatrixParser.execute(token_els)
34
- when 'tmatrix'
35
- MatrixParser.execute(token_els, trans: true)
36
- when 'limit'
37
- LimitParser.execute(token_els)
38
- when 'integral'
39
- IntegralParser.execute(token_els)
40
- when 'def_func'
41
- FuncParser.execute(token_els)
42
- when 'sigma'
43
- SigmaParser.execute(token_els)
44
- when 'differential'
45
- del_var, formula = token_els
46
- "d/d#{del_var}(#{FormulaParser.execute(formula)})"
47
- end
28
+ parsed = case $1
29
+ when 'vector' then VectorParser.execute(token_els)
30
+ when 'matrix' then MatrixParser.execute(token_els)
31
+ when 'tmatrix' then MatrixParser.execute(token_els, trans: true)
32
+ when 'limit' then LimitParser.execute(token_els)
33
+ when 'integral' then IntegralParser.execute(token_els)
34
+ when 'def_func' then FuncParser.execute(token_els)
35
+ when 'sigma' then SigmaParser.execute(token_els)
36
+ when 'differential'
37
+ del_var, formula = token_els
38
+ "d/d#{del_var}(#{FormulaParser.execute(formula)})"
39
+ end
40
+
48
41
  lexed.parsed!(parsed, $2)
49
42
 
50
43
  when /:LPRN(\d+):CONT(\d+):RPRN(\d+)/
@@ -0,0 +1,3 @@
1
+ module Hilbert
2
+ VERSION = '0.0.2700001'
3
+ end
@@ -6,12 +6,12 @@ require 'yaml'
6
6
 
7
7
  $:.unshift(File.dirname(__FILE__))
8
8
  # Q core
9
- require 'qlang/meta_info'
10
- require 'qlang/utils/ruby_ext'
11
- require 'qlang/lexer'
12
- require 'qlang/parser'
9
+ require 'hilbert/meta_info'
10
+ require 'hilbert/utils/ruby_ext'
11
+ require 'hilbert/lexer'
12
+ require 'hilbert/parser'
13
13
 
14
- module Qlang
14
+ module Hilbert
15
15
  $meta_info = MetaInfo.instance
16
16
 
17
17
  class << self
@@ -25,7 +25,7 @@ module Qlang
25
25
  define_method("to_#{lang_name}") do |*opts|
26
26
  $meta_info.lang = lang_name.to_sym
27
27
  $meta_info.opts = opts
28
- Qlang
28
+ Hilbert
29
29
  end
30
30
  end
31
31
 
@@ -34,4 +34,4 @@ module Qlang
34
34
  end
35
35
 
36
36
  # Make alias as Q
37
- Q = Qlang
37
+ Q = Hilbert
@@ -1,7 +1,7 @@
1
1
  require 'minitest_helper'
2
2
 
3
3
  class TestTokens < MiniTest::Unit::TestCase
4
- include Qlang::Lexer::Tokens
4
+ include Hilbert::Lexer::Tokens
5
5
  def setup
6
6
  end
7
7
 
@@ -1,17 +1,17 @@
1
- require 'qlang/iq'
1
+ require 'hilbert/iq'
2
2
 
3
3
  class TestInterpreterBase < MiniTest::Unit::TestCase
4
4
  # TODO: opposite
5
5
  def assert_iq_equal(input, output)
6
- assert_equal(Qlang::Iq.execute(input), output)
6
+ assert_equal(Hilbert::Iq.execute(input), output)
7
7
  end
8
8
 
9
9
  def assert_def_func(input, output)
10
- assert_equal(Qlang::Iq.execute(input), output)
10
+ assert_equal(Hilbert::Iq.execute(input), output)
11
11
  end
12
12
 
13
13
  def assert_cal_func(input, output)
14
- assert_equal(Qlang::Iq.execute(input), output)
14
+ assert_equal(Hilbert::Iq.execute(input), output)
15
15
  reset
16
16
  end
17
17
  end
@@ -5,7 +5,7 @@ class TestLimit < TestInterpreterBase
5
5
  end
6
6
 
7
7
  def assert_iq_equal(output, input)
8
- assert_equal(Qlang::Iq.execute(input), output)
8
+ assert_equal(Hilbert::Iq.execute(input), output)
9
9
  end
10
10
 
11
11
  def test_general
@@ -1,5 +1,5 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
- require 'qlang'
2
+ require 'hilbert'
3
3
 
4
4
  require 'minitest/autorun'
5
5
  require 'pp'
@@ -1,5 +1,5 @@
1
1
  require 'minitest_helper'
2
- require 'qlang/qlang'
2
+ # require 'hilbert/hilbert'
3
3
 
4
4
  class TestQMatrix < TestInterpreterBase
5
5
  def setup
@@ -8,6 +8,6 @@ class TestQMatrix < TestInterpreterBase
8
8
  def test_main
9
9
  # assert_equal(50.0, QMatrix.new.func(10))
10
10
 
11
- assert_equal(8.0, QMatrix.new.execute(0, 2, 100))
11
+ # assert_equal(8.0, QMatrix.new.execute(0, 2, 100))
12
12
  end
13
13
  end
data/test/test_qlang.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'minitest_helper'
2
2
 
3
- class TestQlang < MiniTest::Unit::TestCase
3
+ class TestHilbert < MiniTest::Unit::TestCase
4
4
  def setup
5
5
  end
6
6
 
@@ -9,8 +9,8 @@ class TestQlang < MiniTest::Unit::TestCase
9
9
  end
10
10
 
11
11
  def test_basis
12
- refute_nil ::Qlang::VERSION
13
- assert_equal(Qlang, Q)
12
+ refute_nil ::Hilbert::VERSION
13
+ assert_equal(Hilbert, Q)
14
14
  end
15
15
 
16
16
  def test_demo_code
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hilbert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2700000
4
+ version: 0.0.2700001
5
5
  platform: ruby
6
6
  authors:
7
7
  - gogotanaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-02 00:00:00.000000000 Z
11
+ date: 2014-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dydx
@@ -28,65 +28,65 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake-compiler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Enjoy MATH!
84
84
  email:
85
85
  - mail@tanakakazuki.com
86
86
  executables:
87
- - qlang
87
+ - hilbert
88
88
  extensions:
89
- - ext/qlang/extconf.rb
89
+ - ext/hilbert/extconf.rb
90
90
  extra_rdoc_files: []
91
91
  files:
92
92
  - .coveralls.yml
@@ -98,14 +98,15 @@ files:
98
98
  - LICENSE.txt
99
99
  - README.md
100
100
  - Rakefile
101
- - bin/qlang
101
+ - bin/hilbert
102
102
  - core/Q.hs
103
103
  - core/Q/Lexer.hs
104
104
  - core/Q/Parser.hs
105
- - ext/qlang/QMatrix/q_matrix.c
106
- - ext/qlang/extconf.rb
107
- - ext/qlang/qlang.c
108
- - ext/qlang/qlang.h
105
+ - ext/hilbert/QMatrix/q_matrix.c
106
+ - ext/hilbert/extconf.rb
107
+ - ext/hilbert/hilbert.c
108
+ - ext/hilbert/hilbert.h
109
+ - hilbert.gemspec
109
110
  - legacy_rspec/langs/Haskell/ex1_after.hs
110
111
  - legacy_rspec/langs/Haskell/ex1_before.hs
111
112
  - legacy_rspec/langs/Python/ex1_after.py
@@ -115,37 +116,36 @@ files:
115
116
  - legacy_rspec/objects/list_spec.rb
116
117
  - legacy_rspec/objects/matrix_spec.rb
117
118
  - legacy_rspec/objects/vector_spec.rb
118
- - lib/qlang.rb
119
- - lib/qlang/api.rb
120
- - lib/qlang/api/func_api.rb
121
- - lib/qlang/api/integral_api.rb
122
- - lib/qlang/api/limit_api.rb
123
- - lib/qlang/api/list_api.rb
124
- - lib/qlang/api/matrix_api.rb
125
- - lib/qlang/api/sigma_api.rb
126
- - lib/qlang/api/vector_api.rb
127
- - lib/qlang/exec.rb
128
- - lib/qlang/iq.rb
129
- - lib/qlang/lexer.rb
130
- - lib/qlang/lexer/base.rb
131
- - lib/qlang/lexer/formula_lexer.rb
132
- - lib/qlang/lexer/main_lexer.rb
133
- - lib/qlang/lexer/tokens.rb
134
- - lib/qlang/meta_info.rb
135
- - lib/qlang/parser.rb
136
- - lib/qlang/parser/base.rb
137
- - lib/qlang/parser/formula_parser.rb
138
- - lib/qlang/parser/func_parser.rb
139
- - lib/qlang/parser/integral_parser.rb
140
- - lib/qlang/parser/limit_parser.rb
141
- - lib/qlang/parser/list_parser.rb
142
- - lib/qlang/parser/matrix_parser.rb
143
- - lib/qlang/parser/sigma_parser.rb
144
- - lib/qlang/parser/vector_parser.rb
145
- - lib/qlang/utils/langs.yml
146
- - lib/qlang/utils/ruby_ext.rb
147
- - lib/qlang/version.rb
148
- - qlang.gemspec
119
+ - lib/hilbert.rb
120
+ - lib/hilbert/api.rb
121
+ - lib/hilbert/api/func_api.rb
122
+ - lib/hilbert/api/integral_api.rb
123
+ - lib/hilbert/api/limit_api.rb
124
+ - lib/hilbert/api/list_api.rb
125
+ - lib/hilbert/api/matrix_api.rb
126
+ - lib/hilbert/api/sigma_api.rb
127
+ - lib/hilbert/api/vector_api.rb
128
+ - lib/hilbert/exec.rb
129
+ - lib/hilbert/iq.rb
130
+ - lib/hilbert/lexer.rb
131
+ - lib/hilbert/lexer/base.rb
132
+ - lib/hilbert/lexer/formula_lexer.rb
133
+ - lib/hilbert/lexer/main_lexer.rb
134
+ - lib/hilbert/lexer/tokens.rb
135
+ - lib/hilbert/meta_info.rb
136
+ - lib/hilbert/parser.rb
137
+ - lib/hilbert/parser/base.rb
138
+ - lib/hilbert/parser/formula_parser.rb
139
+ - lib/hilbert/parser/func_parser.rb
140
+ - lib/hilbert/parser/integral_parser.rb
141
+ - lib/hilbert/parser/limit_parser.rb
142
+ - lib/hilbert/parser/list_parser.rb
143
+ - lib/hilbert/parser/matrix_parser.rb
144
+ - lib/hilbert/parser/sigma_parser.rb
145
+ - lib/hilbert/parser/vector_parser.rb
146
+ - lib/hilbert/utils/langs.yml
147
+ - lib/hilbert/utils/ruby_ext.rb
148
+ - lib/hilbert/version.rb
149
149
  - test/internal/test_tokens.rb
150
150
  - test/interpreter/base.rb
151
151
  - test/interpreter/test_differential.rb
@@ -171,17 +171,17 @@ require_paths:
171
171
  - lib
172
172
  required_ruby_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - ! '>='
174
+ - - '>='
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - ! '>='
179
+ - - '>='
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.4.2
184
+ rubygems_version: 2.0.2
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: Enjoy MATH!
data/ext/qlang/extconf.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'mkmf'
2
-
3
- create_makefile('qlang/qlang')
data/lib/qlang/api.rb DELETED
@@ -1,23 +0,0 @@
1
- require 'qlang/api/matrix_api'
2
- require 'qlang/api/vector_api'
3
- require 'qlang/api/list_api'
4
- require 'qlang/api/func_api'
5
- require 'qlang/api/integral_api'
6
- require 'qlang/api/limit_api'
7
- require 'qlang/api/sigma_api'
8
-
9
- module Qlang
10
- module Api
11
- class ::Matrix
12
- def to_q
13
- rows.map(&:join_by_sp).join('; ').parentheses
14
- end
15
- end
16
-
17
- class ::Vector
18
- def to_q
19
- elements.join_by_sp.parentheses
20
- end
21
- end
22
- end
23
- end
data/lib/qlang/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module Qlang
2
- VERSION = '0.0.2700000'
3
- end
File without changes
File without changes
File without changes
File without changes