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 +5 -5
- data/.rubocop.yml +2 -0
- data/.tool-versions +1 -1
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/bin/tuga +2 -2
- data/lib/tuga/ruby_parser_patches.rb +57 -86
- data/lib/tuga/version.rb +1 -1
- data/tuga.gemspec +5 -5
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1182e218e335d3ef1b2a6e208acb6956cb755979b8ccbe3d3ea630e44da861ac
|
4
|
+
data.tar.gz: b8e59510a68c9759b0a3321e9c1079de4a7502cbff6b0f8f3663bc9ef1b44e85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b676302db8f8287946e551526b91d6401356cf86ec8869140e5a498dbec170203503b582147ec371e90d458ef14f2787ccc251f0348ab1566d621e5acda7380e
|
7
|
+
data.tar.gz: de1372d83323034cc381d8d1790417543c2b9ce133809cf0cb4fa88a45f505bf15937339ad9f96fa3b9ca40eee72ffbd7df17c9f415381e5fba11f16d184000e
|
data/.rubocop.yml
CHANGED
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 2.
|
1
|
+
ruby 2.6.6
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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.
|
18
|
-
raise 'O requisito mínimo para executar é Ruby 2.
|
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
|
-
|
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
|
-
|
35
|
-
[
|
36
|
-
[
|
37
|
-
[
|
38
|
-
[
|
39
|
-
[
|
40
|
-
[
|
41
|
-
[
|
42
|
-
[
|
43
|
-
[
|
44
|
-
[
|
45
|
-
[
|
46
|
-
[
|
47
|
-
[
|
48
|
-
[
|
49
|
-
[
|
50
|
-
[
|
51
|
-
[
|
52
|
-
[
|
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
|
-
|
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
|
-
|
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
|
data/lib/tuga/version.rb
CHANGED
data/tuga.gemspec
CHANGED
@@ -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/
|
11
|
+
spec.homepage = 'https://github.com/wilsonsilva/tuga'
|
12
12
|
spec.license = 'MIT'
|
13
|
-
spec.required_ruby_version = Gem::Requirement.new('~> 2.
|
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/
|
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.
|
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.
|
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.
|
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-
|
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.
|
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.
|
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/
|
336
|
+
homepage: https://github.com/wilsonsilva/tuga
|
337
337
|
licenses:
|
338
338
|
- MIT
|
339
339
|
metadata:
|
340
|
-
homepage_uri: https://github.com/
|
341
|
-
source_code_uri: https://github.com/
|
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.
|
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
|
-
|
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.
|