tangled
alpha
login
or
join now
helpimnotdrowning.net
/
Nabura
0
fork
atom
Transpiler for HTML-in-PowerShell, PSX (like JSX)
0
fork
atom
overview
issues
pulls
pipelines
oops forgot about that, weren't using it anyways :D
helpimnotdrowning
3 months ago
b9b4e92e
eaf5805f
-89
1 changed file
expand all
collapse all
unified
split
Compiler.ps1
-89
Compiler.ps1
···
2
$PsxFile
3
)
4
5
-
<#
6
-
PsxElement :=
7
-
PsxSelfClosingElement
8
-
| PsxOpeningElement PsxChildren? PsxClosingElement
9
-
10
-
PsxSelfClosingElement :
11
-
'<' PsxElementName PsxAttributes? '/>'
12
-
13
-
PsxOpeningElement :
14
-
'<' PsxElementName PsxAttributes? '>'
15
-
16
-
PsxClosingElement :
17
-
'</' PsxElementName '>'
18
-
19
-
PsxFragment :
20
-
'<>' PsxChildren? '</>'
21
-
22
-
PsxElementName :
23
-
PsxIdentifier
24
-
| PsxMemberExpression
25
-
26
-
PsxIdentifier :
27
-
IdentifierStart
28
-
| PsxIdentifier IdentifierPart
29
-
| PsxIdentifier [no WhiteSpace or Comment here] -
30
-
31
-
PsxMemberExpression :
32
-
PsxIdentifier '.' PsxIdentifier
33
-
| PsxMemberExpression '.' PsxIdentifier
34
-
35
-
---
36
-
37
-
PsxAttributes :=
38
-
PsxSpreadAttribute PsxAttributes?
39
-
| PsxAttribute PsxAttributes?
40
-
PsxSpreadAttribute :=
41
-
'{' ... AssignmentExpression '}'
42
-
PsxAttribute :=
43
-
PsxAttributeName PsxAttributeInitializer?
44
-
PsxAttributeName :=
45
-
PsxIdentifier
46
-
PsxAttributeInitializer :=
47
-
'=' PsxAttributeValue
48
-
PsxAttributeValue :=
49
-
'"' PsxDoubleStringCharacters? '"'
50
-
| ''' PsxSingleStringCharacters? '''
51
-
| '{' AssignmentExpression '}'
52
-
| PsxElement
53
-
| PsxFragment
54
-
PsxDoubleStringCharacters ::=
55
-
| PsxDoubleStringCharacter PsxDoubleStringCharacters?
56
-
PsxDoubleStringCharacter ::=
57
-
| PsxStringCharacter EXCEPT '"'
58
-
PsxSingleStringCharacters ::=
59
-
| PsxSingleStringCharacter PsxSingleStringCharacters?
60
-
PsxSingleStringCharacter ::=
61
-
| PsxStringCharacter EXCEPT '''
62
-
63
-
---
64
-
65
-
PsxChildren :=
66
-
PsxChild PsxChildren?
67
-
PsxChild :=
68
-
PsxText
69
-
| PsxElement
70
-
| PsxFragment
71
-
| '{' PsxChildExpression? '}'
72
-
PsxText ::=
73
-
| PsxTextCharacter PsxText?
74
-
PsxTextCharacter ::=
75
-
| PsxStringCharacter EXCEPT '{' '<' '>' '}'
76
-
PsxChildExpression :=
77
-
AssignmentExpression
78
-
| '...' AssignmentExpression
79
-
80
-
81
-
82
-
Element :=
83
-
'<' Tag Attributes? '>' Children* '</' Tag '>'
84
-
| '<' Tag Attributes? '/>'
85
-
86
-
Tag :=
87
-
[a-zA-Z0-9_-]+
88
-
89
-
Attributes :=
90
-
(AttributeName '=' Value)*
91
-
92
-
#>
93
-
94
enum TokenType {
95
OPEN_ELEMENT_START # <
96
CLOSE_ELEMENT # >
···
2
$PsxFile
3
)
4
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
5
enum TokenType {
6
OPEN_ELEMENT_START # <
7
CLOSE_ELEMENT # >