Skip to content

Commit

Permalink
fixed indentation in test html file and added comma as punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
thesave committed Oct 14, 2016
1 parent 456374d commit f9dd349
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 83 deletions.
8 changes: 7 additions & 1 deletion components/prism-jolie.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Prism.languages.jolie = Prism.languages.extend('clike', {
'number': /\b\d*\.?\d+(?:e[+-]?\d+)?l?\b/i,
'operator': /->|<<|[!+-<>=*]?=|[:<>!?*\/%^]|&&|\|\||--?|\+\+?/g,
'symbol': /[|;@]/,
'punctuation': /\./,
'punctuation': /[,.]/,
'string': {
pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true
Expand Down Expand Up @@ -32,13 +32,19 @@ Prism.languages.insertBefore( 'jolie', 'keyword', {
},
'function': {
pattern: /\w+/
},
'punctuation': {
pattern: /,/
}
}
},
'redirects': {
pattern: /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,
lookbehind: true,
inside: {
'punctuation': {
pattern: /,/
},
'function': {
pattern: /\w+/g
},
Expand Down
2 changes: 1 addition & 1 deletion components/prism-jolie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

157 changes: 78 additions & 79 deletions examples/prism-jolie.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ <h2>Full example</h2>
<pre><code>include "console.iol"

type HubType: void {
.sid: undefined
.nodes[1,*] : NodeType
.sid: undefined
.nodes[1,*] : NodeType
}

type NodeType: void {
.sid: string
.node: string
.load?: int
.sid: string
.node: string
.load?: int
}

type NetType: HubType | NodeType
Expand All @@ -40,7 +40,7 @@ <h2>Full example</h2>
}

type LogType: void {
.message: string
.message: string
}

interface LoggerInterface {
Expand All @@ -65,40 +65,40 @@ <h2>Full example</h2>

service SubService
{
Interfaces: NetInterface
main
{
println@Console( "I do nothing" )()
}
Interfaces: NetInterface

main
{
println@Console( "I do nothing" )()
}
}

inputPort ExtLogger {
Location: "socket://localhost:9000"
Protocol: sodep
Interfaces: LoggerInterface
Aggregates: LoggerService with AuthInterfaceExtender
Location: "socket://localhost:9000"
Protocol: sodep
Interfaces: LoggerInterface
Aggregates: LoggerService with AuthInterfaceExtender
}

courier ExtLogger {
[interface LoggerInterface( request )] {
if ( key == "secret" ){
forward ( request )
}
[interface LoggerInterface( request )] {
if ( key == "secret" ){
forward ( request )
}
}
}

inputPort In {
Location: "socket://localhost:8000"
Protocol: http {
.debug = true;
.debug.showContent = true
}
Interfaces: NetInterface
Aggregates: SubService,
LoggerService
Redirects: A => SubService,
B => SubService
Location: "socket://localhost:8000"
Protocol: http {
.debug = true;
.debug.showContent = true
}
Interfaces: NetInterface
Aggregates: SubService,
LoggerService
Redirects: A => SubService,
B => SubService
}

cset {
Expand All @@ -108,59 +108,58 @@ <h2>Full example</h2>
execution{ concurrent }

define netmodule {
if( request.load == 0 || request.load < 1 &&
request.load <= 2 || request.load >= 3 &&
request.load > 4 || request.load%4 == 2
) {
scope( scopeName )
{
// inline comment
install( MyFault => println@Console( "Something \"Went\" Wrong" + ' but it\'s ok' )() );
/*
* Multi-line
* Comment
*/
install( this => cH; println@Console( "Something went wrong: " + ^load )() );
install( default => comp( scopeName ); println@Console( "Something went wrong" )() );
load -> request.( "load" );
{ ++load | load++ | --load | load-- };
throw( MyFault )
}
} else {
foreach ( node -> request.nodes ) {
with( node ){
while( .load != 100 ) {
.load++
}
}
}
if( request.load == 0 || request.load < 1 &&
request.load <= 2 || request.load >= 3 &&
request.load > 4 || request.load%4 == 2
) {
scope( scopeName ) {
// inline comment
install( MyFault => println@Console( "Something \"Went\" Wrong" + ' but it\'s ok' )() );
/*
* Multi-line
* Comment
*/
install( this => cH; println@Console( "Something went wrong: " + ^load )() );
install( default => comp( scopeName ); println@Console( "Something went wrong" )() );
load -> request.( "load" );
{ ++load | load++ | --load | load-- };
throw( MyFault )
}
} else {
foreach ( node -> request.nodes ) {
with( node ){
while( .load != 100 ) {
.load++
}
}
}
}
}

main
{
start( sid );
synchronized( unneededSync ){
csets.sid = sid;
undef( sid )
};
provide
[ addElement( request ) ]{
if( request instanceof NodeType ) {
netmodule
}
}
[ removeElement() ]
[ showElements()( response ){
/*
* assemble response
*/
nullProcess
}]{
// log the request
log@LoggerService( new )();
log @ LoggerService( new )()
start( sid );
synchronized( unneededSync ){
csets.sid = sid;
undef( sid )
};
provide
[ addElement( request ) ]{
if( request instanceof NodeType ) {
netmodule
}
}
until
[ quit() ]{ exit }
[ removeElement() ]
[ showElements()( response ){
/*
* assemble response
*/
nullProcess
}]{
// log the request
log@LoggerService( new )();
log @ LoggerService( new )()
}
until
[ quit() ]{ exit }
}</code></pre>
4 changes: 2 additions & 2 deletions tests/languages/jolie/deployment_features.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ println @ Console( "none" )()
[ "keyword", "Aggregates" ],
[ "operator", ":" ],
[ "aggregates", [
[ "function", "First" ], ", ",
[ "function", "First" ], [ "punctuation", ","],
[ "function", "Second" ],
[ "withExtension", [
[ "keyword", "with" ], " Third" ]
Expand All @@ -21,7 +21,7 @@ println @ Console( "none" )()
[
[ "function", "First" ],
[ "symbol", "=>" ],
[ "function", "Second" ], ", ",
[ "function", "Second" ], [ "punctuation", ","],
[ "function", "Third" ],
[ "symbol", "=>" ],
[ "function", "Fourth" ]
Expand Down

0 comments on commit f9dd349

Please sign in to comment.