filipinomemes 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -22
- data/lib/filipinomemes/ruby_parser_patches.rb +4 -4
- data/lib/filipinomemes/version.rb +1 -1
- data/sample_programs/alyas.bt +1 -1
- data/sample_programs/batotris.bt +2 -2
- data/sample_programs/bilang.bt +1 -1
- data/sample_programs/modyul.bt +1 -1
- data/sample_programs/nakatukoy.bt +1 -1
- data/sample_programs/panguri.bt +1 -1
- data/sample_programs/tanggalin.bt +2 -2
- data/sample_programs/timebomb.bt +1 -1
- data/spec/filipinomemes/compiler_spec.rb +23 -23
- data/spec/spec_helper.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f57ecdde6fa439dcf71c74625c11358ca8d43703
|
4
|
+
data.tar.gz: f8b71ec7b8c70322c6e8b1388177729116c11fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbc9543b5a6d0d4c2ed33e1d29f7daefb46d123f98127e18a1b602c95e468dd462364e5e9149a081b5b2418956b048afb28a39cb1f23df7de36258c907436120
|
7
|
+
data.tar.gz: 8561154b1211a8f344f0af884a963dadbfcfb8023eca65a9fc5333e1e0e7694499130fad59ea8fc1664062c18ed4897b3319c6177e0e913bb71dbc659eddb913
|
data/README.md
CHANGED
@@ -3,21 +3,20 @@
|
|
3
3
|
Filipinomemes is a programming language that uses filipino memes as it's syntaxes
|
4
4
|
|
5
5
|
|
6
|
-
##
|
6
|
+
## How to install?
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
You need to download and install Ruby (version 2.4 or up).
|
9
|
+
after installing, run this code.
|
10
10
|
|
11
|
-
gem install
|
11
|
+
gem install filipinomemes
|
12
12
|
|
13
|
-
##
|
13
|
+
## Why filipinomemes?
|
14
14
|
|
15
|
-
|
16
|
-
Ang kadahilanang ginamit ang pangalang 'bato' ay dahil ang Ruby ay isang uri ng bato.
|
15
|
+
The 'filipinomemes' is based on Ruby Programming Language that uses filipinomemes as its syntaxes.
|
17
16
|
|
18
|
-
##
|
17
|
+
## Creating your first program using filipinomemes
|
19
18
|
|
20
|
-
|
19
|
+
Copy the following code to a .txt file then save it as helloworld.bt
|
21
20
|
|
22
21
|
ip 1 > 0
|
23
22
|
panomonasabe "Kumusta mundo!"
|
@@ -25,9 +24,9 @@ Gumawa ng isang file na `kamusta_mundo.bt` na may mga sumusunod na nilalaman
|
|
25
24
|
panomonasabe "Mayroong sira"
|
26
25
|
finish_na
|
27
26
|
|
28
|
-
|
27
|
+
and run this program using:
|
29
28
|
|
30
|
-
|
29
|
+
filipinomemes helloworld.bt
|
31
30
|
|
32
31
|
## Sintaks
|
33
32
|
|
@@ -44,13 +43,13 @@ at pa-andarin ang program sa pamamagitan ng
|
|
44
43
|
'magandang araw'.sikstinayn # => 'wara gnadnagam'
|
45
44
|
'Pangungusap'.longgadog # => 11
|
46
45
|
|
47
|
-
###
|
46
|
+
### Boolean Expression
|
48
47
|
|
49
48
|
israel
|
50
49
|
isrong
|
51
50
|
isnot
|
52
51
|
|
53
|
-
###
|
52
|
+
### Condition
|
54
53
|
|
55
54
|
Paggamit ng kondisyon.
|
56
55
|
|
@@ -181,7 +180,7 @@ Halimbawa
|
|
181
180
|
mojul Hayop
|
182
181
|
KABUUAN = 5
|
183
182
|
|
184
|
-
|
183
|
+
grupo Aso
|
185
184
|
ang tahol
|
186
185
|
panomonasabe "Woof..."
|
187
186
|
finish_na
|
@@ -381,16 +380,16 @@ Halimbawa
|
|
381
380
|
panomonasabe "may sira"
|
382
381
|
finish_na
|
383
382
|
|
384
|
-
###
|
383
|
+
### grupo
|
385
384
|
|
386
|
-
Ang
|
385
|
+
Ang grupo ay ang pagsasabilang ng isang kaukulang klasipikasyon
|
387
386
|
|
388
|
-
|
387
|
+
grupo
|
389
388
|
|
390
389
|
Halimbawa
|
391
390
|
|
392
391
|
mojul Tinapay
|
393
|
-
|
392
|
+
grupo Donut
|
394
393
|
dep flavor
|
395
394
|
panomonasabe 'Strawberry!'
|
396
395
|
finish_na
|
@@ -426,7 +425,7 @@ Gumamit ng alyas kung kailangan mo tawagin sa ibang pangalan ang iyong ge_talon
|
|
426
425
|
|
427
426
|
Halimbawa
|
428
427
|
|
429
|
-
|
428
|
+
grupo Hayop
|
430
429
|
dep aso
|
431
430
|
panomonasabe 'si browny ay mabait!'
|
432
431
|
finish_na
|
@@ -447,7 +446,7 @@ Ang abugbug ay ginagamit kung kailangan malaman kung umiiral ang isang mojul o k
|
|
447
446
|
Halimbawa
|
448
447
|
|
449
448
|
mojul Manggagawa
|
450
|
-
|
449
|
+
grupo Magsasaka
|
451
450
|
dep pananim
|
452
451
|
['sibuyas', 'kamatis', 'sili', 'palay', 'mais'].its adbans |pananim|
|
453
452
|
panomonasabe "Mag tatanim ng #{pananim} ngayong panahon"
|
@@ -470,14 +469,14 @@ Ginagamit ang una_ulo kung may tatanggaling ge_talon sa isang klase
|
|
470
469
|
Halimbawa
|
471
470
|
|
472
471
|
mojul Hayop
|
473
|
-
|
472
|
+
grupo Aso
|
474
473
|
dep tahol
|
475
474
|
panomonasabe 'baw waw!'
|
476
475
|
finish_na
|
477
476
|
finish_na
|
478
477
|
finish_na
|
479
478
|
|
480
|
-
|
479
|
+
grupo Pusa < Hayop::Aso
|
481
480
|
una_ulo tahol
|
482
481
|
dep meow
|
483
482
|
panomonasabe 'meow wahu!'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Lexer
|
2
2
|
def parse_number
|
3
3
|
self.lex_state = :expr_end
|
4
4
|
|
@@ -51,7 +51,7 @@ module RubyParserStuff
|
|
51
51
|
['dep', %i[kDEF kDEF], :expr_fname],
|
52
52
|
['ge_talon', %i[kDEF kDEF], :expr_fname],
|
53
53
|
['reskyu', %i[kRESCUE kRESCUE_MOD], :expr_mid],
|
54
|
-
['
|
54
|
+
['isnot', %i[kNOT kNOT], :expr_beg],
|
55
55
|
['den', %i[kTHEN kTHEN], :expr_beg],
|
56
56
|
['yild', %i[kYIELD kYIELD], :expr_arg],
|
57
57
|
['dewei', %i[kYIELD kYIELD], :expr_arg],
|
@@ -88,7 +88,7 @@ module RubyParserStuff
|
|
88
88
|
['sapa', %i[kREDO kREDO], :expr_end],
|
89
89
|
['at', %i[kAND kAND], :expr_beg],
|
90
90
|
['__LINE__', %i[k__LINE__ k__LINE__], :expr_end],
|
91
|
-
['
|
91
|
+
['grupo', %i[kCLASS kCLASS], :expr_class],
|
92
92
|
['klase', %i[kCLASS kCLASS], :expr_class],
|
93
93
|
['__FILE__', %i[k__FILE__ k__FILE__], :expr_end],
|
94
94
|
['END', %i[klEND klEND], :expr_end],
|
@@ -126,7 +126,7 @@ module RubyParserStuff
|
|
126
126
|
WORDLIST19[k] = WORDLIST19[k].dup
|
127
127
|
WORDLIST19[k].state = :expr_value
|
128
128
|
end
|
129
|
-
%w[
|
129
|
+
%w[isnot].each do |k|
|
130
130
|
WORDLIST19[k] = WORDLIST19[k].dup
|
131
131
|
WORDLIST19[k].state = :expr_arg
|
132
132
|
end
|
data/sample_programs/alyas.bt
CHANGED
data/sample_programs/batotris.bt
CHANGED
@@ -4,7 +4,7 @@ mojul Batotris
|
|
4
4
|
BERSIYON = '0.1'.freeze
|
5
5
|
opentaym magisa
|
6
6
|
|
7
|
-
|
7
|
+
grupo Piyesa
|
8
8
|
MGA_PIYESA = [
|
9
9
|
[ [0, 1, 0, 0],
|
10
10
|
[1, 1, 1, 0],
|
@@ -100,7 +100,7 @@ mojul Batotris
|
|
100
100
|
NAKALINYA = 3
|
101
101
|
finish_na
|
102
102
|
|
103
|
-
|
103
|
+
grupo Babagsakan
|
104
104
|
LAWAK = 11
|
105
105
|
TAAS = 20
|
106
106
|
DAMI = 40
|
data/sample_programs/bilang.bt
CHANGED
data/sample_programs/modyul.bt
CHANGED
data/sample_programs/panguri.bt
CHANGED
data/sample_programs/timebomb.bt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
kwentomo_sapagong 'Compiler' do
|
4
4
|
italaga_ang(:starting_code) do
|
5
5
|
"# encoding: utf-8\nrequire \"filipinomemes/core_ext\"\n"
|
6
6
|
end
|
@@ -9,40 +9,40 @@ isalaysay_ang 'Compiler' do
|
|
9
9
|
Filipinomemes::Compiler.new
|
10
10
|
end
|
11
11
|
|
12
|
-
|
12
|
+
diziz 'Filipinomemes is empty' do
|
13
13
|
compiler.zephyrum('').should == starting_code + ''
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
kwentomo_sapagong 'Count' do
|
17
|
+
diziz 'whole count' do
|
18
18
|
compiler.zephyrum('1').should == starting_code + '1'
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
diziz 'small count' do
|
22
22
|
compiler.zephyrum('1.2').should == starting_code + '1.2'
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
diziz 'count list' do
|
26
26
|
compiler.zephyrum('[1.2, 3]').should == starting_code + '[1.2, 3]'
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
kwentomo_sapagong 'Boolean Expression' do
|
31
|
+
diziz 'Usage of israel or true' do
|
32
32
|
compiler.zephyrum('israel').should == starting_code + 'true'
|
33
33
|
end
|
34
34
|
|
35
|
-
|
35
|
+
diziz 'Usage of isrong or false' do
|
36
36
|
compiler.zephyrum('isrong').should == starting_code + 'false'
|
37
37
|
end
|
38
38
|
|
39
|
-
|
40
|
-
compiler.zephyrum('
|
39
|
+
diziz 'Usage of isnot or not' do
|
40
|
+
compiler.zephyrum('isnot israel').should == starting_code + '(not true)'
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
kwentomo_sapagong 'Keywords' do
|
45
|
+
diziz 'Usage of agik / den / agik_ginagawa_mue / ginagawa_mue / finish_na' do
|
46
46
|
compiler.zephyrum('
|
47
47
|
agik 1 den
|
48
48
|
2
|
@@ -54,7 +54,7 @@ isalaysay_ang 'Compiler' do
|
|
54
54
|
'1 ? (2) : (3 ? (4) : (5))')
|
55
55
|
end
|
56
56
|
|
57
|
-
|
57
|
+
diziz 'Usage of hakdog / wen / den / ginagawa_mue / finish_na' do
|
58
58
|
compiler.zephyrum("
|
59
59
|
hakdog 1
|
60
60
|
wen 1 den 1
|
@@ -73,10 +73,10 @@ isalaysay_ang 'Compiler' do
|
|
73
73
|
end')
|
74
74
|
end
|
75
75
|
|
76
|
-
|
76
|
+
diziz 'wala_na / reskyu / rays / may_raket / finish_na' do
|
77
77
|
# raise ir Kernel metode nevis atslēgvārds
|
78
78
|
compiler.zephyrum('
|
79
|
-
|
79
|
+
wala_na
|
80
80
|
1 / 0
|
81
81
|
reskyu => pagkakamali
|
82
82
|
neba_gibap
|
@@ -95,20 +95,20 @@ isalaysay_ang 'Compiler' do
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
|
99
|
-
|
98
|
+
kwentomo_sapagong 'Kernel method' do
|
99
|
+
diziz "Usage and printing using 'panomonasabe' function" do
|
100
100
|
compiler.zephyrum("panomonasabe 'abc'").should ==
|
101
101
|
starting_code + 'panomonasabe("abc")'
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
|
106
|
-
|
107
|
-
resulta = eval compiler.zephyrum("'
|
108
|
-
resulta.should == '
|
105
|
+
kwentomo_sapagong 'String function' do
|
106
|
+
diziz 'Usage sikstinayn or reverse function' do
|
107
|
+
resulta = eval compiler.zephyrum("'zephyrum'.sikstinayn")
|
108
|
+
resulta.should == 'muryhpez'
|
109
109
|
end
|
110
110
|
|
111
|
-
|
111
|
+
diziz 'Usage of longgadog or length function' do
|
112
112
|
resulta = eval compiler.zephyrum("'Zephyrum'.longgadog")
|
113
113
|
resulta.should == 8
|
114
114
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -45,9 +45,9 @@ RSpec.configure do |config|
|
|
45
45
|
end
|
46
46
|
|
47
47
|
class << RSpec::Core::ExampleGroup
|
48
|
-
alias
|
49
|
-
RSpec::Core::ExampleGroup.define_example_group_method :
|
50
|
-
RSpec::Core::ExampleGroup.define_example_method :
|
48
|
+
alias kwentomo_sapagong describe
|
49
|
+
RSpec::Core::ExampleGroup.define_example_group_method :kwentomo_sapagong
|
50
|
+
RSpec::Core::ExampleGroup.define_example_method :diziz
|
51
51
|
end
|
52
52
|
|
53
53
|
RSpec::Core::MemoizedHelpers::ClassMethods.module_eval do
|