bato 0.0.9 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +42 -0
- data/README.md +106 -74
- data/Rakefile +2 -0
- data/_config.yml +1 -0
- data/bato.gemspec +6 -5
- data/bin/bato +17 -11
- data/lib/bato/bersiyon.rb +3 -1
- data/lib/bato/core_ext/array.rb +5 -0
- data/lib/bato/core_ext/class.rb +3 -1
- data/lib/bato/core_ext/enumerator.rb +2 -0
- data/lib/bato/core_ext/integer.rb +2 -0
- data/lib/bato/core_ext/kernel.rb +8 -0
- data/lib/bato/core_ext/module.rb +4 -0
- data/lib/bato/core_ext/range.rb +2 -0
- data/lib/bato/core_ext/string.rb +2 -0
- data/lib/bato/core_ext.rb +2 -0
- data/lib/bato/ruby_parser_patches.rb +140 -180
- data/lib/bato/tagatala.rb +3 -1
- data/lib/bato.rb +2 -0
- data/mga_halimbawa/agapan.bt +5 -0
- data/mga_halimbawa/{alyas.bato → alyas.bt} +1 -1
- data/mga_halimbawa/batotris.bt +286 -0
- data/mga_halimbawa/{bilang.bato → bilang.bt} +1 -1
- data/mga_halimbawa/{dapat.bato → dapat.bt} +1 -1
- data/mga_halimbawa/{habang.bato → habang.bt} +1 -1
- data/mga_halimbawa/ihinto.bt +8 -0
- data/mga_halimbawa/{kontrol-sa-pagiikot.bato → kontrol-sa-pagiikot.bt} +7 -7
- data/mga_halimbawa/kumusta_mundo.bt +5 -0
- data/mga_halimbawa/{magbibigay.bato → magbibigay.bt} +3 -3
- data/mga_halimbawa/{maliban_na.bato → maliban_na.bt} +2 -2
- data/mga_halimbawa/{modyul.bato → modyul.bt} +3 -3
- data/mga_halimbawa/{nakatukoy.bato → nakatukoy.bt} +2 -2
- data/mga_halimbawa/{ngunit_kapag.bato → ngunit_kapag.bt} +3 -3
- data/mga_halimbawa/o_ang.bt +3 -0
- data/mga_halimbawa/{pamamaraan-sa-pagkakamali.bato → pamamaraan-sa-pagkakamali.bt} +1 -1
- data/mga_halimbawa/{pangalan.bato → pangalan.bt} +2 -2
- data/mga_halimbawa/panguri.bt +16 -0
- data/mga_halimbawa/{panuntunan.bato → panuntunan.bt} +1 -1
- data/mga_halimbawa/{para_sa.bato → para_sa.bt} +1 -1
- data/mga_halimbawa/{pibonasyi.bato → pibonasyi.bt} +6 -6
- data/mga_halimbawa/siguraduhin.bt +8 -0
- data/mga_halimbawa/{tanggalin.bato → tanggalin.bt} +3 -3
- data/mga_halimbawa/{timebomb.bato → timebomb.bt} +5 -5
- data/spec/bato/tagatala_spec.rb +6 -5
- data/spec/spec_helper.rb +1 -0
- metadata +48 -46
- data/mga_halimbawa/agapan.bato +0 -5
- data/mga_halimbawa/ihinto.bato +0 -8
- data/mga_halimbawa/kumusta_mundo.bato +0 -5
- data/mga_halimbawa/o_ang.bato +0 -3
- data/mga_halimbawa/panguri.bato +0 -13
- data/mga_halimbawa/siguraduhin.bato +0 -8
@@ -2,15 +2,15 @@ grupo MgaAlagangHayop
|
|
2
2
|
KAILANGAN_DAMI_NG_ASO = 5
|
3
3
|
bilang Aso
|
4
4
|
ang tahol
|
5
|
-
|
5
|
+
mag_print "Woof..."
|
6
6
|
wakas
|
7
7
|
|
8
8
|
ang kumanin
|
9
|
-
|
9
|
+
mag_print "..."
|
10
10
|
wakas
|
11
11
|
|
12
12
|
ang ikembot_ang_buntot
|
13
|
-
|
13
|
+
mag_print "Ginagawa ko ito dahil masaya ako!"
|
14
14
|
wakas
|
15
15
|
wakas
|
16
16
|
wakas
|
@@ -2,12 +2,12 @@ grupo Manggagawa
|
|
2
2
|
bilang Magsasaka
|
3
3
|
ang pananim
|
4
4
|
['sibuyas', 'kamatis', 'sili', 'palay', 'mais'].isaisahin na_ganito |pananim|
|
5
|
-
|
5
|
+
mag_print "Mag tatanim ng #{pananim} ngayong panahon"
|
6
6
|
wakas
|
7
7
|
wakas
|
8
8
|
wakas
|
9
9
|
wakas
|
10
10
|
|
11
11
|
kung nakatukoy?(Manggagawa::Magsasaka)
|
12
|
-
|
12
|
+
mag_print 'May nakatukoy!'
|
13
13
|
wakas
|
@@ -1,8 +1,8 @@
|
|
1
1
|
pangalan_mo = "Masipag"
|
2
2
|
kapag_ang pangalan_mo == "Matipuno"
|
3
|
-
|
3
|
+
mag_print "Ikaw ay si Matipuno!"
|
4
4
|
ngunit_kapag_ang pangalan_mo == "Masipag"
|
5
|
-
|
5
|
+
mag_print "Ikaw ay si Masipag!"
|
6
6
|
maliban_sa_mga_ito
|
7
|
-
|
7
|
+
mag_print "Wala kang rekord dito!"
|
8
8
|
wakas
|
@@ -0,0 +1,16 @@
|
|
1
|
+
bilang Robot
|
2
|
+
katangian :pangalan, :kakayahan
|
3
|
+
|
4
|
+
ang magpakilala
|
5
|
+
mag_print <<-INTRO
|
6
|
+
Ako ay isang Robot!
|
7
|
+
Ang pangalan ko ay "#{sariling.pangalan}"
|
8
|
+
Ako ay may kakayahang mag "#{sariling.kakayahan}"
|
9
|
+
INTRO
|
10
|
+
wakas
|
11
|
+
wakas
|
12
|
+
|
13
|
+
robot = Robot.gumawa
|
14
|
+
robot.pangalan = "bot-chukoy"
|
15
|
+
robot.kakayahan = "tambling"
|
16
|
+
robot.magpakilala
|
@@ -51,9 +51,9 @@ ang pibonasyingPaguulitNaUmiikot(n, n1 = 1, n2 = 1)
|
|
51
51
|
magbalik n1
|
52
52
|
wakas
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
mag_print "Gamit ang Panuntunang Pibonasyi sa 10 ay #{pibonasyi 10}"
|
55
|
+
mag_print "Gamit ang Panuntunang Pibonasying May Pagsuksok sa 9 ay #{pibonasyingPagsuksok 9}"
|
56
|
+
mag_print "Gamit ang Panuntunang Pibonasying Inuulit sa 8 ay #{pibonasyingInuulit 8}"
|
57
|
+
mag_print "Gamit ang Panuntunang Pibonasying May Buntot na Inuulit sa 7 ay #{pibonasyingBuntutangInuulit 7}"
|
58
|
+
mag_print "Gamit ang Panuntunang Pibonasying Paguulit sa 6 ay #{pibonasyingPaguulit 6}"
|
59
|
+
mag_print "Gamit ang Panuntunang Pibonasying Paguulit na Umiikot sa 5 ay #{pibonasyingPaguulitNaUmiikot 5}"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
grupo Hayop
|
2
2
|
bilang Aso
|
3
3
|
ang tahol
|
4
|
-
|
4
|
+
mag_print 'baw waw!'
|
5
5
|
wakas
|
6
6
|
wakas
|
7
7
|
wakas
|
@@ -10,7 +10,7 @@ bilang Pusa < Hayop::Aso
|
|
10
10
|
tanggalin tahol
|
11
11
|
|
12
12
|
ang meow
|
13
|
-
|
13
|
+
mag_print 'meow wahu!'
|
14
14
|
wakas
|
15
15
|
wakas
|
16
16
|
|
@@ -19,5 +19,5 @@ pusa = Pusa.kumatawan
|
|
19
19
|
simulan
|
20
20
|
pusa.tahol
|
21
21
|
agapan => pagkakamali
|
22
|
-
|
22
|
+
mag_print "ang pagkakamali ay '#{pagkakamali}'"
|
23
23
|
wakas
|
@@ -4,15 +4,15 @@ grupo TimeBomb
|
|
4
4
|
BILANG = 5
|
5
5
|
bilang Bomba
|
6
6
|
ang tik
|
7
|
-
|
7
|
+
mag_print 'tik'
|
8
8
|
wakas
|
9
9
|
|
10
10
|
ang tok
|
11
|
-
|
11
|
+
mag_print 'tok'
|
12
12
|
wakas
|
13
13
|
|
14
14
|
ang sabog
|
15
|
-
|
15
|
+
mag_print 'kaboom!'
|
16
16
|
wakas
|
17
17
|
wakas
|
18
18
|
wakas
|
@@ -21,7 +21,7 @@ pasabog = TimeBomb::Bomba.gumawa
|
|
21
21
|
|
22
22
|
numero = 1
|
23
23
|
habang numero <= TimeBomb::BILANG ganito
|
24
|
-
|
24
|
+
mag_print "#{numero}"
|
25
25
|
|
26
26
|
kapag (numero == TimeBomb::BILANG)
|
27
27
|
pasabog.sabog
|
@@ -31,7 +31,7 @@ habang numero <= TimeBomb::BILANG ganito
|
|
31
31
|
pasabog.tok
|
32
32
|
wakas
|
33
33
|
|
34
|
-
|
34
|
+
matulog 1
|
35
35
|
numero += 1
|
36
36
|
wakas
|
37
37
|
|
data/spec/bato/tagatala_spec.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
3
|
require 'spec_helper'
|
3
4
|
|
@@ -83,7 +84,7 @@ isalaysay_ang 'Tagatala' do
|
|
83
84
|
subukang_muli
|
84
85
|
iangat pagkakamali, pagkakamali.iulat
|
85
86
|
siguraduhing
|
86
|
-
|
87
|
+
mag_print "Katapusan"
|
87
88
|
katapusan').should be_like(pasimulang_kodigo +
|
88
89
|
'begin
|
89
90
|
(1 / 0)
|
@@ -91,15 +92,15 @@ isalaysay_ang 'Tagatala' do
|
|
91
92
|
retry
|
92
93
|
iangat(pagkakamali, pagkakamali.iulat)
|
93
94
|
ensure
|
94
|
-
|
95
|
+
mag_print("Katapusan")
|
95
96
|
end')
|
96
97
|
end
|
97
98
|
end
|
98
99
|
|
99
100
|
isalaysay_ang 'pamamaraan sa Kernel' do
|
100
|
-
ito_ang "ekspresyon ng pagsusulat gamit ang '
|
101
|
-
tagatala.sa_ruby("
|
102
|
-
pasimulang_kodigo + '
|
101
|
+
ito_ang "ekspresyon ng pagsusulat gamit ang 'mag_print'" do
|
102
|
+
tagatala.sa_ruby("mag_print 'abc'").should ==
|
103
|
+
pasimulang_kodigo + 'mag_print("abc")'
|
103
104
|
end
|
104
105
|
end
|
105
106
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Bryan Juliano
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby2ruby
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.4.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.4.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.2.19
|
34
34
|
type: :development
|
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:
|
40
|
+
version: 2.2.19
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 13.0.6
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 13.0.6
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 3.10.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 3.10.0
|
69
69
|
description: Bato Programming Language
|
70
70
|
email:
|
71
71
|
- joelbryan.juliano@gmail.com
|
@@ -78,10 +78,12 @@ files:
|
|
78
78
|
- ".rspec"
|
79
79
|
- ".travis.yml"
|
80
80
|
- Gemfile
|
81
|
+
- Gemfile.lock
|
81
82
|
- LICENSE.txt
|
82
83
|
- README.md
|
83
84
|
- Rakefile
|
84
85
|
- TODO.md
|
86
|
+
- _config.yml
|
85
87
|
- bato.gemspec
|
86
88
|
- bin/bato
|
87
89
|
- lib/bato.rb
|
@@ -97,36 +99,37 @@ files:
|
|
97
99
|
- lib/bato/core_ext/string.rb
|
98
100
|
- lib/bato/ruby_parser_patches.rb
|
99
101
|
- lib/bato/tagatala.rb
|
100
|
-
- mga_halimbawa/agapan.
|
101
|
-
- mga_halimbawa/alyas.
|
102
|
-
- mga_halimbawa/
|
103
|
-
- mga_halimbawa/
|
104
|
-
- mga_halimbawa/
|
105
|
-
- mga_halimbawa/
|
106
|
-
- mga_halimbawa/
|
107
|
-
- mga_halimbawa/
|
108
|
-
- mga_halimbawa/
|
109
|
-
- mga_halimbawa/
|
110
|
-
- mga_halimbawa/
|
111
|
-
- mga_halimbawa/
|
112
|
-
- mga_halimbawa/
|
113
|
-
- mga_halimbawa/
|
114
|
-
- mga_halimbawa/
|
115
|
-
- mga_halimbawa/
|
116
|
-
- mga_halimbawa/
|
117
|
-
- mga_halimbawa/
|
118
|
-
- mga_halimbawa/
|
119
|
-
- mga_halimbawa/
|
120
|
-
- mga_halimbawa/
|
121
|
-
- mga_halimbawa/
|
122
|
-
- mga_halimbawa/
|
102
|
+
- mga_halimbawa/agapan.bt
|
103
|
+
- mga_halimbawa/alyas.bt
|
104
|
+
- mga_halimbawa/batotris.bt
|
105
|
+
- mga_halimbawa/bilang.bt
|
106
|
+
- mga_halimbawa/dapat.bt
|
107
|
+
- mga_halimbawa/habang.bt
|
108
|
+
- mga_halimbawa/ihinto.bt
|
109
|
+
- mga_halimbawa/kontrol-sa-pagiikot.bt
|
110
|
+
- mga_halimbawa/kumusta_mundo.bt
|
111
|
+
- mga_halimbawa/magbibigay.bt
|
112
|
+
- mga_halimbawa/maliban_na.bt
|
113
|
+
- mga_halimbawa/modyul.bt
|
114
|
+
- mga_halimbawa/nakatukoy.bt
|
115
|
+
- mga_halimbawa/ngunit_kapag.bt
|
116
|
+
- mga_halimbawa/o_ang.bt
|
117
|
+
- mga_halimbawa/pamamaraan-sa-pagkakamali.bt
|
118
|
+
- mga_halimbawa/pangalan.bt
|
119
|
+
- mga_halimbawa/panguri.bt
|
120
|
+
- mga_halimbawa/panuntunan.bt
|
121
|
+
- mga_halimbawa/para_sa.bt
|
122
|
+
- mga_halimbawa/pibonasyi.bt
|
123
|
+
- mga_halimbawa/siguraduhin.bt
|
124
|
+
- mga_halimbawa/tanggalin.bt
|
125
|
+
- mga_halimbawa/timebomb.bt
|
123
126
|
- spec/bato/tagatala_spec.rb
|
124
127
|
- spec/spec_helper.rb
|
125
128
|
homepage: https://github.com/jjuliano/bato
|
126
129
|
licenses:
|
127
130
|
- MIT
|
128
131
|
metadata: {}
|
129
|
-
post_install_message:
|
132
|
+
post_install_message:
|
130
133
|
rdoc_options: []
|
131
134
|
require_paths:
|
132
135
|
- lib
|
@@ -141,9 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
144
|
- !ruby/object:Gem::Version
|
142
145
|
version: '0'
|
143
146
|
requirements: []
|
144
|
-
|
145
|
-
|
146
|
-
signing_key:
|
147
|
+
rubygems_version: 3.2.15
|
148
|
+
signing_key:
|
147
149
|
specification_version: 4
|
148
150
|
summary: Ang Bato ay isang programming language sa wikang Filipino
|
149
151
|
test_files:
|
data/mga_halimbawa/agapan.bato
DELETED
data/mga_halimbawa/ihinto.bato
DELETED
data/mga_halimbawa/o_ang.bato
DELETED
data/mga_halimbawa/panguri.bato
DELETED