bato 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +0 -1
- data/Gemfile +2 -0
- data/README.md +31 -1
- data/Rakefile +2 -0
- data/bato.gemspec +2 -1
- data/bin/bato +7 -3
- data/lib/bato.rb +2 -0
- data/lib/bato/bersiyon.rb +3 -1
- data/lib/bato/core_ext.rb +2 -0
- data/lib/bato/core_ext/array.rb +2 -0
- data/lib/bato/core_ext/class.rb +2 -0
- 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 +6 -0
- data/lib/bato/core_ext/module.rb +3 -0
- data/lib/bato/core_ext/range.rb +2 -0
- data/lib/bato/core_ext/string.rb +2 -0
- data/lib/bato/ruby_parser_patches.rb +146 -173
- data/lib/bato/tagatala.rb +3 -1
- data/mga_halimbawa/batotris.bt +1 -1
- data/mga_halimbawa/panguri.bt +12 -9
- data/spec/bato/tagatala_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 59fba35aba486e82a7ebb3ce3c59346378e4a334cd99400e5724870ee1f7b474
|
4
|
+
data.tar.gz: f1df3b43c32b4a2dc948a3acf7c7788210ee7b0e80490eb7fd1a7a06207740d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2bc93400a00a977746147eed3d862a3df284f180e329b3a7ded32d057220d481b99986dba9ac291010b588172326ff434b296d9f1dd4cb0f4649ac7b1446f1c
|
7
|
+
data.tar.gz: 53860efda9706683be779313ee84ad1e05539992e53fc34097af42403d2e85af4c0b54246a4e26607a1ebdf3921c090b9a92322caf92a015836a063240434a84
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Ang 'Bato Programming Language' ay isang scripting language sa wikang Filipino.
|
4
4
|
|
5
|
-
Subukan ang [Bato](https://trybato.herokuapp.com/)
|
5
|
+
Subukan ang [Bato](https://trybato.herokuapp.com/) gamit ang *interactive online console* .
|
6
6
|
|
7
7
|
## Pagtatalaga
|
8
8
|
|
@@ -623,10 +623,40 @@ Halimbawa
|
|
623
623
|
totoo o mali
|
624
624
|
=> totoo
|
625
625
|
|
626
|
+
### katangian
|
627
|
+
|
628
|
+
Ang 'katangian' ay ginagamit upang makapag takda at makapag basa ng *value* sa katangian na ipinahayag sa loob ng grupo.
|
629
|
+
|
630
|
+
katangian
|
631
|
+
panguri
|
632
|
+
|
633
|
+
Halimbawa
|
634
|
+
|
635
|
+
bilang Robot
|
636
|
+
katangian :pangalan, :kakayahan
|
637
|
+
|
638
|
+
ang magpakilala
|
639
|
+
mag_print <<-INTRO
|
640
|
+
Ako ay isang Robot!
|
641
|
+
Ang pangalan ko ay "#{sariling.pangalan}"
|
642
|
+
Ako ay may kakayahang mag "#{sariling.kakayahan}"
|
643
|
+
INTRO
|
644
|
+
wakas
|
645
|
+
wakas
|
646
|
+
|
647
|
+
robot = Robot.gumawa
|
648
|
+
robot.pangalan = "bot-chukoy"
|
649
|
+
robot.kakayahan = "tambling"
|
650
|
+
robot.magpakilala
|
651
|
+
|
626
652
|
## Pagtulong sa pagdedevelop ng Bato
|
627
653
|
|
628
654
|
Magpadala ng mga kahilingan sa paggawa ng ticket.
|
629
655
|
|
656
|
+
## Media
|
657
|
+
|
658
|
+
* Na *feature* ang Bato programming language sa isang international news website na [The Register](https://www.theregister.co.uk/2018/03/21/philippines_ruby_bato). Mababasa ang artikel sa [https://www.theregister.co.uk/2018/03/21/philippines_ruby_bato](https://www.theregister.co.uk/2018/03/21/philippines_ruby_bato).
|
659
|
+
|
630
660
|
## Lisensya
|
631
661
|
|
632
662
|
Instituto Ng Tekonolohiya sa Massachusetts License (makikita sa LICENSE.txt na file).
|
data/Rakefile
CHANGED
data/bato.gemspec
CHANGED
data/bin/bato
CHANGED
@@ -1,21 +1,25 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
require 'bato/tagatala'
|
3
5
|
require 'rubygems'
|
4
6
|
|
5
7
|
if ARGV[0].nil?
|
6
|
-
puts
|
7
|
-
Hindi tinukoy ang file. Ang tamang sintaks ay:
|
8
|
+
puts <<~EOS
|
9
|
+
Hindi tinukoy ang file. Ang tamang sintaks ay:
|
8
10
|
|
9
|
-
bato file.bt
|
11
|
+
bato file.bt
|
10
12
|
EOS
|
11
13
|
else
|
12
14
|
ARGV.each do |file|
|
13
15
|
next unless file
|
16
|
+
|
14
17
|
tagatala = Bato::Tagatala.new
|
15
18
|
kodigo = File.read file, encoding: 'utf-8'
|
16
19
|
ruby_kodigo = tagatala.sa_ruby kodigo
|
17
20
|
raise 'Ang pinakamababang kinakailangan bersiyon ng Ruby ay 2.4' if
|
18
21
|
Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
|
22
|
+
|
19
23
|
eval ruby_kodigo
|
20
24
|
end
|
21
25
|
end
|
data/lib/bato.rb
CHANGED
data/lib/bato/bersiyon.rb
CHANGED
data/lib/bato/core_ext.rb
CHANGED
data/lib/bato/core_ext/array.rb
CHANGED
data/lib/bato/core_ext/class.rb
CHANGED
data/lib/bato/core_ext/kernel.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Kernel
|
2
4
|
alias isulat puts
|
3
5
|
alias sabihin puts
|
4
6
|
alias iprint puts
|
5
7
|
alias mag_print puts
|
8
|
+
alias ilimbag puts
|
9
|
+
alias mag_limbag puts
|
10
|
+
alias itatak puts
|
11
|
+
alias mag_tatak puts
|
6
12
|
alias iangat raise
|
7
13
|
alias itaas raise
|
8
14
|
alias matulog sleep
|
data/lib/bato/core_ext/module.rb
CHANGED
data/lib/bato/core_ext/range.rb
CHANGED
data/lib/bato/core_ext/string.rb
CHANGED
@@ -1,191 +1,164 @@
|
|
1
|
-
|
2
|
-
def parse_number
|
3
|
-
self.lex_state = :expr_end
|
4
|
-
|
5
|
-
if src.scan(/[+-]?0[xXbBdD]\b/)
|
6
|
-
rb_compile_error 'Invalid numeric format'
|
7
|
-
# elsif src.scan(/[+-]?(?:(?:[1-9][\d_]*|0)(?!\.\d)\b|0[Dd][0-9_]+)/)
|
8
|
-
elsif src.scan(/[+-]?(?:(?:[1-9][\d_]*|0)(?!\,\d)\b|0[Dd][0-9_]+)/)
|
9
|
-
int_with_base(10)
|
10
|
-
elsif src.scan(/[+-]?0x[a-f0-9_]+/i)
|
11
|
-
int_with_base(16)
|
12
|
-
elsif src.scan(/[+-]?0[Bb][01_]+/)
|
13
|
-
int_with_base(2)
|
14
|
-
elsif src.scan(/[+-]?0[Oo]?[0-7_]*[89]/)
|
15
|
-
rb_compile_error 'Illegal octal digit.'
|
16
|
-
elsif src.scan(/[+-]?0[Oo]?[0-7_]+|0[Oo]/)
|
17
|
-
int_with_base(8)
|
18
|
-
elsif src.scan(/[+-]?[\d_]+_(e|\.)/)
|
19
|
-
rb_compile_error "Trailing '_' in number."
|
20
|
-
# elsif src.scan(/[+-]?[\d_]+\.[\d_]+(e[+-]?[\d_]+)?\b|[+-]?[\d_]+e[+-]?[\d_]+\b/i)
|
21
|
-
elsif src.scan(/[+-]?[\d_]+\,[\d_]+(e[+-]?[\d_]+)?\b|[+-]?[\d_]+e[+-]?[\d_]+\b/i)
|
22
|
-
number = src.matched.sub(',', '.')
|
23
|
-
rb_compile_error 'Invalid numeric format' if number =~ /__/
|
24
|
-
self.yacc_value = number.to_f
|
25
|
-
:tFLOAT
|
26
|
-
elsif src.scan(/[+-]?[0-9_]+(?![e])/)
|
27
|
-
int_with_base(10)
|
28
|
-
else
|
29
|
-
rb_compile_error 'Bad number format'
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
1
|
+
# frozen_string_literal: true
|
33
2
|
|
34
3
|
module RubyParserStuff
|
35
4
|
class Keyword
|
36
|
-
|
37
|
-
['katapusan', %i[kEND kEND],
|
38
|
-
['dulo', %i[kEND kEND],
|
39
|
-
['wakas', %i[kEND kEND],
|
40
|
-
['
|
41
|
-
['
|
42
|
-
['
|
43
|
-
['
|
44
|
-
['
|
45
|
-
['
|
46
|
-
['
|
47
|
-
['
|
48
|
-
['
|
49
|
-
['
|
50
|
-
['
|
51
|
-
['
|
52
|
-
['
|
53
|
-
['
|
54
|
-
['
|
55
|
-
['
|
56
|
-
['
|
57
|
-
['
|
58
|
-
['
|
59
|
-
['
|
60
|
-
['
|
61
|
-
['
|
62
|
-
['
|
63
|
-
['
|
64
|
-
['
|
65
|
-
['
|
66
|
-
['
|
67
|
-
['
|
68
|
-
['
|
69
|
-
['
|
70
|
-
['
|
71
|
-
['
|
72
|
-
['
|
73
|
-
['
|
74
|
-
['
|
75
|
-
['
|
76
|
-
['
|
77
|
-
['
|
78
|
-
['
|
79
|
-
['
|
80
|
-
['
|
81
|
-
['
|
82
|
-
['
|
83
|
-
['
|
84
|
-
['
|
85
|
-
['
|
86
|
-
['
|
87
|
-
['
|
88
|
-
['
|
89
|
-
['
|
90
|
-
['
|
91
|
-
['
|
92
|
-
['
|
93
|
-
['
|
94
|
-
['
|
95
|
-
['
|
96
|
-
['
|
97
|
-
['
|
98
|
-
['
|
99
|
-
['
|
100
|
-
['
|
101
|
-
['
|
102
|
-
['
|
103
|
-
['
|
104
|
-
['
|
105
|
-
['
|
106
|
-
['
|
107
|
-
['
|
108
|
-
['
|
109
|
-
['
|
110
|
-
['
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
['
|
115
|
-
['
|
116
|
-
['
|
117
|
-
['
|
118
|
-
['
|
119
|
-
['
|
120
|
-
['
|
121
|
-
['
|
122
|
-
['
|
123
|
-
['
|
124
|
-
['
|
125
|
-
['
|
126
|
-
['
|
127
|
-
['
|
128
|
-
['
|
129
|
-
['
|
130
|
-
['
|
131
|
-
['
|
132
|
-
['
|
133
|
-
['
|
134
|
-
['
|
135
|
-
['
|
136
|
-
['
|
137
|
-
['
|
138
|
-
['
|
139
|
-
['
|
140
|
-
['
|
141
|
-
['
|
142
|
-
['
|
143
|
-
['
|
144
|
-
['
|
145
|
-
['
|
146
|
-
['
|
147
|
-
['
|
148
|
-
['
|
149
|
-
['
|
150
|
-
['
|
151
|
-
['
|
152
|
-
['
|
153
|
-
|
154
|
-
|
155
|
-
|
5
|
+
pang_kapahayagang_mga_salita = [
|
6
|
+
['katapusan', %i[kEND kEND], :expr_end],
|
7
|
+
['dulo', %i[kEND kEND], :expr_end],
|
8
|
+
['wakas', %i[kEND kEND], :expr_end],
|
9
|
+
['ang', %i[kDEF kDEF], :expr_fname],
|
10
|
+
['panuntunang', %i[kDEF kDEF], :expr_fname],
|
11
|
+
['panuntunan', %i[kDEF kDEF], :expr_fname],
|
12
|
+
['iligtas', %i[kRESCUE kRESCUE_MOD], :expr_mid],
|
13
|
+
['agapan', %i[kRESCUE kRESCUE_MOD], :expr_mid],
|
14
|
+
['bigyang_daan', %i[kYIELD kYIELD], :expr_arg],
|
15
|
+
['magbigay_daan', %i[kYIELD kYIELD], :expr_arg],
|
16
|
+
['sariling', %i[kSELF kSELF], :expr_end],
|
17
|
+
['sarili', %i[kSELF kSELF], :expr_end],
|
18
|
+
['mali', %i[kFALSE kFALSE], :expr_end],
|
19
|
+
['subukang_muli', %i[kRETRY kRETRY], :expr_end],
|
20
|
+
['ibalik', %i[kRETURN kRETURN], :expr_mid],
|
21
|
+
['ibalik_ang', %i[kRETURN kRETURN], :expr_mid],
|
22
|
+
['magbalik', %i[kRETURN kRETURN], :expr_mid],
|
23
|
+
['magbalik_nang', %i[kRETURN kRETURN], :expr_mid],
|
24
|
+
['isauli', %i[kRETURN kRETURN], :expr_mid],
|
25
|
+
['isauli_ang', %i[kRETURN kRETURN], :expr_mid],
|
26
|
+
['ibigay', %i[kRETURN kRETURN], :expr_mid],
|
27
|
+
['ibigay_ang', %i[kRETURN kRETURN], :expr_mid],
|
28
|
+
['magbigay', %i[kRETURN kRETURN], :expr_mid],
|
29
|
+
['magbigay_nang', %i[kRETURN kRETURN], :expr_mid],
|
30
|
+
['tama', %i[kTRUE kTRUE], :expr_end],
|
31
|
+
['totoo', %i[kTRUE kTRUE], :expr_end],
|
32
|
+
['tunay', %i[kTRUE kTRUE], :expr_end],
|
33
|
+
['katotohanan', %i[kTRUE kTRUE], :expr_end],
|
34
|
+
['nakatukoy?', %i[kDEFINED kDEFINED], :expr_arg],
|
35
|
+
['nakasaad?', %i[kDEFINED kDEFINED], :expr_arg],
|
36
|
+
['tanggalin', %i[kUNDEF kUNDEF], :expr_fname],
|
37
|
+
['magtanggal', %i[kUNDEF kUNDEF], :expr_fname],
|
38
|
+
['ihinto', %i[kBREAK kBREAK], :expr_mid],
|
39
|
+
['hinto', %i[kBREAK kBREAK], :expr_mid],
|
40
|
+
['wala', %i[kNIL kNIL], :expr_end],
|
41
|
+
['sumunod', %i[kNEXT kNEXT], :expr_mid],
|
42
|
+
['kasunod', %i[kNEXT kNEXT], :expr_mid],
|
43
|
+
['ulitin', %i[kREDO kREDO], :expr_end],
|
44
|
+
['at_ulitin', %i[kREDO kREDO], :expr_end],
|
45
|
+
['uliting_muli', %i[kREDO kREDO], :expr_end],
|
46
|
+
['bilang', %i[kCLASS kCLASS], :expr_class],
|
47
|
+
['klase', %i[kCLASS kCLASS], :expr_class],
|
48
|
+
['alyas', %i[kALIAS kALIAS], :expr_fname],
|
49
|
+
['iba', %i[kELSE kELSE], :expr_beg],
|
50
|
+
['kung_iba', %i[kELSE kELSE], :expr_beg],
|
51
|
+
['kung_hindi_naman', %i[kELSE kELSE], :expr_beg],
|
52
|
+
['kapag_hindi', %i[kELSE kELSE], :expr_beg],
|
53
|
+
['kapag_hindi_naman', %i[kELSE kELSE], :expr_beg],
|
54
|
+
['kung_hindi_pa', %i[kELSE kELSE], :expr_beg],
|
55
|
+
['kapag_hindi_pa', %i[kELSE kELSE], :expr_beg],
|
56
|
+
['at_kung_hindi', %i[kELSE kELSE], :expr_beg],
|
57
|
+
['at_kapag_hindi', %i[kELSE kELSE], :expr_beg],
|
58
|
+
['at_kung_hindi_naman', %i[kELSE kELSE], :expr_beg],
|
59
|
+
['at_kapag_hindi_naman', %i[kELSE kELSE], :expr_beg],
|
60
|
+
['at_kung_hindi_pa', %i[kELSE kELSE], :expr_beg],
|
61
|
+
['at_kapag_hindi_pa', %i[kELSE kELSE], :expr_beg],
|
62
|
+
['maliban_dito', %i[kELSE kELSE], :expr_beg],
|
63
|
+
['maliban_sa_mga_ito', %i[kELSE kELSE], :expr_beg],
|
64
|
+
['matiyak', %i[kENSURE kENSURE], :expr_beg],
|
65
|
+
['tiyakin', %i[kENSURE kENSURE], :expr_beg],
|
66
|
+
['tiyaking', %i[kENSURE kENSURE], :expr_beg],
|
67
|
+
['siguraduhing', %i[kENSURE kENSURE], :expr_beg],
|
68
|
+
['siguraduhin', %i[kENSURE kENSURE], :expr_beg],
|
69
|
+
['panigurado', %i[kENSURE kENSURE], :expr_beg],
|
70
|
+
['kung_hindi', %i[kELSE kELSE], :expr_beg],
|
71
|
+
['dapat', %i[kTHEN kTHEN], :expr_beg],
|
72
|
+
['na_ganito', %i[kDO kDO], :expr_beg],
|
73
|
+
['nang_ganito', %i[kDO kDO], :expr_beg],
|
74
|
+
['ng_ganito', %i[kDO kDO], :expr_beg],
|
75
|
+
['ganito', %i[kDO kDO], :expr_beg],
|
76
|
+
['ganito_gawin', %i[kDO kDO], :expr_beg],
|
77
|
+
['ganito_ang_gagawin', %i[kDO kDO], :expr_beg],
|
78
|
+
['simula', %i[kBEGIN kBEGIN], :expr_beg],
|
79
|
+
['simulan', %i[kBEGIN kBEGIN], :expr_beg]
|
80
|
+
]
|
81
|
+
|
82
|
+
pang_ekspresyon_na_mga_salita = [
|
83
|
+
['at', %i[kAND kAND], :expr_beg],
|
84
|
+
['at_ang', %i[kAND kAND], :expr_beg],
|
85
|
+
['kalagayan', %i[kCASE kCASE], :expr_beg],
|
86
|
+
['kaukulan', %i[kCASE kCASE], :expr_beg],
|
87
|
+
['sakaling', %i[kCASE kCASE], :expr_beg],
|
88
|
+
['sakali', %i[kCASE kCASE], :expr_beg],
|
89
|
+
['kung_sakaling', %i[kCASE kCASE], :expr_beg],
|
90
|
+
['sakali_na', %i[kCASE kCASE], :expr_beg],
|
91
|
+
['kung_sakali_na', %i[kCASE kCASE], :expr_beg],
|
92
|
+
['ngunit_kapag', %i[kELSIF kELSIF], :expr_beg],
|
93
|
+
['kung_kapag', %i[kELSIF kELSIF], :expr_beg],
|
94
|
+
['ngunit_kapag_ang', %i[kELSIF kELSIF], :expr_beg],
|
95
|
+
['kung_kapag_ang', %i[kELSIF kELSIF], :expr_beg],
|
96
|
+
['para_sa', %i[kFOR kFOR], :expr_beg],
|
97
|
+
['para_ang', %i[kFOR kFOR], :expr_beg],
|
98
|
+
['kapag', %i[kIF kIF_MOD], :expr_beg],
|
99
|
+
['kapag_ang', %i[kIF kIF_MOD], :expr_beg],
|
100
|
+
['kapag_na_ang', %i[kIF kIF_MOD], :expr_beg],
|
101
|
+
['kung', %i[kIF kIF_MOD], :expr_beg],
|
102
|
+
['kung_ang', %i[kIF kIF_MOD], :expr_beg],
|
103
|
+
['sa', %i[kIN kIN], :expr_beg],
|
104
|
+
['sa_loob_ng', %i[kIN kIN], :expr_beg],
|
105
|
+
['nasa', %i[kIN kIN], :expr_beg],
|
106
|
+
['na_nasa', %i[kIN kIN], :expr_beg],
|
107
|
+
['modyul', %i[kMODULE kMODULE], :expr_beg],
|
108
|
+
['grupo', %i[kMODULE kMODULE], :expr_beg],
|
109
|
+
['o', %i[kOR kOR], :expr_beg],
|
110
|
+
['o_ang', %i[kOR kOR], :expr_beg],
|
111
|
+
['malibang', %i[kUNLESS kUNLESS_MOD], :expr_beg],
|
112
|
+
['maliban_na', %i[kUNLESS kUNLESS_MOD], :expr_beg],
|
113
|
+
['maliban_ang', %i[kUNLESS kUNLESS_MOD], :expr_beg],
|
114
|
+
['hanggang', %i[kUNTIL kUNTIL_MOD], :expr_beg],
|
115
|
+
['hanggang_ang', %i[kUNTIL kUNTIL_MOD], :expr_beg],
|
116
|
+
['mapa_hanggang', %i[kUNTIL kUNTIL_MOD], :expr_beg],
|
117
|
+
['pagka', %i[kWHEN kWHEN], :expr_beg],
|
118
|
+
['pagka_ang', %i[kWHEN kWHEN], :expr_beg],
|
119
|
+
['ay', %i[kWHEN kWHEN], :expr_beg],
|
120
|
+
['habang', %i[kWHILE kWHILE_MOD], :expr_beg],
|
121
|
+
['habang_ang', %i[kWHILE kWHILE_MOD], :expr_beg]
|
122
|
+
]
|
123
|
+
|
124
|
+
pang_internal_na_mekanismo_na_mga_salita = [
|
125
|
+
['END', %i[klEND klEND], :expr_end],
|
126
|
+
['BEGIN', %i[klBEGIN klBEGIN], :expr_end],
|
127
|
+
['super', %i[kSUPER kSUPER], :expr_arg],
|
128
|
+
['__FILE__', %i[k__FILE__ k__FILE__], :expr_end],
|
129
|
+
['__LINE__', %i[k__LINE__ k__LINE__], :expr_end],
|
156
130
|
['__ENCODING__', %i[k__ENCODING__ k__ENCODING__], :expr_end]
|
157
|
-
]
|
131
|
+
]
|
158
132
|
|
159
|
-
|
133
|
+
pang_argumentong_mga_salita = [
|
134
|
+
['hindi', %i[kNOT kNOT], :expr_beg]
|
135
|
+
]
|
160
136
|
|
161
137
|
original_verbosity = $VERBOSE
|
162
138
|
$VERBOSE = nil
|
163
139
|
|
164
|
-
|
165
|
-
|
140
|
+
mga_salita = [
|
141
|
+
pang_kapahayagang_mga_salita,
|
142
|
+
pang_ekspresyon_na_mga_salita,
|
143
|
+
pang_internal_na_mekanismo_na_mga_salita,
|
144
|
+
pang_argumentong_mga_salita
|
145
|
+
].flatten(1).map { |args| KWtable.new(*args) }
|
146
|
+
|
147
|
+
WORDLIST18 = Hash[*mga_salita.map { |o| [o.name, o] }.flatten]
|
148
|
+
WORDLIST19 = Hash[*mga_salita.map { |o| [o.name, o] }.flatten]
|
166
149
|
|
167
150
|
$VERBOSE = original_verbosity
|
168
151
|
|
169
152
|
WORDLIST18.delete '__ENCODING__'
|
170
153
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
para_sa para_ang
|
175
|
-
kapag kapag_ang kapag_na_ang kung kung_ang
|
176
|
-
sa sa_loob_ng nasa na_nasa
|
177
|
-
modyul grupo
|
178
|
-
o o_ang
|
179
|
-
malibang maliban_na maliban_ang
|
180
|
-
hanggang hanggang_ang mapa_hanggang
|
181
|
-
pagka pagka_ang ay
|
182
|
-
habang habang_ang].each do |k|
|
183
|
-
WORDLIST19[k] = WORDLIST19[k].dup
|
184
|
-
WORDLIST19[k].state = :expr_value
|
154
|
+
pang_ekspresyon_na_mga_salita.each do |k|
|
155
|
+
WORDLIST19[k[0]] = WORDLIST19[k[0]].dup
|
156
|
+
WORDLIST19[k[0]].state = :expr_value
|
185
157
|
end
|
186
|
-
|
187
|
-
|
188
|
-
WORDLIST19[k]
|
158
|
+
|
159
|
+
pang_argumentong_mga_salita.each do |k|
|
160
|
+
WORDLIST19[k[0]] = WORDLIST19[k[0]].dup
|
161
|
+
WORDLIST19[k[0]].state = :expr_arg
|
189
162
|
end
|
190
163
|
end
|
191
164
|
end
|
data/lib/bato/tagatala.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'ruby2ruby'
|
2
4
|
require 'ruby_parser'
|
3
5
|
require 'bato/ruby_parser_patches'
|
@@ -6,7 +8,7 @@ module Bato
|
|
6
8
|
class Tagatala
|
7
9
|
def initialize; end
|
8
10
|
|
9
|
-
PASIMULANG_KODIGO = "# encoding: utf-8\nrequire \"bato/core_ext\"\n"
|
11
|
+
PASIMULANG_KODIGO = "# encoding: utf-8\nrequire \"bato/core_ext\"\n"
|
10
12
|
|
11
13
|
def sa_ruby(kodigo)
|
12
14
|
ruby2ruby = Ruby2Ruby.new
|
data/mga_halimbawa/batotris.bt
CHANGED
data/mga_halimbawa/panguri.bt
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
-
bilang
|
2
|
-
|
1
|
+
bilang Robot
|
2
|
+
katangian :pangalan, :kakayahan
|
3
3
|
|
4
|
-
ang
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
10
|
wakas
|
11
11
|
wakas
|
12
12
|
|
13
|
-
|
13
|
+
robot = Robot.gumawa
|
14
|
+
robot.pangalan = "bot-chukoy"
|
15
|
+
robot.kakayahan = "tambling"
|
16
|
+
robot.magpakilala
|
data/spec/bato/tagatala_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Bryan Juliano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby2ruby
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
146
|
rubyforge_project:
|
147
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.7.8
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Ang Bato ay isang programming language sa wikang Filipino
|