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
2
$PsxFile
3
3
)
4
4
5
5
-
<#
6
6
-
PsxElement :=
7
7
-
PsxSelfClosingElement
8
8
-
| PsxOpeningElement PsxChildren? PsxClosingElement
9
9
-
10
10
-
PsxSelfClosingElement :
11
11
-
'<' PsxElementName PsxAttributes? '/>'
12
12
-
13
13
-
PsxOpeningElement :
14
14
-
'<' PsxElementName PsxAttributes? '>'
15
15
-
16
16
-
PsxClosingElement :
17
17
-
'</' PsxElementName '>'
18
18
-
19
19
-
PsxFragment :
20
20
-
'<>' PsxChildren? '</>'
21
21
-
22
22
-
PsxElementName :
23
23
-
PsxIdentifier
24
24
-
| PsxMemberExpression
25
25
-
26
26
-
PsxIdentifier :
27
27
-
IdentifierStart
28
28
-
| PsxIdentifier IdentifierPart
29
29
-
| PsxIdentifier [no WhiteSpace or Comment here] -
30
30
-
31
31
-
PsxMemberExpression :
32
32
-
PsxIdentifier '.' PsxIdentifier
33
33
-
| PsxMemberExpression '.' PsxIdentifier
34
34
-
35
35
-
---
36
36
-
37
37
-
PsxAttributes :=
38
38
-
PsxSpreadAttribute PsxAttributes?
39
39
-
| PsxAttribute PsxAttributes?
40
40
-
PsxSpreadAttribute :=
41
41
-
'{' ... AssignmentExpression '}'
42
42
-
PsxAttribute :=
43
43
-
PsxAttributeName PsxAttributeInitializer?
44
44
-
PsxAttributeName :=
45
45
-
PsxIdentifier
46
46
-
PsxAttributeInitializer :=
47
47
-
'=' PsxAttributeValue
48
48
-
PsxAttributeValue :=
49
49
-
'"' PsxDoubleStringCharacters? '"'
50
50
-
| ''' PsxSingleStringCharacters? '''
51
51
-
| '{' AssignmentExpression '}'
52
52
-
| PsxElement
53
53
-
| PsxFragment
54
54
-
PsxDoubleStringCharacters ::=
55
55
-
| PsxDoubleStringCharacter PsxDoubleStringCharacters?
56
56
-
PsxDoubleStringCharacter ::=
57
57
-
| PsxStringCharacter EXCEPT '"'
58
58
-
PsxSingleStringCharacters ::=
59
59
-
| PsxSingleStringCharacter PsxSingleStringCharacters?
60
60
-
PsxSingleStringCharacter ::=
61
61
-
| PsxStringCharacter EXCEPT '''
62
62
-
63
63
-
---
64
64
-
65
65
-
PsxChildren :=
66
66
-
PsxChild PsxChildren?
67
67
-
PsxChild :=
68
68
-
PsxText
69
69
-
| PsxElement
70
70
-
| PsxFragment
71
71
-
| '{' PsxChildExpression? '}'
72
72
-
PsxText ::=
73
73
-
| PsxTextCharacter PsxText?
74
74
-
PsxTextCharacter ::=
75
75
-
| PsxStringCharacter EXCEPT '{' '<' '>' '}'
76
76
-
PsxChildExpression :=
77
77
-
AssignmentExpression
78
78
-
| '...' AssignmentExpression
79
79
-
80
80
-
81
81
-
82
82
-
Element :=
83
83
-
'<' Tag Attributes? '>' Children* '</' Tag '>'
84
84
-
| '<' Tag Attributes? '/>'
85
85
-
86
86
-
Tag :=
87
87
-
[a-zA-Z0-9_-]+
88
88
-
89
89
-
Attributes :=
90
90
-
(AttributeName '=' Value)*
91
91
-
92
92
-
#>
93
93
-
94
5
enum TokenType {
95
6
OPEN_ELEMENT_START # <
96
7
CLOSE_ELEMENT # >