excel_to_code 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de50bb7417dea65e89b3e044864df9d88fe1bb7c
4
- data.tar.gz: dbd11e7e284285b9f311ee6e4c983876d066a38c
3
+ metadata.gz: 5f1988c086ef6a403614793934210ee23e3053b3
4
+ data.tar.gz: 94883836b8fc03b001359fef54c066908ecf5bce
5
5
  SHA512:
6
- metadata.gz: 6e60e361d77daad8e9d4ce9ddc5ad3d483c3af24089d085440482502305cc45dfadadf416ab814ed8e66f0e41541e8cc3bfbeae9b560ebdd5c9fe67d766f2679
7
- data.tar.gz: bb745e1c9a5e6dc3d9ecfcc2b52c70ea9da644e2fba18dbdacb0d6ee11e999e42f5976d559d2b2e876c8abdf6c7be1002053bf62546d4209d0466d3ae6915c9a
6
+ metadata.gz: e7cc4cc4002a58becf5abac81bd3da2be911468bbbf2391025314d893e776d21bfee5498d05544d0f90636e97ba4d07a0ef477476b0ecd3e3bc5c5f4a1831811
7
+ data.tar.gz: 27abf806472aa1328e0c5806d04c1bab8905ab0ab55330af95b7bbb74c7427794dad4b2cb3c733335836b63f39af6ee898e8d21bb869037557c4f3e2abd4d2ea
data/src/compile/c/a.out CHANGED
Binary file
@@ -63,6 +63,7 @@ static ExcelValue iferror(ExcelValue value, ExcelValue value_if_error);
63
63
  static ExcelValue excel_index(ExcelValue array_v, ExcelValue row_number_v, ExcelValue column_number_v);
64
64
  static ExcelValue excel_index_2(ExcelValue array_v, ExcelValue row_number_v);
65
65
  static ExcelValue excel_isnumber(ExcelValue number);
66
+ static ExcelValue excel_isblank(ExcelValue value);
66
67
  static ExcelValue large(ExcelValue array_v, ExcelValue k_v);
67
68
  static ExcelValue left(ExcelValue string_v, ExcelValue number_of_characters_v);
68
69
  static ExcelValue left_1(ExcelValue string_v);
@@ -510,6 +511,14 @@ static ExcelValue excel_isnumber(ExcelValue potential_number) {
510
511
  }
511
512
  }
512
513
 
514
+ static ExcelValue excel_isblank(ExcelValue value) {
515
+ if(value.type == ExcelEmpty) {
516
+ return TRUE;
517
+ } else {
518
+ return FALSE;
519
+ }
520
+ }
521
+
513
522
  static ExcelValue excel_if(ExcelValue condition, ExcelValue true_case, ExcelValue false_case ) {
514
523
  CHECK_FOR_PASSED_ERROR(condition)
515
524
 
@@ -754,6 +754,15 @@ int test_functions() {
754
754
  assert(excel_exp(TRUE).number == 2.718281828459045);
755
755
  assert(excel_exp(DIV0).type == ExcelError);
756
756
 
757
+ // Test the ISBLANK function
758
+ assert(excel_isblank(BLANK).type == ExcelBoolean);
759
+ assert(excel_isblank(BLANK).number == true);
760
+ assert(excel_isblank(ZERO).type == ExcelBoolean);
761
+ assert(excel_isblank(ZERO).number == false);
762
+ assert(excel_isblank(TRUE).number == false);
763
+ assert(excel_isblank(FALSE).number == false);
764
+ assert(excel_isblank(new_excel_string("")).number == false);
765
+
757
766
  // Release memory
758
767
  free_all_allocated_memory();
759
768
 
@@ -47,6 +47,7 @@ class MapFormulaeToC < MapValuesToC
47
47
  :'INDEX3' => 'excel_index',
48
48
  :'INT' => 'excel_int',
49
49
  :'ISNUMBER' => 'excel_isnumber',
50
+ :'ISBLANK' => 'excel_isblank',
50
51
  :'LARGE' => 'large',
51
52
  :'LEFT1' => 'left_1',
52
53
  :'LEFT2' => 'left',
@@ -32,6 +32,7 @@ class MapFormulaeToRuby < MapValuesToRuby
32
32
  :'IFERROR' => 'iferror',
33
33
  :'INDEX' => 'index',
34
34
  :'INT' => 'int',
35
+ :'ISBLANK' => 'isblank',
35
36
  :'ISNUMBER' => 'isnumber',
36
37
  :'LARGE' => 'large',
37
38
  :'LEFT' => 'left',
@@ -0,0 +1,8 @@
1
+ module ExcelFunctions
2
+
3
+ def isblank(a)
4
+ return true if a == nil
5
+ false
6
+ end
7
+
8
+ end
@@ -98,3 +98,5 @@ require_relative 'excel_functions/substitute'
98
98
  require_relative 'excel_functions/lower'
99
99
 
100
100
  require_relative 'excel_functions/exp'
101
+
102
+ require_relative 'excel_functions/isblank'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excel_to_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Counsell, Green on Black Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2014-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubypeg
@@ -157,6 +157,7 @@ files:
157
157
  - src/excel/excel_functions/iferror.rb
158
158
  - src/excel/excel_functions/index.rb
159
159
  - src/excel/excel_functions/int.rb
160
+ - src/excel/excel_functions/isblank.rb
160
161
  - src/excel/excel_functions/isnumber.rb
161
162
  - src/excel/excel_functions/large.rb
162
163
  - src/excel/excel_functions/left.rb