italian-ruby 0.7.0 → 0.7.5
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.
- checksums.yaml +4 -4
- data/italian-ruby.gemspec +0 -2
- data/lib/italian/ruby/core_ext.rb +2 -0
- data/lib/italian/ruby/core_ext/false_class.rb +6 -0
- data/lib/italian/ruby/core_ext/gems/bson.rb +4 -0
- data/lib/italian/ruby/core_ext/kernel.rb +14 -5
- data/lib/italian/ruby/core_ext/object.rb +6 -0
- data/lib/italian/ruby/core_ext/true_class.rb +6 -0
- data/lib/italian/ruby/errore.rb +52 -0
- data/lib/italian/ruby/traduttore.rb +127 -16
- data/lib/italian/ruby/utils/debug.rb +2 -2
- data/lib/italian/ruby/version.rb +1 -1
- metadata +5 -17
- data/lib/italian/ruby/ruby_parser_patches.rb +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48cc09a35b9e1a56017fe57be1cd9e6c154b57c134423c3afd06dfb1e7823020
|
4
|
+
data.tar.gz: fdf45318b499ea99626b9bb5f8bf3448905687c72cac3d265544f29c504b3e79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc23839f70b4882860aec5e7387917c288cca81b1159df28b525ffb92511beba05b8ac013e856611e1177c63ec60a2a5fce99e2fd3ef0a68a1ca0fbb8cb9b18c
|
7
|
+
data.tar.gz: b1e4baa805a1de4e2bb893084089e377e69c5acb81b1fb91e0014828d9e6e8f0e35aeb2f5f1f05adedf0ec2a4e6a6dbc4f458fb4cdc439ab477876b79b2c93e9
|
data/italian-ruby.gemspec
CHANGED
@@ -28,8 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
|
-
spec.add_dependency 'ruby2ruby', '~> 2.4'
|
32
|
-
|
33
31
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
34
32
|
spec.add_development_dependency 'rake', '~> 13.0'
|
35
33
|
spec.add_development_dependency 'rspec', '~> 3.9'
|
@@ -11,6 +11,8 @@ require_relative "core_ext/kernel"
|
|
11
11
|
require_relative "core_ext/proc"
|
12
12
|
require_relative "core_ext/errors"
|
13
13
|
require_relative "core_ext/nil_class"
|
14
|
+
require_relative "core_ext/false_class"
|
15
|
+
require_relative "core_ext/true_class"
|
14
16
|
require_relative "core_ext/json"
|
15
17
|
require_relative "core_ext/object"
|
16
18
|
require_relative "core_ext/array"
|
@@ -17,7 +17,12 @@ module Kernel
|
|
17
17
|
file_to_require = $:.map { |dir| Dir["#{dir}/**/#{name}.ir"] }.flatten.compact.first
|
18
18
|
|
19
19
|
if file_to_require.nil?
|
20
|
-
|
20
|
+
begin
|
21
|
+
require name
|
22
|
+
rescue SyntaxError => errore
|
23
|
+
riga = errore.message.split("\n").first.split(":")[1].to_i rescue 0
|
24
|
+
Italian::Ruby::Errore::Sintassi.new("Errore di sintassi.", name, riga, 0).stampa
|
25
|
+
end
|
21
26
|
else
|
22
27
|
traduci_e_carica file_to_require
|
23
28
|
end
|
@@ -27,6 +32,8 @@ module Kernel
|
|
27
32
|
caller_location_dir = File.dirname caller_locations.first.absolute_path
|
28
33
|
if caller_location_dir.start_with?(Italian::Ruby.translations_dir_path)
|
29
34
|
caller_location_dir = caller_location_dir[Italian::Ruby.translations_dir_path.length..-1]
|
35
|
+
elsif caller_location_dir.include?(".italian-ruby/")
|
36
|
+
caller_location_dir.gsub! ".italian-ruby/", ""
|
30
37
|
end
|
31
38
|
caller_location_file = File.expand_path "#{caller_location_dir}/#{name}"
|
32
39
|
file_to_require = Dir["#{caller_location_file}.{ir,rb}"].compact.first
|
@@ -70,10 +77,12 @@ module Kernel
|
|
70
77
|
end
|
71
78
|
|
72
79
|
File.write parsed_file, parsed_code
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
80
|
+
begin
|
81
|
+
require parsed_file
|
82
|
+
rescue SyntaxError => errore
|
83
|
+
riga = errore.message.split("\n").first.split(":")[1].to_i rescue 0
|
84
|
+
Italian::Ruby::Errore::Sintassi.new("Errore di sintassi.", parsed_file, riga, 0).stampa
|
85
|
+
end
|
77
86
|
end
|
78
87
|
|
79
88
|
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require_relative "utils/debug"
|
2
|
+
|
3
|
+
module Italian
|
4
|
+
module Ruby
|
5
|
+
class Errore < StandardError
|
6
|
+
class Sintassi < Errore; end
|
7
|
+
class NonSupportato < Errore; end
|
8
|
+
class IndividuazioneStringa < Errore; end
|
9
|
+
|
10
|
+
def initialize(messaggio = nil, file = nil, riga = 0, posizione = 0)
|
11
|
+
@messaggio = messaggio
|
12
|
+
@file = file
|
13
|
+
@riga = riga
|
14
|
+
@posizione = posizione
|
15
|
+
begin
|
16
|
+
@linea = File.readlines(@file)[@riga - 1]
|
17
|
+
rescue StandardError => e
|
18
|
+
@linea = "Non è stato possibile recuperare la riga #{@riga} del file."
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def stampa
|
23
|
+
prova_ad_ottenere_maggiori_informazioni
|
24
|
+
puts "-----------------------------------------------------------------------------".alzavola
|
25
|
+
puts "Si è verificato un errore durante la traduzione del file `#{@file}`."
|
26
|
+
print "L'errore è: "
|
27
|
+
puts "#{self.class}.".rosso
|
28
|
+
puts @messaggio
|
29
|
+
puts
|
30
|
+
print "Riga: "
|
31
|
+
puts "#{@riga}".ciano
|
32
|
+
puts @linea
|
33
|
+
puts "^".rjust(@posizione + 1, " ").verde_lime
|
34
|
+
puts
|
35
|
+
puts "-----------------------------------------------------------------------------".alzavola
|
36
|
+
exit 1
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
##
|
42
|
+
# Prova a recuperare maggiori informazioni su errore.
|
43
|
+
def prova_ad_ottenere_maggiori_informazioni
|
44
|
+
case
|
45
|
+
when self.class.is_a?(Sintassi)
|
46
|
+
# TO DO
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -1,30 +1,141 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require
|
3
|
-
|
4
|
-
require_relative
|
2
|
+
require "rainbow"
|
3
|
+
require_relative "utils/debug"
|
4
|
+
require_relative "errore"
|
5
5
|
|
6
6
|
module Italian
|
7
7
|
module Ruby
|
8
8
|
class Traduttore
|
9
9
|
|
10
|
+
STAMPA_DETTAGLI_TRADUZIONE = false
|
11
|
+
|
10
12
|
class << self
|
11
13
|
|
12
|
-
def traduci(file)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
14
|
+
def traduci(file = nil, &block)
|
15
|
+
if not file.nil?
|
16
|
+
codice_tradotto = File.readlines(file).map.with_index do |linea, riga|
|
17
|
+
traduci_linea file, linea, riga
|
18
|
+
end
|
19
|
+
codice_tradotto.join
|
20
|
+
else
|
21
|
+
if block_given?
|
22
|
+
begin
|
23
|
+
block.call
|
24
|
+
rescue StandardError => errore
|
25
|
+
Italian::Ruby::Errore.new([ errore.message, errore.backtrace ].join("\n"), "-", 0, 0).stampa
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def traduci_linea(file, linea, riga)
|
32
|
+
puts "Traduco linea [#{riga}]: #{linea.inspect}".magenta if STAMPA_DETTAGLI_TRADUZIONE
|
33
|
+
posizione_commento = linea.index(%{#}) || linea.length
|
34
|
+
posizione_stringa_singola = linea.index(%{'}) || linea.length
|
35
|
+
posizione_stringa_doppia = linea.index(%{"}) || linea.length
|
36
|
+
contesto = [
|
37
|
+
file, linea, riga,
|
38
|
+
posizione_commento,
|
39
|
+
posizione_stringa_singola,
|
40
|
+
posizione_stringa_doppia ]
|
41
|
+
|
42
|
+
controlla_stringa_singola *contesto
|
43
|
+
controlla_stringa_doppia *contesto
|
44
|
+
|
45
|
+
if posizione_commento < posizione_stringa_doppia
|
46
|
+
pezzi_da_tradurre = [
|
47
|
+
linea[0..posizione_commento],
|
48
|
+
linea[posizione_commento + 1..]
|
49
|
+
]
|
50
|
+
elsif posizione_stringa_doppia < posizione_commento
|
51
|
+
pezzi_da_tradurre = linea.scan( /([^"]*)("[^"]*")([^"]*)/ ).flatten
|
52
|
+
else
|
53
|
+
pezzi_da_tradurre = [ linea ]
|
54
|
+
end
|
55
|
+
|
56
|
+
debug pezzi_da_tradurre if STAMPA_DETTAGLI_TRADUZIONE
|
57
|
+
linea_tradotta = pezzi_da_tradurre.map { |pezzo| traduci_pezzo pezzo }.join
|
58
|
+
|
59
|
+
if STAMPA_DETTAGLI_TRADUZIONE
|
60
|
+
puts "Linea tradotta [#{riga}]: #{linea_tradotta.inspect}".verde_lime
|
61
|
+
puts
|
25
62
|
end
|
63
|
+
linea_tradotta
|
26
64
|
end
|
27
65
|
|
66
|
+
private
|
67
|
+
|
68
|
+
def controlla_stringa_singola(file, linea, riga, posizione_commento, posizione_stringa_singola, posizione_stringa_doppia)
|
69
|
+
if posizione_stringa_singola < posizione_commento and posizione_stringa_singola < posizione_stringa_doppia
|
70
|
+
Italian::Ruby::Errore::NonSupportato.new(
|
71
|
+
"Le stringhe con singolo apice non sono supportate.",
|
72
|
+
file, riga, posizione_stringa_singola).stampa
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def controlla_stringa_doppia(file, linea, riga, posizione_commento, posizione_stringa_singola, posizione_stringa_doppia)
|
77
|
+
return if posizione_commento <= posizione_stringa_doppia
|
78
|
+
|
79
|
+
prossima_posizione_stringa_doppia = linea[posizione_stringa_doppia + 1..].index %{"}
|
80
|
+
if prossima_posizione_stringa_doppia.nil?
|
81
|
+
Italian::Ruby::Errore::IndividuazioneStringa.new(
|
82
|
+
"Non è stato possibile trovare la terminazione della stringa.",
|
83
|
+
file, riga, posizione_stringa_doppia).stampa
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def traduci_pezzo(pezzo)
|
88
|
+
return pezzo if pezzo.nil? or pezzo.length == 0
|
89
|
+
return pezzo if pezzo.start_with? %{#}
|
90
|
+
return pezzo if pezzo.start_with? %{"}
|
91
|
+
|
92
|
+
pezzo.gsub! /(\b)e(\b)/, "\\1and\\2"
|
93
|
+
pezzo.gsub! /(\b)inizia(\b)/, "\\1begin\\2"
|
94
|
+
pezzo.gsub! /(\b)blocco_dato\?(\b)/, "\\1block_given?\\2"
|
95
|
+
pezzo.gsub! /(\b)esci(\b)/, "\\1break\\2"
|
96
|
+
pezzo.gsub! /(\b)considera(\b)/, "\\1case\\2"
|
97
|
+
pezzo.gsub! /(\b)classe([\s]+[A-Z][\w]*)/, "\\1class\\2"
|
98
|
+
pezzo.gsub! /(\b)classe([\s]+)(<<)([\s]+)/, "\\1class\\2\\3\\4"
|
99
|
+
pezzo.gsub! /(\b)definisci([\s]+[^\s]+)/, "\\1def\\2"
|
100
|
+
pezzo.gsub! /(\b)definito\?([\s]+[^\s]+)/, "\\1defined?\\2"
|
101
|
+
pezzo.gsub! /(\b)definita\?([\s]+[^\s]+)/, "\\1defined?\\2"
|
102
|
+
pezzo.gsub! /(\b)esegui(\b)/, "\\1do\\2"
|
103
|
+
pezzo.gsub! /(\b)altrimenti(\b)/, "\\1else\\2"
|
104
|
+
pezzo.gsub! /(\b)altrimenti_se(\b)/, "\\1elsif\\2"
|
105
|
+
pezzo.gsub! /(\b)fine(\b)/, "\\1end\\2"
|
106
|
+
pezzo.gsub! /(\b)assicura(\b)/, "\\1ensure\\2"
|
107
|
+
pezzo.gsub! /(\b)estendi([\s]+[A-Z][\w]*)/, "\\1extend\\2"
|
108
|
+
pezzo.gsub! /(\b)no(\b)/, "\\1false\\2"
|
109
|
+
pezzo.gsub! /(\b)falso(\b)/, "\\1false\\2"
|
110
|
+
pezzo.gsub! /(\b)per(\b)/, "\\1for\\2"
|
111
|
+
pezzo.gsub! /(\b)se(\b)/, "\\1if\\2"
|
112
|
+
pezzo.gsub! /(\b)includi([\s]+[A-Z][\w]*)/, "\\1include\\2"
|
113
|
+
pezzo.gsub! /(\b)modulo([\s]+[A-Z][\w]*)/, "\\1module\\2"
|
114
|
+
pezzo.gsub! /(\b)prossimo(\b)/, "\\1next\\2"
|
115
|
+
pezzo.gsub! /(\b)prossima(\b)/, "\\1next\\2"
|
116
|
+
pezzo.gsub! /(\b)nullo(\b)/, "\\1nil\\2"
|
117
|
+
pezzo.gsub! /(\b)nulla(\b)/, "\\1nil\\2"
|
118
|
+
pezzo.gsub! /(\b)non(\b)/, "\\1not\\2"
|
119
|
+
pezzo.gsub! /(\b)o(\b)/, "\\1or\\2"
|
120
|
+
pezzo.gsub! /(\b)preponi([\s]+[A-Z][\w]*)/, "\\1prepend\\2"
|
121
|
+
pezzo.gsub! /(\b)riesegui(\b)/, "\\1redo\\2"
|
122
|
+
pezzo.gsub! /(\b)recupera(\b)/, "\\1rescue\\2"
|
123
|
+
pezzo.gsub! /(\b)riprova(\b)/, "\\1retry\\2"
|
124
|
+
pezzo.gsub! /(\b)ritorna(\b)/, "\\1return\\2"
|
125
|
+
pezzo.gsub! /(\b)istanza/, "\\1self"
|
126
|
+
pezzo.gsub! /(\b)se_stesso/, "\\1self"
|
127
|
+
pezzo.gsub! /(\b)se_stessa/, "\\1self"
|
128
|
+
pezzo.gsub! /(\b)allora(\b)/, "\\1then\\2"
|
129
|
+
pezzo.gsub! /(\b)si(\b)/, "\\1true\\2"
|
130
|
+
pezzo.gsub! /(\b)vero(\b)/, "\\1true\\2"
|
131
|
+
pezzo.gsub! /(\b)a_meno_che(\b)/, "\\1unless\\2"
|
132
|
+
pezzo.gsub! /(\b)finché(\b)/, "\\1until\\2"
|
133
|
+
pezzo.gsub! /(\b)quando(\b)/, "\\1when\\2"
|
134
|
+
pezzo.gsub! /(\b)mentre(\b)/, "\\1while\\2"
|
135
|
+
pezzo.gsub! /(\b)rilascia(\b)/, "\\1yield\\2"
|
136
|
+
pezzo
|
137
|
+
end
|
138
|
+
|
28
139
|
end
|
29
140
|
|
30
141
|
end
|
data/lib/italian/ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: italian-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francesco Ballardin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: ruby2ruby
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.4'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.4'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: bundler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,6 +78,7 @@ files:
|
|
92
78
|
- lib/italian/ruby/core_ext/date.rb
|
93
79
|
- lib/italian/ruby/core_ext/enumerator.rb
|
94
80
|
- lib/italian/ruby/core_ext/errors.rb
|
81
|
+
- lib/italian/ruby/core_ext/false_class.rb
|
95
82
|
- lib/italian/ruby/core_ext/file.rb
|
96
83
|
- lib/italian/ruby/core_ext/float.rb
|
97
84
|
- lib/italian/ruby/core_ext/gems/bson.rb
|
@@ -113,7 +100,8 @@ files:
|
|
113
100
|
- lib/italian/ruby/core_ext/string.rb
|
114
101
|
- lib/italian/ruby/core_ext/symbol.rb
|
115
102
|
- lib/italian/ruby/core_ext/time.rb
|
116
|
-
- lib/italian/ruby/
|
103
|
+
- lib/italian/ruby/core_ext/true_class.rb
|
104
|
+
- lib/italian/ruby/errore.rb
|
117
105
|
- lib/italian/ruby/traduttore.rb
|
118
106
|
- lib/italian/ruby/utils/debug.rb
|
119
107
|
- lib/italian/ruby/version.rb
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyParserStuff
|
4
|
-
class Keyword
|
5
|
-
expr_woot = EXPR_FNAME|EXPR_FITEM
|
6
|
-
|
7
|
-
italian_wordlist = [
|
8
|
-
["alias", [:kALIAS, :kALIAS ], expr_woot ],
|
9
|
-
["e", [:kAND, :kAND ], EXPR_BEG ],
|
10
|
-
["inizia", [:kBEGIN, :kBEGIN ], EXPR_BEG ],
|
11
|
-
["esci", [:kBREAK, :kBREAK ], EXPR_MID ],
|
12
|
-
["considera", [:kCASE, :kCASE ], EXPR_BEG ],
|
13
|
-
["classe", [:kCLASS, :kCLASS ], EXPR_CLASS ],
|
14
|
-
["def", [:kDEF, :kDEF ], EXPR_FNAME ],
|
15
|
-
["definisci", [:kDEF, :kDEF ], EXPR_FNAME ],
|
16
|
-
["definito?", [:kDEFINED, :kDEFINED ], EXPR_ARG ],
|
17
|
-
["definita?", [:kDEFINED, :kDEFINED ], EXPR_ARG ],
|
18
|
-
["esegui", [:kDO, :kDO ], EXPR_BEG ],
|
19
|
-
["fai", [:kDO, :kDO ], EXPR_BEG ],
|
20
|
-
["altrimenti", [:kELSE, :kELSE ], EXPR_BEG ],
|
21
|
-
["altrimenti_se", [:kELSIF, :kELSIF ], EXPR_BEG ],
|
22
|
-
["fine", [:kEND, :kEND ], EXPR_END ],
|
23
|
-
["assicura", [:kENSURE, :kENSURE ], EXPR_BEG ],
|
24
|
-
["no", [:kFALSE, :kFALSE ], EXPR_END ],
|
25
|
-
["falso", [:kFALSE, :kFALSE ], EXPR_END ],
|
26
|
-
["per", [:kFOR, :kFOR ], EXPR_BEG ],
|
27
|
-
["se", [:kIF, :kIF_MOD ], EXPR_BEG ],
|
28
|
-
["in", [:kIN, :kIN ], EXPR_BEG ],
|
29
|
-
["modulo", [:kMODULE, :kMODULE ], EXPR_BEG ],
|
30
|
-
["prossimo", [:kNEXT, :kNEXT ], EXPR_MID ],
|
31
|
-
["prossima", [:kNEXT, :kNEXT ], EXPR_MID ],
|
32
|
-
["nullo", [:kNIL, :kNIL ], EXPR_END ],
|
33
|
-
["nulla", [:kNIL, :kNIL ], EXPR_END ],
|
34
|
-
["non", [:kNOT, :kNOT ], EXPR_ARG ],
|
35
|
-
["o", [:kOR, :kOR ], EXPR_BEG ],
|
36
|
-
["rifai", [:kREDO, :kREDO ], EXPR_END ],
|
37
|
-
["riesegui", [:kREDO, :kREDO ], EXPR_END ],
|
38
|
-
["recupera", [:kRESCUE, :kRESCUE_MOD ], EXPR_MID ],
|
39
|
-
["riprova", [:kRETRY, :kRETRY ], EXPR_END ],
|
40
|
-
["ritorna", [:kRETURN, :kRETURN ], EXPR_MID ],
|
41
|
-
["istanza", [:kSELF, :kSELF ], EXPR_END ],
|
42
|
-
["se_stesso", [:kSELF, :kSELF ], EXPR_END ],
|
43
|
-
["se_stessa", [:kSELF, :kSELF ], EXPR_END ],
|
44
|
-
["super", [:kSUPER, :kSUPER ], EXPR_ARG ],
|
45
|
-
["allora", [:kTHEN, :kTHEN ], EXPR_BEG ],
|
46
|
-
["si", [:kTRUE, :kTRUE ], EXPR_END ],
|
47
|
-
["vero", [:kTRUE, :kTRUE ], EXPR_END ],
|
48
|
-
["undef", [:kUNDEF, :kUNDEF ], expr_woot ],
|
49
|
-
["a_meno_che", [:kUNLESS, :kUNLESS_MOD ], EXPR_BEG ],
|
50
|
-
["finché", [:kUNTIL, :kUNTIL_MOD ], EXPR_BEG ],
|
51
|
-
["quando", [:kWHEN, :kWHEN ], EXPR_BEG ],
|
52
|
-
["mentre", [:kWHILE, :kWHILE_MOD ], EXPR_BEG ],
|
53
|
-
["rilascia", [:kYIELD, :kYIELD ], EXPR_ARG ],
|
54
|
-
["INIZIA", [:klBEGIN, :klBEGIN ], EXPR_END ],
|
55
|
-
["FINE", [: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| KWtable.new(*args) }
|
60
|
-
|
61
|
-
ITALIAN_WORDLIST = Hash[*italian_wordlist.map { |o| [o.name, o] }.flatten]
|
62
|
-
|
63
|
-
def self.keyword str
|
64
|
-
ITALIAN_WORDLIST[str]
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|