nilac 0.0.4.3.3 → 0.0.4.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +17 -17
  3. data/Gemfile +4 -4
  4. data/LICENSE +20 -20
  5. data/README.md +67 -67
  6. data/Rakefile +2 -2
  7. data/bin/nilac +4734 -4734
  8. data/lib/nilac.rb +5 -5
  9. data/lib/nilac/version.rb +3 -3
  10. data/nilac.gemspec +19 -19
  11. data/shark/features/add_auto_return_statement.feature +17 -17
  12. data/shark/features/array_and_string_indexing.feature +10 -10
  13. data/shark/features/barebones_compilation.feature +10 -10
  14. data/shark/features/default_method_parameters.feature +11 -11
  15. data/shark/features/fix_newlines.feature +12 -12
  16. data/shark/features/hashes.feature +10 -10
  17. data/shark/features/heredoc.feature +10 -10
  18. data/shark/features/if_then_else.feature +10 -10
  19. data/shark/features/loop.feature +10 -10
  20. data/shark/features/method_multiple_return.feature +16 -16
  21. data/shark/features/multiline_array.feature +10 -10
  22. data/shark/features/multiple_variable_initialization.feature +11 -11
  23. data/shark/features/numbers.feature +10 -10
  24. data/shark/features/regular_for.feature +10 -10
  25. data/shark/features/regular_if.feature +10 -10
  26. data/shark/features/regular_while.feature +10 -10
  27. data/shark/features/ruby_operators.feature +10 -10
  28. data/shark/features/string_interpolation.feature +10 -10
  29. data/shark/features/strings.feature +10 -10
  30. data/shark/features/times.feature +10 -10
  31. data/shark/features/unless_until.feature +10 -10
  32. data/shark/features/whitespace_delimitation.feature +10 -10
  33. data/shark/test_files/array_string_indexing.nila +21 -21
  34. data/shark/test_files/correct.js +4 -4
  35. data/shark/test_files/correct_default_parameters.js +22 -22
  36. data/shark/test_files/correct_for.js +26 -26
  37. data/shark/test_files/correct_hashes.js +32 -32
  38. data/shark/test_files/correct_heredoc.js +10 -10
  39. data/shark/test_files/correct_if_then_else.js +6 -6
  40. data/shark/test_files/correct_indexing.js +26 -26
  41. data/shark/test_files/correct_initialization.js +34 -34
  42. data/shark/test_files/correct_loop.js +14 -14
  43. data/shark/test_files/correct_multiline_array.js +12 -12
  44. data/shark/test_files/correct_multiple_return.js +20 -20
  45. data/shark/test_files/correct_numbers.js +8 -8
  46. data/shark/test_files/correct_operators.js +16 -16
  47. data/shark/test_files/correct_regular_if.js +13 -13
  48. data/shark/test_files/correct_regular_while.js +13 -13
  49. data/shark/test_files/correct_return.js +10 -10
  50. data/shark/test_files/correct_single_return.js +10 -10
  51. data/shark/test_files/correct_string_interpolation.js +16 -16
  52. data/shark/test_files/correct_string_operators.js +24 -24
  53. data/shark/test_files/correct_times.js +23 -23
  54. data/shark/test_files/correct_unless_until.js +28 -28
  55. data/shark/test_files/correct_whitespace_delimiter.js +16 -16
  56. data/shark/test_files/default_parameters.nila +12 -12
  57. data/shark/test_files/erratic.nila +22 -22
  58. data/shark/test_files/hashes.nila +22 -22
  59. data/shark/test_files/heredoc.nila +13 -13
  60. data/shark/test_files/loop.nila +5 -5
  61. data/shark/test_files/multiline_array.nila +12 -12
  62. data/shark/test_files/multiple_initialization.nila +16 -16
  63. data/shark/test_files/multiple_return.nila +16 -16
  64. data/shark/test_files/no_return.nila +6 -6
  65. data/shark/test_files/numbers.nila +2 -2
  66. data/shark/test_files/operators.nila +8 -8
  67. data/shark/test_files/perfect.js +16 -16
  68. data/shark/test_files/regular_for.nila +16 -16
  69. data/shark/test_files/regular_if.nila +19 -19
  70. data/shark/test_files/regular_while.nila +6 -6
  71. data/shark/test_files/ruby_methods.nila +24 -0
  72. data/shark/test_files/single_return.nila +6 -6
  73. data/shark/test_files/string_interpolation.nila +10 -10
  74. data/shark/test_files/string_operators.nila +19 -19
  75. data/shark/test_files/times.nila +12 -12
  76. data/shark/test_files/unless_until.nila +16 -16
  77. data/shark/test_files/whitespace_delimiter.nila +16 -16
  78. data/src/nilac.rb +4766 -4732
  79. metadata +4 -4
@@ -1,5 +1,5 @@
1
- require "nilac/version"
2
-
3
- module Nilac
4
-
5
- end
1
+ require "nilac/version"
2
+
3
+ module Nilac
4
+
5
+ end
@@ -1,3 +1,3 @@
1
- module Nilac
2
- VERSION = "0.0.4.3.3"
3
- end
1
+ module Nilac
2
+ VERSION = "0.0.4.3.4"
3
+ end
@@ -1,19 +1,19 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/nilac/version', __FILE__)
3
-
4
- Gem::Specification.new do |gem|
5
- gem.authors = ["Adhithya Rajasekaran"]
6
- gem.email = ["adhithyan15@gmail.com"]
7
- gem.description = %q{Nilac is the official compiler of Nila language}
8
- gem.summary = %q{Nilac compiles Nila files into line for line Javascript.}
9
- gem.homepage = "http://adhithyan15.github.com/nila"
10
-
11
- gem.files = `git ls-files`.split($\)
12
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
- gem.name = "nilac"
15
- gem.require_paths = ["lib"]
16
- gem.version = Nilac::VERSION
17
- gem.add_dependency("shark")
18
- gem.add_dependency("slop")
19
- end
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/nilac/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Adhithya Rajasekaran"]
6
+ gem.email = ["adhithyan15@gmail.com"]
7
+ gem.description = %q{Nilac is the official compiler of Nila language}
8
+ gem.summary = %q{Nilac compiles Nila files into line for line Javascript.}
9
+ gem.homepage = "http://adhithyan15.github.com/nila"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "nilac"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Nilac::VERSION
17
+ gem.add_dependency("shark")
18
+ gem.add_dependency("slop")
19
+ end
@@ -1,18 +1,18 @@
1
- Feature: Adding automatic return statements to the last evaluated statement
2
- in a function. It is a rubyesque feature imported into Nila.
3
- Scenario: Input function with no return statement
4
- Given the input file "no_return.nila"
5
- When the ~compiler is run
6
- The output file must be "no_return.js"
7
- The output file must equal "correct_return.js"
8
-
9
- Scenario: Input function with a return statement
10
- Given the input file "single_return.nila"
11
- When the ~compiler is run
12
- The output file must be "single_return.js"
13
- The output file must equal "correct_single_return.js"
14
-
15
- Configurations:
16
-
17
- ~compiler => src/nilac.rb
1
+ Feature: Adding automatic return statements to the last evaluated statement
2
+ in a function. It is a rubyesque feature imported into Nila.
3
+ Scenario: Input function with no return statement
4
+ Given the input file "no_return.nila"
5
+ When the ~compiler is run
6
+ The output file must be "no_return.js"
7
+ The output file must equal "correct_return.js"
8
+
9
+ Scenario: Input function with a return statement
10
+ Given the input file "single_return.nila"
11
+ When the ~compiler is run
12
+ The output file must be "single_return.js"
13
+ The output file must equal "correct_single_return.js"
14
+
15
+ Configurations:
16
+
17
+ ~compiler => src/nilac.rb
18
18
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature bring Ruby's indexing capabililty to Javascript.
2
- Scenario: Input file with Ruby style Array and String indexing
3
- Given the input file "array_string_indexing.nila"
4
- When the ~compiler is run
5
- The output file must be "array_string_indexing.js"
6
- The output file must equal "correct_indexing.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature bring Ruby's indexing capabililty to Javascript.
2
+ Scenario: Input file with Ruby style Array and String indexing
3
+ Given the input file "array_string_indexing.nila"
4
+ When the ~compiler is run
5
+ The output file must be "array_string_indexing.js"
6
+ The output file must equal "correct_indexing.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: Compiling a single line nila program
2
- Scenario: Input with a single line nila program
3
- Given the input file "simple.nila"
4
- When the ~compiler is run
5
- The output file must be "simple.js"
6
- The output file must equal "correct.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: Compiling a single line nila program
2
+ Scenario: Input with a single line nila program
3
+ Given the input file "simple.nila"
4
+ When the ~compiler is run
5
+ The output file must be "simple.js"
6
+ The output file must equal "correct.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,12 +1,12 @@
1
- Feature: Javascript,by default,doesn't allow for the usage of default parameters for functions. So this
2
- feature addresses that issue.
3
- Scenario: Input function with default parameters
4
- Given the input file "default_parameters.nila"
5
- When the ~compiler is run
6
- The output file must be "default_parameters.js"
7
- The output file must equal "correct_default_parameters.js"
8
-
9
- Configurations:
10
-
11
- ~compiler => src/nilac.rb
1
+ Feature: Javascript,by default,doesn't allow for the usage of default parameters for functions. So this
2
+ feature addresses that issue.
3
+ Scenario: Input function with default parameters
4
+ Given the input file "default_parameters.nila"
5
+ When the ~compiler is run
6
+ The output file must be "default_parameters.js"
7
+ The output file must equal "correct_default_parameters.js"
8
+
9
+ Configurations:
10
+
11
+ ~compiler => src/nilac.rb
12
12
  :v $cliusage => ruby :v --compile $file
@@ -1,13 +1,13 @@
1
- Feature: Fixing irregular newlines produced in the Javascript output.
2
- Currently, The output Javascript is riddled with unnecessary newlines
3
- which will make it fail in a JSLint test.
4
- Scenario: Input with erratic newlines
5
- Given the input file "erratic.nila"
6
- When the ~compiler is run
7
- The output file must be "erratic.js"
8
- The output file must equal "perfect.js"
9
-
10
- Configurations:
11
-
12
- ~compiler => src/nilac.rb
1
+ Feature: Fixing irregular newlines produced in the Javascript output.
2
+ Currently, The output Javascript is riddled with unnecessary newlines
3
+ which will make it fail in a JSLint test.
4
+ Scenario: Input with erratic newlines
5
+ Given the input file "erratic.nila"
6
+ When the ~compiler is run
7
+ The output file must be "erratic.js"
8
+ The output file must equal "perfect.js"
9
+
10
+ Configurations:
11
+
12
+ ~compiler => src/nilac.rb
13
13
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature brings Ruby style Hashes to Nila
2
- Scenario: Input file with hashes.
3
- Given the input file "hashes.nila"
4
- When the ~compiler is run
5
- The output file must be "hashes.js"
6
- The output file must equal "correct_hashes.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature brings Ruby style Hashes to Nila
2
+ Scenario: Input file with hashes.
3
+ Given the input file "hashes.nila"
4
+ When the ~compiler is run
5
+ The output file must be "hashes.js"
6
+ The output file must equal "correct_hashes.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature brings heredocs to Nila
2
- Scenario: Input file with heredocs.
3
- Given the input file "heredoc.nila"
4
- When the ~compiler is run
5
- The output file must be "heredoc.js"
6
- The output file must equal "correct_heredoc.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature brings heredocs to Nila
2
+ Scenario: Input file with heredocs.
3
+ Given the input file "heredoc.nila"
4
+ When the ~compiler is run
5
+ The output file must be "heredoc.js"
6
+ The output file must equal "correct_heredoc.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature brings single line if-then-else statement to Nila
2
- Scenario: Input file with single line if-then-else statement.
3
- Given the input file "if_then_else.nila"
4
- When the ~compiler is run
5
- The output file must be "if_then_else.js"
6
- The output file must equal "correct_if_then_else.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature brings single line if-then-else statement to Nila
2
+ Scenario: Input file with single line if-then-else statement.
3
+ Given the input file "if_then_else.nila"
4
+ When the ~compiler is run
5
+ The output file must be "if_then_else.js"
6
+ The output file must equal "correct_if_then_else.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature brings loop keyword to Nila
2
- Scenario: Input file with loop keyword.
3
- Given the input file "loop.nila"
4
- When the ~compiler is run
5
- The output file must be "loop.js"
6
- The output file must equal "correct_loop.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature brings loop keyword to Nila
2
+ Scenario: Input file with loop keyword.
3
+ Given the input file "loop.nila"
4
+ When the ~compiler is run
5
+ The output file must be "loop.js"
6
+ The output file must equal "correct_loop.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,17 +1,17 @@
1
- Feature: Javascript, by default, doesn't allow for the return of multiple values. So this is Nila's attempt to fix this problem.
2
- Scenario: Input function with multiple return statement
3
- Given the input file "multiple_return.nila"
4
- When the ~compiler is run
5
- The output file must be "multiple_return.js"
6
- The output file must equal "correct_multiple_return.js"
7
-
8
- Scenario: Input function with a single return statement
9
- Given the input file "single_return.nila"
10
- When the ~compiler is run
11
- The output file must be "single_return.js"
12
- The output file must equal "correct_single_return.js"
13
-
14
- Configurations:
15
-
16
- ~compiler => src/nilac.rb
1
+ Feature: Javascript, by default, doesn't allow for the return of multiple values. So this is Nila's attempt to fix this problem.
2
+ Scenario: Input function with multiple return statement
3
+ Given the input file "multiple_return.nila"
4
+ When the ~compiler is run
5
+ The output file must be "multiple_return.js"
6
+ The output file must equal "correct_multiple_return.js"
7
+
8
+ Scenario: Input function with a single return statement
9
+ Given the input file "single_return.nila"
10
+ When the ~compiler is run
11
+ The output file must be "single_return.js"
12
+ The output file must equal "correct_single_return.js"
13
+
14
+ Configurations:
15
+
16
+ ~compiler => src/nilac.rb
17
17
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature brings multiline arrays to Nila
2
- Scenario: Input file with multiline array and regular arrays.
3
- Given the input file "multiline_array.nila"
4
- When the ~compiler is run
5
- The output file must be "multiline_array.js"
6
- The output file must equal "correct_multiline_array.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature brings multiline arrays to Nila
2
+ Scenario: Input file with multiline array and regular arrays.
3
+ Given the input file "multiline_array.nila"
4
+ When the ~compiler is run
5
+ The output file must be "multiline_array.js"
6
+ The output file must equal "correct_multiline_array.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,12 +1,12 @@
1
- Feature: Javascript doesn't allow multiple variable initializations from a method call. So this feature attempts to fix this problem. This feature is complementary to the multiple return feature.
2
-
3
- Scenario: Multiple variables initialized from a method call.
4
- Given the input file "multiple_initialization.nila"
5
- When the ~compiler is run
6
- The output file must be "multiple_initialization.js"
7
- The output file must equal "correct_initialization.js"
8
-
9
- Configurations:
10
-
11
- ~compiler => src/nilac.rb
1
+ Feature: Javascript doesn't allow multiple variable initializations from a method call. So this feature attempts to fix this problem. This feature is complementary to the multiple return feature.
2
+
3
+ Scenario: Multiple variables initialized from a method call.
4
+ Given the input file "multiple_initialization.nila"
5
+ When the ~compiler is run
6
+ The output file must be "multiple_initialization.js"
7
+ The output file must equal "correct_initialization.js"
8
+
9
+ Configurations:
10
+
11
+ ~compiler => src/nilac.rb
12
12
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature brings Ruby's number features to Nila
2
- Scenario: Input file with Ruby's number features.
3
- Given the input file "numbers.nila"
4
- When the ~compiler is run
5
- The output file must be "numbers.js"
6
- The output file must equal "correct_numbers.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature brings Ruby's number features to Nila
2
+ Scenario: Input file with Ruby's number features.
3
+ Given the input file "numbers.nila"
4
+ When the ~compiler is run
5
+ The output file must be "numbers.js"
6
+ The output file must equal "correct_numbers.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: Compiling for loops in a nila program
2
- Scenario: Input with several kinds of for loops
3
- Given the input file "regular_for.nila"
4
- When the ~compiler is run
5
- The output file must be "regular_for.js"
6
- The output file must equal "correct_for.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: Compiling for loops in a nila program
2
+ Scenario: Input with several kinds of for loops
3
+ Given the input file "regular_for.nila"
4
+ When the ~compiler is run
5
+ The output file must be "regular_for.js"
6
+ The output file must equal "correct_for.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature bring Ruby's if statement to Nila.
2
- Scenario: Input function with if statements
3
- Given the input file "regular_if.nila"
4
- When the ~compiler is run
5
- The output file must be "regular_if.js"
6
- The output file must equal "correct_regular_if.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature bring Ruby's if statement to Nila.
2
+ Scenario: Input function with if statements
3
+ Given the input file "regular_if.nila"
4
+ When the ~compiler is run
5
+ The output file must be "regular_if.js"
6
+ The output file must equal "correct_regular_if.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file
@@ -1,11 +1,11 @@
1
- Feature: This feature bring Ruby's while statement to Nila.
2
- Scenario: Input function with while statements
3
- Given the input file "regular_while.nila"
4
- When the ~compiler is run
5
- The output file must be "regular_while.js"
6
- The output file must equal "correct_regular_while.js"
7
-
8
- Configurations:
9
-
10
- ~compiler => src/nilac.rb
1
+ Feature: This feature bring Ruby's while statement to Nila.
2
+ Scenario: Input function with while statements
3
+ Given the input file "regular_while.nila"
4
+ When the ~compiler is run
5
+ The output file must be "regular_while.js"
6
+ The output file must equal "correct_regular_while.js"
7
+
8
+ Configurations:
9
+
10
+ ~compiler => src/nilac.rb
11
11
  :v $cliusage => ruby :v --compile $file