-
Notifications
You must be signed in to change notification settings - Fork 0
/
papa.txt
114 lines (65 loc) · 2.55 KB
/
papa.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
document=(item,newline)..
item=word + "=" + piece
piece = pieceWrap | pieceKernalOr
pieceKernalOr=(pieceKernalAddition,"|")..
pieceKernalAddition=(pieceContent,"+")..
pieceContent=(word|string|peice)
pieceWrap=(pieceInformation+(pieceExtras)?)
pieceExtras="?" | ".."
pieceInformation=justPiece| pieceWithparam
justPiece="("+piece+")"
pieceWithParam="("+piece+","+piece+")"
class = "class" + variable + extends? +(newLine+(indent+method|indent+assignment))..
extends=(":"+(variable,",")..)
method="def" +(variable)?+ "("+(variable + ",").. + ")" + block
block= (newLine+ indent + statement)..
statement = assignment | switch | if | methodCall | anonFunction
assignment = variablePiece + "=" + anything
switch = "switch"+variable + (newLine + indent + native+":" + block)..
if = ifelseif |
ifelse |
justif
ifelseif="if"+anything + block+ "else"+"if"+anything + block
ifElse= "if"+anything + block+ "else" + block
justif="if"+anything + block
methodCall = normalmethodcall | anonmethodcall
normalmethodcall=(variablePiece + "(" + (anything, ",").. + ")")
anonmethodcall=anonFunction + "(" + (anything, ",").. + ")"
objproperty=anything + "."+variable
anonFunction = anything + "=>" + anonVariables
anonVariables= anonVariablesWithVars| block
anonVariablesWithVars="|" + "(" +(variable, ",")..+")" + block
anything = anonFunction |
array |
methodCall |
"(" + anything + ")" |
anythingEquals |
anythingLessThanE |
anythingGreaterThanE |
anythingLessThan |
anythingGreaterThan |
anythingPlus |
anythingMinus |
anythingMultiply |
anythingDivide |
variablePiece |
native |
create
anythingEquals=anything + "==" + anything
anythingLessThanE= anything + "<=" + anything
anythingGreaterThanE= anything + ">=" + anything
anythingLessThan= anything + "<" + anything
anythingGreaterThan= anything + ">" + anything
anythingPlus= anything + "+" + anything
anythingMinus=anything + "-" + anything
anythingMultiply= anything + "*" + anything
anythingDivide= anything + "/" + anything
array = anything + "["+anything+"]"
variablePiece= objproperty |variable
variable = word
create = createVariables | createVars | createConstruct | createBare
createBare = "create" + variable
createConstruct = createBare + "(" + (anything , ",").. + ")"
createVars= createConstruct + createVariables
createVariables= "{" + (variable + "="+ anything , ",").. + "}"
native = number | string | bool