-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xeora Language implementation #1239
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
12baf96
Xeora Language implementation
freakmaxi 14df7b9
Regex Fix
freakmaxi b59b0fe
JS Minify
freakmaxi 685d1a4
Xeora Example
freakmaxi 4d58481
Example Fixed
freakmaxi cb36b5b
Example Updated
freakmaxi 1f89fc5
JS Regex fixed for function-inline
freakmaxi 81f75ef
Regex has been fixed for function-inline
freakmaxi 64f62f5
function-inline test is updated.
freakmaxi 050354f
Username is updated.
freakmaxi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
(function(Prism) { | ||
Prism.languages.xeora = Prism.languages.extend('markup', { | ||
'constant': { | ||
pattern: /\$(?:DomainContents|PageRenderDuration)\$/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /\$/ | ||
} | ||
} | ||
}, | ||
'variable': { | ||
pattern: /\$@?(?:#+|[-+*~=^])?[\w.]+\$/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /[$.]/ | ||
}, | ||
'operator': { | ||
pattern: /#+|[-+*~=^@]/ | ||
} | ||
} | ||
}, | ||
'function-inline': { | ||
pattern: /\$F:[-\w.]+\?[-\w.]+(?:,(?:\|?(?:[-#.^+*~]*(?:[\w+][^$]*)|=(?:[\S+][^$]*)|@[-#]*(?:\w+.)[\w+.]+)?)*)?\$/, | ||
inside: { | ||
'variable': { | ||
pattern: /(?:[,|])@?(?:#+|[-+*~=^])?[\w.]+/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /[,.|]/ | ||
}, | ||
'operator': { | ||
pattern: /#+|[-+*~=^@]/ | ||
} | ||
} | ||
}, | ||
'punctuation': { | ||
pattern: /\$\w:|[$:?.,|]/ | ||
} | ||
}, | ||
alias: 'function' | ||
}, | ||
'function-block': { | ||
pattern: /\$XF:{[-\w.]+\?[-\w.]+(?:,(?:\|?(?:[-#.^+*~]*(?:[\w+][^$]*)|=(?:[\S+][^$]*)|@[-#]*(?:\w+.)[\w+.]+)?)*)?}:XF\$/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /[$:{}?.,|]/ | ||
} | ||
}, | ||
alias: 'function' | ||
}, | ||
'directive-inline': { | ||
pattern: /\$\w(?:#\d+\+?)?(?:\[[-\w.]+])?:[-\/\w.]+\$/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/, | ||
inside: { | ||
'tag': { | ||
pattern: /#\d/ | ||
} | ||
} | ||
} | ||
}, | ||
alias: 'function' | ||
}, | ||
'directive-block-open': { | ||
pattern: /\$\w+:{|\$\w(?:#\d+\+?)?(?:\[[-\w.]+])?:[-\w.]+:{(![A-Z]+)?/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/, | ||
inside: { | ||
'tag': { | ||
pattern: /#\d/ | ||
} | ||
} | ||
}, | ||
'attribute': { | ||
pattern: /![A-Z]+$/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /!/ | ||
} | ||
}, | ||
alias: 'keyword' | ||
} | ||
}, | ||
alias: 'function' | ||
}, | ||
'directive-block-separator': { | ||
pattern: /}:[-\w.]+:{/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /[:{}]/ | ||
} | ||
}, | ||
alias: 'function' | ||
}, | ||
'directive-block-close': { | ||
pattern: /}:[-\w.]+\$/, | ||
inside: { | ||
'punctuation': { | ||
pattern: /[:{}$]/ | ||
} | ||
}, | ||
alias: 'function' | ||
} | ||
}); | ||
|
||
Prism.languages.insertBefore('inside', 'punctuation', { | ||
'variable': Prism.languages.xeora['function-inline'].inside['variable'] | ||
}, Prism.languages.xeora["function-block"]); | ||
|
||
Prism.languages.xeoracube = Prism.languages.xeora; | ||
|
||
}(Prism)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<h1>Xeora</h1> | ||
<p>To use this language, use the class "language-xeora".</p> | ||
|
||
<h2>Special Constants</h2> | ||
<pre><code>$DomainContents$ | ||
$PageRenderDuration$</code></pre> | ||
|
||
<h2>Operators & Variables</h2> | ||
<pre><code>$SearchKey$ | ||
$^SearchKey$ | ||
$~SearchKey$ | ||
$-SearchKey$ | ||
$+SearchKey$ | ||
$=SearchKey$ | ||
$#SearchKey$ | ||
$##SearchKey$ | ||
|
||
$*SearchKey$ | ||
|
||
[email protected]$ | ||
$@#SearchObject.SearchProperty$ | ||
[email protected]$</code></pre> | ||
|
||
<h2>Controls</h2> | ||
<pre><code>$C:ControlID$ | ||
$C:ControlID:{ <!-- Something --> }:ControlID$ | ||
$C:ControlID:{ <!-- Something --> }:ControlID:{ <!-- Something (Alternative) --> }:ControlID$ | ||
|
||
Control with Parent | ||
$C[Control1]:Control2$ | ||
$C[Control2]:Control3:{ <!-- Something --> }:Control3$ | ||
$C[Control2]:Control3:{ <!-- Something --> }:Control3:{ <!-- Something (Alternative) --> }:Control3$ | ||
|
||
Control with Parent & Leveling | ||
$C#1[ParentControlID]:ControlID:{ <!-- Something --> }:ControlID$ | ||
|
||
All Control Tags has leveling specification; | ||
$C:LoopControl1:{ | ||
$#FirstLoopSQLField1$ | ||
|
||
$C:ControlID:{ <!-- Something --> }:ControlID$ | ||
|
||
$C:LoopControl2:{ | ||
$##FirstLoopSQLField1$ | ||
$#SecondLoopSQLField1$ | ||
|
||
$C#1:ControlID:{ <!-- Something --> }:ControlID$ | ||
}:LoopControl2$ | ||
}:LoopControl1$ | ||
|
||
XML setup on a Control in Controls.xml | ||
<Control id="[ControlID]"> | ||
<Type>[ControlType]</Type> | ||
|
||
<Bind>[ThemeID|AddonID]?[ControlClass].[FunctionName],SomeOperatorTags(seperated with |)</Bind> | ||
|
||
<BlockIDsToUpdate localupdate="True|False"> | ||
<BlockID>[BlockID]</BlockID> | ||
<BlockID>[BlockID]</BlockID> | ||
<BlockID>[BlockID]</BlockID> | ||
</BlockIDsToUpdate> | ||
|
||
<DefaultButtonID>[ControlID]</DefaultButtonID> | ||
|
||
<Text>[TextBox, Password value or Button Text]</Text> | ||
|
||
<Content>[Textarea Content]</Content> | ||
|
||
<Source>[Image URL]</Source> | ||
|
||
<Url>[Link URL]</Url> | ||
|
||
<Attributes> | ||
<Attribute key="[HTMLAttributeKey]">[AttributeValue]</Attributes> | ||
</Attributes> | ||
</Control></code></pre> | ||
|
||
<h2>Directives</h2> | ||
<pre><code>$T:TemplateID$ | ||
$L:TranslationID$ | ||
$P:TemplateID$</code></pre> | ||
|
||
<h2>Executable Functions</h2> | ||
<pre><code>$F:AddonLib1?GlobalControls.PrintOutSums$ | ||
$F:AddonLib1?GlobalControls.PrintOut,~FormField$ | ||
$F:AddonLib1?GlobalControls.SumNumbers,~FormField|=5$</code></pre> | ||
|
||
<h2>Client Side Function Binding</h2> | ||
<pre><code>$XF:{AddonLib1?GlobalControls.SumNumbers,~FormField|=5}:XF$</code></pre> | ||
|
||
<h2>Inline Statements</h2> | ||
<pre><code>$S:StatementID:{ <!-- C# Code --> }:StatementID$ | ||
$S:StatementID:{!NOCACHE <!-- C# Code --> }:StatementID$ | ||
|
||
$S:Statement1:{ | ||
int intvalue1 = 5; | ||
int intvalue2 = Integer.Parse("0" + $~FormValue$); | ||
|
||
return intvalue1 * intvalue2; | ||
}:Statement1$</code></pre> | ||
|
||
<h2>Request Blocks</h2> | ||
<pre><code>$H:RequestBlockID:{ <!-- Something --> }:RequestBlockID$ | ||
$H:RequestBlockID:{!RENDERONREQUEST <!-- Something --> }:RequestBlockID$</code></pre> | ||
|
||
<h2>Cache Block</h2> | ||
<pre><code>$PC:{ <!-- Page Content Part --> }:PC$</code></pre> | ||
|
||
<h2>Message Handling Block</h2> | ||
<pre><code>$MB:{ <!-- Message Output Content --> }:MB$ | ||
$MB:{ | ||
$#Message$ | ||
$#MessageType$ | ||
}:MB$</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$DomainContents$ | ||
$PageRenderDuration$ | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["constant", [ | ||
["punctuation", "$"], "DomainContents", ["punctuation", "$"]]], | ||
["constant", [ | ||
["punctuation", "$"], "PageRenderDuration", ["punctuation", "$"]]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for constants. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
}:Control3$ | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["directive-block-close", [ | ||
["punctuation", "}"], ["punctuation", ":"], "Control3", ["punctuation", "$"]]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for directive-block-closes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
$C:Control2:{ | ||
$C#1:Control2:{ | ||
$C[ParentControl]:Control2:{ | ||
$C#1[ParentControl]:Control2:{ | ||
$S:Statement:{!NOCACHE | ||
$H:HttpRequest:{!RENDERONREQUEST | ||
$C:Control2:{!MESSAGETEMPLATE | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["directive-block-open", [ | ||
["punctuation", ["$C:"]], "Control2", ["punctuation", [":"]], ["punctuation", ["{"]]]], | ||
["directive-block-open", [ | ||
["punctuation", ["$C", ["tag", "#1"]]], ["punctuation", [":"]], "Control2", ["punctuation", [":"]], ["punctuation", ["{"]]]], | ||
["directive-block-open", [ | ||
["punctuation", ["$C["]], "ParentControl", ["punctuation", ["]"]], ["punctuation", [":"]], "Control2", ["punctuation", [":"]], ["punctuation", ["{"]]]], | ||
["directive-block-open", [ | ||
["punctuation", ["$C", ["tag", "#1"]]], ["punctuation", ["["]], "ParentControl", ["punctuation", ["]"]], ["punctuation", [":"]], "Control2", ["punctuation", [":"]], ["punctuation", ["{"]]]], | ||
["directive-block-open", [ | ||
["punctuation", ["$S:"]], "Statement", ["punctuation", [":"]], ["punctuation", ["{"]], ["attribute", [["punctuation", "!"], "NOCACHE"]]]], | ||
["directive-block-open", [ | ||
["punctuation", ["$H:"]], "HttpRequest", ["punctuation", [":"]], ["punctuation", ["{"]], ["attribute", [["punctuation", "!"], "RENDERONREQUEST"]]]], | ||
["directive-block-open", [ | ||
["punctuation", ["$C:"]], "Control2", ["punctuation", [":"]], ["punctuation", ["{"]], ["attribute", [["punctuation", "!"], "MESSAGETEMPLATE"]]]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for directive-block-opens. |
17 changes: 17 additions & 0 deletions
17
tests/languages/xeora/directive-block-separator_feature.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
}:Control3:{ | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["directive-block-separator", [ | ||
["punctuation", "}"], | ||
["punctuation", ":"], | ||
"Control3", | ||
["punctuation", ":"], | ||
["punctuation", "{"] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
$C:Control2$ | ||
$C#1:Control2$ | ||
$C[ParentControl]:Control2$ | ||
$C#1[ParentControl]:Control2$ | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["directive-inline", [ | ||
["punctuation", ["$C:"]], "Control2", ["punctuation", ["$"]]]], | ||
["directive-inline", [ | ||
["punctuation", ["$C", ["tag", "#1"]]], ["punctuation", [":"]], "Control2", ["punctuation", ["$"]]]], | ||
["directive-inline", [ | ||
["punctuation", ["$C["]], "ParentControl", ["punctuation", ["]"]], ["punctuation", [":"]], "Control2", ["punctuation", ["$"]]]], | ||
["directive-inline", [ | ||
["punctuation", ["$C", ["tag", "#1"]]], ["punctuation", ["["]], "ParentControl", ["punctuation", ["]"]], ["punctuation", [":"]], "Control2", ["punctuation", ["$"]]]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for directive-inlines. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please set the owner to you Github username
"freakmaxi"
.Once this is changed I think we're good to go!