void 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/void.rb +40 -0
  3. metadata +45 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2f4a36a282ddbe419f5175c8d93ee7bab67524a6
4
+ data.tar.gz: b6a0ca27b0484df5b171a9c78fc09c4115317c71
5
+ SHA512:
6
+ metadata.gz: cc873665f672e01753a178abca202ec0d68c0e08143094fd5952cd23adadbef3e6a15465c4fd24a54bdc641d2f6ae3aeb2ceb4bca809fdc4a76844a3f8fa9cfd
7
+ data.tar.gz: b01d5cf582338dbc8e9a00b41bc291ee400d8b18534884874e768390ecf0926d089fb2f31f4dfd0dffc75726711737a27dad4854096ed12544d9414a88fc549f
@@ -0,0 +1,40 @@
1
+ require 'pp'
2
+ require 'json'
3
+ require_relative 'void/logger'
4
+ require_relative 'void/preprocessor'
5
+ require_relative 'void/tokens'
6
+ require_relative 'void/nodes'
7
+ require_relative 'void/parser'
8
+ require_relative 'void/engine'
9
+
10
+ module Void
11
+ class << self
12
+ def compile(code = "")
13
+ # Instantiate required language components
14
+ @syntax = Parser.parse code
15
+
16
+ pp @syntax
17
+ end
18
+
19
+ # Analyze the input code and check for matching tokens. In case no match was
20
+ # found, throw an exception. In special cases, modify the token hash.
21
+ #
22
+ # @param file [String] The file that needs to be analyzed
23
+ # @param context [Hash | String] Processing environment data
24
+ #
25
+ def render(file, context = {})
26
+ @file = file
27
+
28
+ # Accept both ruby hashes and JSON files as database environments
29
+ case context
30
+ when Hash
31
+ @context = context
32
+ when String
33
+ @context = JSON.parse(File.read context)
34
+ end
35
+
36
+ # Run all the processors
37
+ compile PreProcessor.process @file
38
+ end
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: void
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alex Grozav
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: UNDER DEVELOPMENT
14
+ email: alex@grozav.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/void.rb
20
+ homepage: http://voidlang.com
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.4.6
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Void
44
+ test_files: []
45
+ has_rdoc: