bato 0.0.2 → 0.0.3

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
2
  SHA1:
3
- metadata.gz: eb4aceb327b5b4e67d0d82ada2fba6d07475e1e9
4
- data.tar.gz: a5fa77691e1de911a63a560fe1645568b75cc379
3
+ metadata.gz: 11c83a22166968243b8012e1b453eb9d4fbe6404
4
+ data.tar.gz: 14e219d6b8c979bff63edb418cfa31ff06ed7133
5
5
  SHA512:
6
- metadata.gz: 81559215a6952d37e784547326ed227fadb7bee971e87cf4ac2765f4cc16116b597d911017f31e5f4f622e81ee74ac72148945b1f213de1b5d3bbb66f7795eaa
7
- data.tar.gz: 4d1afa4c8de1764586a80b8e1154e1efd96e3cd48317121af7f7a32dbc1e9d321bd986f267cc4159e43b2f22efa0b31809af0971017c0b5659fd7b7532ecf767
6
+ metadata.gz: 8bcd01a0085013cc08ac6394cb25b2553a3a5f3a569e9d406ee50742b4ae0b36064ddbb458397dd254937141c483c6a9b536be758ff6d0cf319c1471e8d7ef1f
7
+ data.tar.gz: 0a698453ea29b71b50d7fd393f3ce5c4e73c57acffeda6c774f328f954bcb0b1e282a20418454434ada0014e1f75cf085ca3d3f101f9e39e297482cc7ecbb96d
data/README.md CHANGED
@@ -30,16 +30,6 @@ at pa-andarin ang program sa pamamagitan ng
30
30
 
31
31
  ## Sintaks
32
32
 
33
- ### Bilang
34
-
35
- Pambuong Bilang
36
-
37
- 123
38
-
39
- Hating Bilang
40
-
41
- 123.45
42
-
43
33
  ### Pagsusulat
44
34
 
45
35
  "Ito ay mga serye ng mga sulat sa wikang Tagalog"
@@ -91,6 +81,19 @@ Paggamit ng kondisyon.
91
81
  isulat "Tapos na"
92
82
  katapusan
93
83
 
84
+ ### Panuntunan
85
+
86
+ panuntunang sabihinAngPangalan(pangalan = wala)
87
+ kapag pangalan != wala
88
+ isulat "Magandang araw sa iyo #{pangalan}!"
89
+ kung_hindi
90
+ isulat "Magandang araw!"
91
+ katapusan
92
+ katapusan
93
+
94
+ sabihinAngPangalan "Maria" # => "Magandang araw sa iyo Maria!"
95
+ sabihinAngPangalan # => "Magandang araw!"
96
+
94
97
  ## Pagtulong sa pagdedevelop ng Bato
95
98
 
96
99
  Magpadala ng mga kahilingan sa paggawa ng ticket.
@@ -0,0 +1,11 @@
1
+ bilang_ng_pagkakamali = 0
2
+ simula
3
+ # mag komento kapag hindi sigurado
4
+ 1 / 0
5
+ iligtas => pagkakamali
6
+ bilang_ng_pagkakamali += 1
7
+ subukang_muli kapag bilang_ng_pagkakamali < 3
8
+ iangat "malubhang pagkakamali"
9
+ siguraduhing
10
+ isulat "Tapos na"
11
+ katapusan
@@ -0,0 +1,10 @@
1
+ panuntunang sabihinAngPangalan(pangalan = wala)
2
+ kapag pangalan != wala
3
+ isulat "Magandang araw sa iyo #{pangalan}!"
4
+ kung_hindi
5
+ isulat "Magandang araw!"
6
+ katapusan
7
+ katapusan
8
+
9
+ sabihinAngPangalan "Maria" # => "Magandang araw sa iyo Maria!"
10
+ sabihinAngPangalan # => "Magandang araw!"
@@ -0,0 +1,59 @@
1
+ panuntunang pibonasyi(n, n1 = 1, n2 = 1)
2
+ kapag n <= 2
3
+ [0, n1, n2][n]
4
+ kung_hindi
5
+ sagot = wala
6
+ (n-2).ulit na_ganito
7
+ sagot = n1 + n2
8
+ n1 = n2
9
+ n2 = sagot
10
+ katapusan
11
+ sagot
12
+ katapusan
13
+ katapusan
14
+
15
+ panuntunang pibonasyingPagsuksok(n, n1 = 1, n2 = 1)
16
+ kapag n <= 2
17
+ [0, n1, n2][n]
18
+ kung_hindi
19
+ ([wala].umikot.kumuha(n-2).isuksok([n1, n2]) na_ganito |nakaraan, x|
20
+ nakaraan.magbagsak(1).itulak(nakaraan[0] + nakaraan[1])
21
+ katapusan).huli
22
+ katapusan
23
+ katapusan
24
+
25
+ panuntunang pibonasyingInuulit(n, n1 = 1, n2 = 1)
26
+ kapag n <= 2
27
+ binhi = [0, n1, n2]
28
+ binhi[n]
29
+ kung_hindi
30
+ pibonasyingInuulit(n-1, n1, n2) + pibonasyingInuulit(n-2, n1, n2)
31
+ katapusan
32
+ katapusan
33
+
34
+ panuntunang pibonasyingBuntutangInuulit(n, n1 = 1, n2 = 1)
35
+ magbigay n1 kapag n <= 1
36
+ magbigay n2 kapag n == 2
37
+ magbigay pibonasyi(n - 1, n2, n1 + n2)
38
+ katapusan
39
+
40
+ panuntunang pibonasyingPaguulit(n, n1 = 1, n2 = 1)
41
+ (2..n).isaisahin {
42
+ n1, n2 = n2, n1 + n2
43
+ }
44
+ magbigay n1
45
+ katapusan
46
+
47
+ panuntunang pibonasyingPaguulitNaUmiikot(n, n1 = 1, n2 = 1)
48
+ para_sa i sa 2..n
49
+ n1, n2 = n2, n1 + n2
50
+ katapusan
51
+ magbigay n1
52
+ katapusan
53
+
54
+ isulat "Gamit ang Panuntunang Pibonasyi sa 10 ay #{pibonasyi 10}"
55
+ isulat "Gamit ang Panuntunang Pibonasying May Pagsuksok sa 9 ay #{pibonasyingPagsuksok 9}"
56
+ isulat "Gamit ang Panuntunang Pibonasying Inuulit sa 8 ay #{pibonasyingInuulit 8}"
57
+ isulat "Gamit ang Panuntunang Pibonasying May Buntot na Inuulit sa 7 ay #{pibonasyingBuntutangInuulit 7}"
58
+ isulat "Gamit ang Panuntunang Pibonasying Paguulit sa 6 ay #{pibonasyingPaguulit 6}"
59
+ isulat "Gamit ang Panuntunang Pibonasying Paguulit na Umiikot sa 5 ay #{pibonasyingPaguulitNaUmiikot 5}"
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+
3
+ class Array
4
+ alias_method :umikot, :cycle
5
+ alias_method :isuksok, :inject
6
+ alias_method :magbagsak, :drop
7
+ alias_method :itulak, :push
8
+ alias_method :huli, :last
9
+ alias_method :una, :first
10
+ alias_method :isaisahin, :each
11
+ end
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+
3
+ class Enumerator
4
+ alias_method :kumuha, :take
5
+ end
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+
3
+ class Fixnum
4
+ alias_method :ulit, :times
5
+ end
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+
3
+ class Range
4
+ alias_method :isaisahin, :each
5
+ end
data/lib/bato/core_ext.rb CHANGED
@@ -1,2 +1,6 @@
1
1
  require "bato/core_ext/kernel"
2
- require "bato/core_ext/string"
2
+ require "bato/core_ext/string"
3
+ require "bato/core_ext/array"
4
+ require "bato/core_ext/enumerator"
5
+ require "bato/core_ext/fixnum"
6
+ require "bato/core_ext/range"
@@ -53,25 +53,25 @@ module RubyParserStuff
53
53
  ["module", [:kMODULE, :kMODULE ], :expr_beg ],
54
54
  ["ngunit_kapag", [:kELSIF, :kELSIF ], :expr_beg ],
55
55
  ["kung_kapag", [:kELSIF, :kELSIF ], :expr_beg ],
56
- ["def", [:kDEF, :kDEF ], :expr_fname ],
56
+ ["panuntunang", [:kDEF, :kDEF ], :expr_fname ],
57
57
  ["iligtas", [:kRESCUE, :kRESCUE_MOD ], :expr_mid ],
58
58
  ["hindi", [:kNOT, :kNOT ], :expr_beg ],
59
59
  ["dapat", [:kTHEN, :kTHEN ], :expr_beg ],
60
60
  ["yield", [:kYIELD, :kYIELD ], :expr_arg ],
61
- ["for", [:kFOR, :kFOR ], :expr_beg ],
61
+ ["para_sa", [:kFOR, :kFOR ], :expr_beg ],
62
62
  ["self", [:kSELF, :kSELF ], :expr_end ],
63
63
  ["mali", [:kFALSE, :kFALSE ], :expr_end ],
64
64
  ["subukang_muli", [:kRETRY, :kRETRY ], :expr_end ],
65
- ["return", [:kRETURN, :kRETURN ], :expr_mid ],
65
+ ["magbigay", [:kRETURN, :kRETURN ], :expr_mid ],
66
66
  ["tama", [:kTRUE, :kTRUE ], :expr_end ],
67
67
  ["kapag", [:kIF, :kIF_MOD ], :expr_beg ],
68
68
  ["defined?", [:kDEFINED, :kDEFINED ], :expr_arg ],
69
69
  ["super", [:kSUPER, :kSUPER ], :expr_arg ],
70
70
  ["undef", [:kUNDEF, :kUNDEF ], :expr_fname ],
71
71
  ["break", [:kBREAK, :kBREAK ], :expr_mid ],
72
- ["in", [:kIN, :kIN ], :expr_beg ],
73
- ["do", [:kDO, :kDO ], :expr_beg ],
74
- ["nil", [:kNIL, :kNIL ], :expr_end ],
72
+ ["sa", [:kIN, :kIN ], :expr_beg ],
73
+ ["na_ganito", [:kDO, :kDO ], :expr_beg ],
74
+ ["wala", [:kNIL, :kNIL ], :expr_end ],
75
75
  ["until", [:kUNTIL, :kUNTIL_MOD ], :expr_beg ],
76
76
  ["unless", [:kUNLESS, :kUNLESS_MOD ], :expr_beg ],
77
77
  ["or", [:kOR, :kOR ], :expr_beg ],
@@ -85,7 +85,7 @@ module RubyParserStuff
85
85
  ["__FILE__", [:k__FILE__, :k__FILE__ ], :expr_end ],
86
86
  ["END", [:klEND, :klEND ], :expr_end ],
87
87
  ["BEGIN", [:klBEGIN, :klBEGIN ], :expr_end ],
88
- ["while", [:kWHILE, :kWHILE_MOD ], :expr_beg ],
88
+ ["habang", [:kWHILE, :kWHILE_MOD ], :expr_beg ],
89
89
  ["alias", [:kALIAS, :kALIAS ], :expr_fname ],
90
90
  ["__ENCODING__", [:k__ENCODING__, :k__ENCODING__], :expr_end],
91
91
  ].map { |args| KWtable.new(*args) }
@@ -102,7 +102,7 @@ module RubyParserStuff
102
102
 
103
103
  WORDLIST18.delete "__ENCODING__"
104
104
 
105
- %w[and kung_sakaling ngunit_kapag kung_kapag for kapag in module or unless until pagka while].each do |k|
105
+ %w[and kung_sakaling ngunit_kapag kung_kapag para_sa kapag sa module or unless until pagka habang].each do |k|
106
106
  WORDLIST19[k] = WORDLIST19[k].dup
107
107
  WORDLIST19[k].state = :expr_value
108
108
  end
data/lib/bato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bato
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Bryan Juliano
@@ -84,9 +84,16 @@ files:
84
84
  - bato.gemspec
85
85
  - bin/bato
86
86
  - examples/kamusta_mundo.bato
87
+ - examples/pamamaraan-sa-pagkakamali.bato
88
+ - examples/pangalan.bato
89
+ - examples/pibonasyi.bato
87
90
  - lib/bato.rb
88
91
  - lib/bato/core_ext.rb
92
+ - lib/bato/core_ext/array.rb
93
+ - lib/bato/core_ext/enumerator.rb
94
+ - lib/bato/core_ext/fixnum.rb
89
95
  - lib/bato/core_ext/kernel.rb
96
+ - lib/bato/core_ext/range.rb
90
97
  - lib/bato/core_ext/string.rb
91
98
  - lib/bato/ruby_parser_patches.rb
92
99
  - lib/bato/tagatala.rb