tuga 0.3.0 → 0.4.0

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
- SHA1:
3
- metadata.gz: 28751c61ea79e144aaea9b7b00f0c8a7f96304e3
4
- data.tar.gz: 5d0b096140744946c5b688755cf611cca6cfadd8
2
+ SHA256:
3
+ metadata.gz: 1182e218e335d3ef1b2a6e208acb6956cb755979b8ccbe3d3ea630e44da861ac
4
+ data.tar.gz: b8e59510a68c9759b0a3321e9c1079de4a7502cbff6b0f8f3663bc9ef1b44e85
5
5
  SHA512:
6
- metadata.gz: fed9575dd657d225d73dd29804d4c0270439110d0529743c0adffb0a884fcd94844a95b0743ccb08c1040e83a25d575d28c3f246f4c95131b12000e2f1818042
7
- data.tar.gz: 367dbd10929da6a1b997ba9ef090f8d829671cc1136ecf1456252977e1b791c903f3d36ef02f1c56e6b18f76e50456936202768f804381d6421a07d64697fc72
6
+ metadata.gz: b676302db8f8287946e551526b91d6401356cf86ec8869140e5a498dbec170203503b582147ec371e90d458ef14f2787ccc251f0348ab1566d621e5acda7380e
7
+ data.tar.gz: de1372d83323034cc381d8d1790417543c2b9ce133809cf0cb4fa88a45f505bf15937339ad9f96fa3b9ca40eee72ffbd7df17c9f415381e5fba11f16d184000e
@@ -3,6 +3,8 @@ require: rubocop-rspec
3
3
  AllCops:
4
4
  DisplayCopNames: true
5
5
  NewCops: enable
6
+ Exclude:
7
+ - lib/tuga/ruby_parser_patches.rb
6
8
 
7
9
  # ----------------------- Layout ----------------------
8
10
 
@@ -1 +1 @@
1
- ruby 2.4.10
1
+ ruby 2.6.6
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.4.0] - 2020-07-11
8
+ ### Changed
9
+ - Set the minimum Ruby version to 2.6.
10
+
11
+ ### Fixed
12
+ - Fixed the homepage and source code URIs
13
+
7
14
  ## [0.3.0] - 2020-07-05
8
15
  ### Added
9
16
  - Added an ability to transpile Tuga code without requiring the core extensions to the standard library
@@ -25,6 +32,7 @@ by updating it from `~ 10.0` to `~ 12.3`.
25
32
  - Initial core functionality
26
33
  - Codebase maintenance tools
27
34
 
35
+ [0.4.0]: https://github.com/wilsonsilva/tuga/compare/v0.3.0...v0.4.0
28
36
  [0.3.0]: https://github.com/wilsonsilva/tuga/compare/v0.2.0...v0.3.0
29
37
  [0.2.0]: https://github.com/wilsonsilva/tuga/compare/v0.1.0...v0.2.0
30
38
  [0.1.0]: https://github.com/wilsonsilva/tuga/compare/ba17557...v0.1.0
data/README.md CHANGED
@@ -11,7 +11,7 @@ A Portuguese script programming language meant for educational purposes.
11
11
 
12
12
  ## Requirements
13
13
 
14
- The gem requires the version 2.4 of the Ruby programming language. It won't work with later versions yet.
14
+ The gem requires version 2.6 of the Ruby programming language.
15
15
 
16
16
  ## Installation
17
17
 
data/bin/tuga CHANGED
@@ -14,8 +14,8 @@ else
14
14
  ARGV.each do |file_path|
15
15
  next unless file_path
16
16
 
17
- unless Gem::Requirement.new('~> 2.4.0').satisfied_by?(Gem::Version.new(RUBY_VERSION))
18
- raise 'O requisito mínimo para executar é Ruby 2.4'
17
+ unless Gem::Requirement.new('~> 2.6.0').satisfied_by?(Gem::Version.new(RUBY_VERSION))
18
+ raise 'O requisito mínimo para executar é Ruby 2.6'
19
19
  end
20
20
 
21
21
  transpiler = Tuga::Transpiler.new
@@ -3,94 +3,65 @@
3
3
  module RubyParserStuff
4
4
  # Language patches to Ruby Parser
5
5
  class Keyword
6
- keywords = [
7
- ['fim', %i[kEND kEND], :expr_end],
8
- ['definir', %i[kDEF kDEF], :expr_fname],
9
- ['resgatar', %i[kRESCUE kRESCUE_MOD], :expr_mid],
10
- ['produzir', %i[kYIELD kYIELD], :expr_arg],
11
- ['sujeito', %i[kSELF kSELF], :expr_end],
12
- ['falso', %i[kFALSE kFALSE], :expr_end],
13
- ['tentar_novamente', %i[kRETRY kRETRY], :expr_end],
14
- ['retornar', %i[kRETURN kRETURN], :expr_mid],
15
- ['verdadeiro', %i[kTRUE kTRUE], :expr_end],
16
- ['definido?', %i[kDEFINED kDEFINED], :expr_arg],
17
- ['indefinir', %i[kUNDEF kUNDEF], :expr_fname],
18
- ['quebrar', %i[kBREAK kBREAK], :expr_mid],
19
- ['nulo', %i[kNIL kNIL], :expr_end],
20
- ['seguinte', %i[kNEXT kNEXT], :expr_mid],
21
- ['refazer', %i[kREDO kREDO], :expr_end],
22
- ['classe', %i[kCLASS kCLASS], :expr_class],
23
- ['alias', %i[kALIAS kALIAS], :expr_fname],
24
- ['garantir', %i[kENSURE kENSURE], :expr_beg],
25
- ['senão', %i[kELSE kELSE], :expr_beg],
26
- ['senao', %i[kELSE kELSE], :expr_beg],
27
- ['então', %i[kTHEN kTHEN], :expr_beg],
28
- ['entao', %i[kTHEN kTHEN], :expr_beg],
29
- ['fazer', %i[kDO kDO], :expr_beg],
30
- ['início', %i[kBEGIN kBEGIN], :expr_beg],
31
- ['inicio', %i[kBEGIN kBEGIN], :expr_beg]
32
- ]
6
+ expr_woot = EXPR_FNAME|EXPR_FITEM
33
7
 
34
- expression_keywords = [
35
- ['e', %i[kAND kAND], :expr_beg],
36
- ['várias_opções', %i[kCASE kCASE], :expr_beg],
37
- ['varias_opcoes', %i[kCASE kCASE], :expr_beg],
38
- ['senão_se', %i[kELSIF kELSIF], :expr_beg],
39
- ['senao_se', %i[kELSIF kELSIF], :expr_beg],
40
- ['por_cada', %i[kFOR kFOR], :expr_beg],
41
- ['se', %i[kIF kIF_MOD], :expr_beg],
42
- ['na', %i[kIN kIN], :expr_beg],
43
- ['em', %i[kIN kIN], :expr_beg],
44
- ['módulo', %i[kMODULE kMODULE], :expr_beg],
45
- ['modulo', %i[kMODULE kMODULE], :expr_beg],
46
- ['grupo', %i[kMODULE kMODULE], :expr_beg],
47
- ['ou', %i[kOR kOR], :expr_beg],
48
- ['excepto_se', %i[kUNLESS kUNLESS_MOD], :expr_beg],
49
- ['até_que', %i[kUNTIL kUNTIL_MOD], :expr_beg],
50
- ['ate_que', %i[kUNTIL kUNTIL_MOD], :expr_beg],
51
- ['quando', %i[kWHEN kWHEN], :expr_beg],
52
- ['enquanto', %i[kWHILE kWHILE_MOD], :expr_beg]
53
- ]
8
+ wordlist = [
9
+ ["alias", [:kALIAS, :kALIAS ], expr_woot ],
10
+ ["e", [:kAND, :kAND ], EXPR_BEG ],
11
+ ["inicio", [:kBEGIN, :kBEGIN ], EXPR_BEG ],
12
+ ["início", [:kBEGIN, :kBEGIN ], EXPR_BEG ],
13
+ ["quebrar", [:kBREAK, :kBREAK ], EXPR_MID ],
14
+ ["várias_opções", [:kCASE, :kCASE ], EXPR_BEG ],
15
+ ["varias_opcoes", [:kCASE, :kCASE ], EXPR_BEG ],
16
+ ["classe", [:kCLASS, :kCLASS ], EXPR_CLASS ],
17
+ ["def", [:kDEF, :kDEF ], EXPR_FNAME ],
18
+ ["definir", [:kDEF, :kDEF ], EXPR_FNAME ],
19
+ ["definido?", [:kDEFINED, :kDEFINED ], EXPR_ARG ],
20
+ ["fazer", [:kDO, :kDO ], EXPR_BEG ],
21
+ ["senão", [:kELSE, :kELSE ], EXPR_BEG ],
22
+ ["senao", [:kELSE, :kELSE ], EXPR_BEG ],
23
+ ["senão_se", [:kELSIF, :kELSIF ], EXPR_BEG ],
24
+ ["senao_se", [:kELSIF, :kELSIF ], EXPR_BEG ],
25
+ ["fim", [:kEND, :kEND ], EXPR_END ],
26
+ ["garantir", [:kENSURE, :kENSURE ], EXPR_BEG ],
27
+ ["falso", [:kFALSE, :kFALSE ], EXPR_END ],
28
+ ["por_cada", [:kFOR, :kFOR ], EXPR_BEG ],
29
+ ["se", [:kIF, :kIF_MOD ], EXPR_BEG ],
30
+ ["em", [:kIN, :kIN ], EXPR_BEG ],
31
+ ["modulo", [:kMODULE, :kMODULE ], EXPR_BEG ],
32
+ ["grupo", [:kMODULE, :kMODULE ], EXPR_BEG ],
33
+ ["seguinte", [:kNEXT, :kNEXT ], EXPR_MID ],
34
+ ["nulo", [:kNIL, :kNIL ], EXPR_END ],
35
+ ["não", [:kNOT, :kNOT ], EXPR_ARG ],
36
+ ["nao", [:kNOT, :kNOT ], EXPR_ARG ],
37
+ ["ou", [:kOR, :kOR ], EXPR_BEG ],
38
+ ["refazer", [:kREDO, :kREDO ], EXPR_END ],
39
+ ["resgatar", [:kRESCUE, :kRESCUE_MOD ], EXPR_MID ],
40
+ ["tentar_novamente", [:kRETRY, :kRETRY ], EXPR_END ],
41
+ ["retornar", [:kRETURN, :kRETURN ], EXPR_MID ],
42
+ ["sujeito", [:kSELF, :kSELF ], EXPR_END ],
43
+ ["super", [:kSUPER, :kSUPER ], EXPR_ARG ],
44
+ ["então", [:kTHEN, :kTHEN ], EXPR_BEG ],
45
+ ["entao", [:kTHEN, :kTHEN ], EXPR_BEG ],
46
+ ["verdadeiro", [:kTRUE, :kTRUE ], EXPR_END ],
47
+ ["indefinir", [:kUNDEF, :kUNDEF ], expr_woot ],
48
+ ["excepto_se", [:kUNLESS, :kUNLESS_MOD ], EXPR_BEG ],
49
+ ["até_que", [:kUNTIL, :kUNTIL_MOD ], EXPR_BEG ],
50
+ ["ate_que", [:kUNTIL, :kUNTIL_MOD ], EXPR_BEG ],
51
+ ["quando", [:kWHEN, :kWHEN ], EXPR_BEG ],
52
+ ["enquanto", [:kWHILE, :kWHILE_MOD ], EXPR_BEG ],
53
+ ["produzir", [:kYIELD, :kYIELD ], EXPR_ARG ],
54
+ ["BEGIN", [:klBEGIN, :klBEGIN ], EXPR_END ],
55
+ ["END", [:klEND, :klEND ], EXPR_END ],
56
+ ["__FILE__", [:k__FILE__, :k__FILE__ ], EXPR_END ],
57
+ ["__LINE__", [:k__LINE__, :k__LINE__ ], EXPR_END ],
58
+ ["__ENCODING__", [:k__ENCODING__, :k__ENCODING__], EXPR_END],
59
+ ].map { |args|
60
+ KWtable.new(*args)
61
+ }
54
62
 
55
- internal_keywords = [
56
- ['END', %i[klEND klEND], :expr_end],
57
- ['BEGIN', %i[klBEGIN klBEGIN], :expr_end],
58
- ['super', %i[kSUPER kSUPER], :expr_arg],
59
- ['__FILE__', %i[k__FILE__ k__FILE__], :expr_end],
60
- ['__LINE__', %i[k__LINE__ k__LINE__], :expr_end],
61
- ['__ENCODING__', %i[k__ENCODING__ k__ENCODING__], :expr_end]
62
- ]
63
+ # :startdoc:
63
64
 
64
- argument_keywords = [
65
- ['não', %i[kNOT kNOT], :expr_beg],
66
- ['nao', %i[kNOT kNOT], :expr_beg]
67
- ]
68
-
69
- original_verbosity = $VERBOSE
70
- $VERBOSE = nil
71
-
72
- all_keywords = [
73
- keywords,
74
- expression_keywords,
75
- internal_keywords,
76
- argument_keywords
77
- ].flatten(1).map { |args| KWtable.new(*args) }
78
-
79
- WORDLIST18 = Hash[*all_keywords.map { |o| [o.name, o] }.flatten]
80
- WORDLIST19 = Hash[*all_keywords.map { |o| [o.name, o] }.flatten]
81
-
82
- $VERBOSE = original_verbosity
83
-
84
- WORDLIST18.delete '__ENCODING__'
85
-
86
- expression_keywords.each do |k|
87
- WORDLIST19[k[0]] = WORDLIST19[k[0]].dup
88
- WORDLIST19[k[0]].state = :expr_value
89
- end
90
-
91
- argument_keywords.each do |k|
92
- WORDLIST19[k[0]] = WORDLIST19[k[0]].dup
93
- WORDLIST19[k[0]].state = :expr_arg
94
- end
65
+ WORDLIST = Hash[*wordlist.map { |o| [o.name, o] }.flatten]
95
66
  end
96
67
  end
@@ -1,3 +1,3 @@
1
1
  module Tuga
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
@@ -8,12 +8,12 @@ Gem::Specification.new do |spec|
8
8
 
9
9
  spec.summary = 'A Portuguese script programming language.'
10
10
  spec.description = 'A Portuguese script programming language meant for educational purposes.'
11
- spec.homepage = 'https://github.com/willsonsilva/tuga'
11
+ spec.homepage = 'https://github.com/wilsonsilva/tuga'
12
12
  spec.license = 'MIT'
13
- spec.required_ruby_version = Gem::Requirement.new('~> 2.4.0')
13
+ spec.required_ruby_version = Gem::Requirement.new('~> 2.6.0')
14
14
 
15
15
  spec.metadata['homepage_uri'] = spec.homepage
16
- spec.metadata['source_code_uri'] = 'https://github.com/willsonsilva/tuga'
16
+ spec.metadata['source_code_uri'] = 'https://github.com/wilsonsilva/tuga'
17
17
  spec.metadata['changelog_uri'] = 'https://github.com/wilsonsilva/tuga/blob/master/CHANGELOG.md'
18
18
 
19
19
  # Specify which files should be added to the gem when it is released.
@@ -26,9 +26,9 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ['lib']
28
28
 
29
- # These versions of the parsers and transpilers are compatible with Ruby 2.4. Recent versions are not.
29
+ # These versions of the parsers and transpilers are compatible with Ruby 2.6. Recent versions are not.
30
30
  spec.add_dependency 'ruby2ruby', '= 2.4.4'
31
- spec.add_dependency 'ruby_parser', '= 3.12.0'
31
+ spec.add_dependency 'ruby_parser', '= 3.14.2'
32
32
 
33
33
  spec.add_development_dependency 'bundler', '~> 2.0'
34
34
  spec.add_development_dependency 'bundler-audit', '~> 0.6'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tuga
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wilson Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-05 00:00:00.000000000 Z
11
+ date: 2020-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby2ruby
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.12.0
33
+ version: 3.14.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.12.0
40
+ version: 3.14.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -333,12 +333,12 @@ files:
333
333
  - lib/tuga/transpiler.rb
334
334
  - lib/tuga/version.rb
335
335
  - tuga.gemspec
336
- homepage: https://github.com/willsonsilva/tuga
336
+ homepage: https://github.com/wilsonsilva/tuga
337
337
  licenses:
338
338
  - MIT
339
339
  metadata:
340
- homepage_uri: https://github.com/willsonsilva/tuga
341
- source_code_uri: https://github.com/willsonsilva/tuga
340
+ homepage_uri: https://github.com/wilsonsilva/tuga
341
+ source_code_uri: https://github.com/wilsonsilva/tuga
342
342
  changelog_uri: https://github.com/wilsonsilva/tuga/blob/master/CHANGELOG.md
343
343
  post_install_message:
344
344
  rdoc_options: []
@@ -348,15 +348,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
348
348
  requirements:
349
349
  - - "~>"
350
350
  - !ruby/object:Gem::Version
351
- version: 2.4.0
351
+ version: 2.6.0
352
352
  required_rubygems_version: !ruby/object:Gem::Requirement
353
353
  requirements:
354
354
  - - ">="
355
355
  - !ruby/object:Gem::Version
356
356
  version: '0'
357
357
  requirements: []
358
- rubyforge_project:
359
- rubygems_version: 2.6.14.4
358
+ rubygems_version: 3.0.3
360
359
  signing_key:
361
360
  specification_version: 4
362
361
  summary: A Portuguese script programming language.