alphalang 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: 9e3d320e5322d98b56f1cd6d5f9e51211de1c41ba6abe20800177bf83ae08133
4
- data.tar.gz: fe85e5979279fbff45aa74ec9a09435bff67fd49dca35c5fbd332c1c8628c9e7
3
+ metadata.gz: c9d0971b25f1f629686a4ca72899a014ab9dd0934b3021e1509faa46870e79fc
4
+ data.tar.gz: 7ff3c836669793b4b58deea30bd8e8c485ca7ce9465ab3ac6ef490b8a7508d04
5
5
  SHA512:
6
- metadata.gz: 0ee5133266c1e9ebb85c13740d730efb69db1b4deb54853e53103e38275262edc789f425e1450ef5582bb4077590d33c21fbe24662920b473a6d05ba9de21676
7
- data.tar.gz: 8e756c3aa10fa954cc06fbb299d5eff3ce1335d6c3130f76485280f09c08165fc1c62bd9b5160e83ea68dec7ead8368d7dc584b5915a62a14ca8ed28d2e954d8
6
+ metadata.gz: 7a44e1156d6e59488c1891af9eaa3d9a304ddd812b54ad44656762d169d84a2c1df057a8030654aea52c791037dfc1620a551b0e72b4f8882b20ea8d9c45edc2
7
+ data.tar.gz: 1459484c62af5206acf1d9e657f25fae40cc8adfbb36838c59e1a37434034be283bdb48fbe4efb820eb0c6cb779e2a933925d4cbcc35796769df56e0bcce5f20
data/bin/alphalang CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'optparse'
3
3
  require File.expand_path('../lib/alpha', __dir__)
4
- ALPHA_VER = '0.1.4'.freeze
4
+ ALPHA_VER = '0.1.5'.freeze
5
5
  ABORT_ANSWERS = [' ', '', 'none', 'abort'].freeze # something here? Some cases empty means yes tho..
6
6
  LOCALES_PATH = File.join(__dir__, '../lib/locales')
7
7
  PROTECTED_LOCALES = ['.', '..', 'locale_template', 'default', 'default.old', 'en', 'sv', 'de'].freeze
data/lib/alpha.rb CHANGED
@@ -3,6 +3,7 @@ require_relative './nodes/scopemanager'
3
3
  class LangParser
4
4
  def initialize(locale = 'default')
5
5
  @langParser = Parser.new('lang parser', locale) do
6
+ token(/;;.*$/)
6
7
  token(/while/) { |_| :WHILE }
7
8
  token(/print/) { |_| :PRINT }
8
9
  token(/pause/) { |_| :PAUSE }
data/lib/lang_creator.rb CHANGED
@@ -35,22 +35,23 @@ def prompt_user(file)
35
35
 
36
36
  counter = 0
37
37
  File.open(file, 'a') do |f|
38
+ f.puts ';;.*$ ;;.*$'
38
39
  locale_template.each do |line|
39
40
  counter += 1
40
- break if counter == 14
41
+ break if counter == 15
41
42
 
42
- if counter < 9
43
+ if counter > 1 && counter < 10
43
44
  translation = read_translation(line.chomp)
44
45
  f.puts "#{line.chomp} #{translation}"
45
46
  end
46
- if counter == 9
47
+ if counter == 10
47
48
  translation = read_translation_true_false(line.chomp)
48
49
  f.puts "#{line.chomp} #{translation}"
49
50
  end
50
- if counter == 10
51
+ if counter == 11
51
52
  f.puts "#{line.chomp} (==|<=|>=)"
52
53
  end
53
- if counter > 10
54
+ if counter > 11
54
55
  translation = read_translation_not_and_or(line.chomp)
55
56
  f.puts "#{line.chomp} #{translation}"
56
57
  end
@@ -90,6 +91,6 @@ def create_locale_file()
90
91
  puts "Locale is saved as #{new_locale_name} in #{LOCALES_PATH}"
91
92
  else
92
93
  puts 'Translation removed'
93
- File.delete(new_locale_file)
94
+ File.delete(new_locale_file_path)
94
95
  end
95
96
  end
data/lib/locales/de CHANGED
@@ -1,3 +1,4 @@
1
+ ;;.*$ ;;.*$
1
2
  while während
2
3
  print drucken
3
4
  pause pause
data/lib/locales/default CHANGED
@@ -1,3 +1,4 @@
1
+ ;;.*$ ;;.*$
1
2
  while while
2
3
  print print
3
4
  pause pause
data/lib/locales/en CHANGED
@@ -1,3 +1,4 @@
1
+ ;;.*$ ;;.*$
1
2
  while while
2
3
  print print
3
4
  pause pause
@@ -1,3 +1,4 @@
1
+ ;;.*$
1
2
  while
2
3
  print
3
4
  pause
data/lib/locales/sv CHANGED
@@ -1,3 +1,4 @@
1
+ ;;.*$ ;;.*$
1
2
  while medan
2
3
  print skriv
3
4
  pause vänta
@@ -12,6 +12,10 @@ class ScopeManager
12
12
  $scope_lvl
13
13
  end
14
14
 
15
+ def self.scope_lvl=(value)
16
+ $scope_lvl = value
17
+ end
18
+
15
19
  def self.lookup_var(name)
16
20
  temp_scope_lvl = $scope_lvl
17
21
  while temp_scope_lvl >= 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alphalang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - mattias
@@ -62,11 +62,8 @@ files:
62
62
  - lib/alpha.rb
63
63
  - lib/lang_creator.rb
64
64
  - lib/locale_defaulter.rb
65
- - lib/locale_defaulter.rb~
66
65
  - lib/locale_deleter.rb
67
- - lib/locale_deleter.rb~
68
66
  - lib/locale_lister.rb
69
- - lib/locale_lister.rb~
70
67
  - lib/locales/de
71
68
  - lib/locales/default
72
69
  - lib/locales/en
@@ -74,7 +71,6 @@ files:
74
71
  - lib/locales/sv
75
72
  - lib/nodes/basenodes.rb
76
73
  - lib/nodes/scopemanager.rb
77
- - lib/nodes/scopemanager.rb~
78
74
  - lib/nodes/stmtnodes.rb
79
75
  - lib/rdparse.rb
80
76
  - lib/rdparse_quiet.rb
File without changes
File without changes
File without changes
File without changes