From dfc19413d35919ebadd8514cb04b956c775354ba Mon Sep 17 00:00:00 2001 From: thesave Date: Wed, 9 Nov 2016 01:57:46 +0100 Subject: [PATCH] Add support for the Jolie language (#1014) * Added component for the Jolie language * Added Jolie among the supported components * update for merge - revised jolie component - added tests - added code example - minified with `gulp` * fixes * fixes * fixed Jolie html file example and highlight for punctuation * fixed indentation in test html file and added comma as punctuation --- components.js | 5 + components/prism-jolie.js | 56 ++++++ components/prism-jolie.min.js | 1 + examples/prism-jolie.html | 165 ++++++++++++++++++ plugins/autoloader/prism-autoloader.js | 2 +- plugins/autoloader/prism-autoloader.min.js | 2 +- tests/helper/test-case.js | 12 +- .../languages/jolie/deployment_features.test | 43 +++++ tests/languages/jolie/keyword_feature.test | 129 ++++++++++++++ tests/languages/jolie/number_feature.test | 19 ++ tests/languages/jolie/operator_feature.test | 42 +++++ 11 files changed, 473 insertions(+), 3 deletions(-) create mode 100644 components/prism-jolie.js create mode 100644 components/prism-jolie.min.js create mode 100644 examples/prism-jolie.html create mode 100644 tests/languages/jolie/deployment_features.test create mode 100644 tests/languages/jolie/keyword_feature.test create mode 100644 tests/languages/jolie/number_feature.test create mode 100644 tests/languages/jolie/operator_feature.test diff --git a/components.js b/components.js index 0b2b48ad6b..0a49d3c511 100644 --- a/components.js +++ b/components.js @@ -272,6 +272,11 @@ var components = { "require": "clike", "owner": "sherblot" }, + "jolie": { + "title": "Jolie", + "require": "clike", + "owner": "thesave" + }, "json": { "title": "JSON", "owner": "CupOfTea696" diff --git a/components/prism-jolie.js b/components/prism-jolie.js new file mode 100644 index 0000000000..4c0d4308a6 --- /dev/null +++ b/components/prism-jolie.js @@ -0,0 +1,56 @@ +Prism.languages.jolie = Prism.languages.extend('clike', { + 'keyword': /\b(?:include|define|is_defined|undef|main|init|outputPort|inputPort|Location|Protocol|Interfaces|RequestResponse|OneWay|type|interface|extender|throws|cset|csets|forward|Aggregates|Redirects|embedded|courier|extender|execution|sequential|concurrent|single|scope|install|throw|comp|cH|default|global|linkIn|linkOut|synchronized|this|new|for|if|else|while|in|Jolie|Java|Javascript|nullProcess|spawn|constants|with|provide|until|exit|foreach|instanceof|over|service)\b/g, + 'builtin': /\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/, + 'number': /\b\d*\.?\d+(?:e[+-]?\d+)?l?\b/i, + 'operator': /->|<<|[!+-<>=*]?=|[:<>!?*\/%^]|&&|\|\||--?|\+\+?/g, + 'symbol': /[|;@]/, + 'punctuation': /[,.]/, + 'string': { + pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, +}); + +delete Prism.languages.jolie['class-name']; +delete Prism.languages.jolie['function']; + +Prism.languages.insertBefore( 'jolie', 'keyword', { + 'function': + { + pattern: /((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/, + lookbehind: true + }, + 'aggregates': { + pattern: /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/, + lookbehind: true, + inside: { + 'withExtension': { + pattern: /\bwith\s+\w+/, + inside: { + 'keyword' : /\bwith\b/ + } + }, + '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 + }, + 'symbol': { + pattern: /=>/g + } + } + } +}); \ No newline at end of file diff --git a/components/prism-jolie.min.js b/components/prism-jolie.min.js new file mode 100644 index 0000000000..f5a81ee04e --- /dev/null +++ b/components/prism-jolie.min.js @@ -0,0 +1 @@ +Prism.languages.jolie=Prism.languages.extend("clike",{keyword:/\b(?:include|define|is_defined|undef|main|init|outputPort|inputPort|Location|Protocol|Interfaces|RequestResponse|OneWay|type|interface|extender|throws|cset|csets|forward|Aggregates|Redirects|embedded|courier|extender|execution|sequential|concurrent|single|scope|install|throw|comp|cH|default|global|linkIn|linkOut|synchronized|this|new|for|if|else|while|in|Jolie|Java|Javascript|nullProcess|spawn|constants|with|provide|until|exit|foreach|instanceof|over|service)\b/g,builtin:/\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/,number:/\b\d*\.?\d+(?:e[+-]?\d+)?l?\b/i,operator:/->|<<|[!+-<>=*]?=|[:<>!?*\/%^]|&&|\|\||--?|\+\+?/g,symbol:/[|;@]/,punctuation:/[,.]/,string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0}}),delete Prism.languages.jolie["class-name"],delete Prism.languages.jolie["function"],Prism.languages.insertBefore("jolie","keyword",{"function":{pattern:/((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/,lookbehind:!0},aggregates:{pattern:/(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,lookbehind:!0,inside:{withExtension:{pattern:/\bwith\s+\w+/,inside:{keyword:/\bwith\b/}},"function":{pattern:/\w+/},punctuation:{pattern:/,/}}},redirects:{pattern:/(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,lookbehind:!0,inside:{punctuation:{pattern:/,/},"function":{pattern:/\w+/g},symbol:{pattern:/=>/g}}}}); \ No newline at end of file diff --git a/examples/prism-jolie.html b/examples/prism-jolie.html new file mode 100644 index 0000000000..a26c53865e --- /dev/null +++ b/examples/prism-jolie.html @@ -0,0 +1,165 @@ +

Jolie

+

To use this language, use the class "language-jolie".

+ +

Comments

+
// Single line comment
+/* Multi-line
+comment */
+ +

Strings

+
"foo \"bar\" baz";
+'foo \'bar\' baz'
+ +

Numbers

+
42
+42L
+1.2e3
+0.1E-4
+0.2e+1
+
+ +

Full example

+
include "console.iol"
+
+type HubType: void {
+  .sid: undefined
+  .nodes[1,*] : NodeType
+}
+
+type NodeType: void {
+  .sid: string
+  .node: string
+  .load?: int
+}
+
+type NetType: HubType | NodeType
+
+interface NetInterface {
+  OneWay: start( string ), addElement( NetType ), removeElement( NetType ), quit( void )
+  RequestResponse: showElements( void )( NetType ) throws SomeFault
+}
+
+type LogType: void {
+  .message: string
+}
+
+interface LoggerInterface {
+  RequestResponse: log( LogType )( void )
+}
+
+outputPort LoggerService {
+    Interfaces: LoggerInterface
+}
+
+embedded {
+  Jolie: "logger.ol" in LoggerService
+}
+
+type AuthenticationData: void {
+    .key:string
+}
+
+interface extender AuthInterfaceExtender {
+    OneWay: *(AuthenticationData)
+}
+
+service SubService 
+{
+  Interfaces: NetInterface
+
+  main
+  {
+     println@Console( "I do nothing" )()
+  }
+}
+
+inputPort ExtLogger {
+  Location: "socket://localhost:9000"
+  Protocol: sodep
+  Interfaces: LoggerInterface
+  Aggregates: LoggerService with AuthInterfaceExtender
+}
+
+courier ExtLogger {
+  [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
+}
+
+cset {
+  sid: HubType.sid NodeType.sid
+}
+
+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++
+        }   
+      }
+    } 
+  }
+}
+
+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 )()
+     }
+  until
+   [ quit() ]{ exit }
+}
\ No newline at end of file diff --git a/plugins/autoloader/prism-autoloader.js b/plugins/autoloader/prism-autoloader.js index 4c62483923..995363745f 100644 --- a/plugins/autoloader/prism-autoloader.js +++ b/plugins/autoloader/prism-autoloader.js @@ -4,7 +4,7 @@ } // The dependencies map is built automatically with gulp - var lang_dependencies = /*languages_placeholder[*/{"javascript":"clike","actionscript":"javascript","aspnet":"markup","bison":"c","c":"clike","csharp":"clike","cpp":"c","coffeescript":"javascript","crystal":"ruby","css-extras":"css","d":"clike","dart":"clike","fsharp":"clike","glsl":"clike","go":"clike","groovy":"clike","haml":"ruby","handlebars":"markup","haxe":"clike","jade":"javascript","java":"clike","kotlin":"clike","less":"css","markdown":"markup","nginx":"clike","objectivec":"c","parser":"markup","php":"clike","php-extras":"php","processing":"clike","protobuf":"clike","qore":"clike","jsx":["markup","javascript"],"ruby":"clike","sass":"css","scss":"css","scala":"java","smarty":"markup","swift":"clike","textile":"markup","twig":"markup","typescript":"javascript","wiki":"markup"}/*]*/; + var lang_dependencies = /*languages_placeholder[*/{"javascript":"clike","actionscript":"javascript","aspnet":"markup","bison":"c","c":"clike","csharp":"clike","cpp":"c","coffeescript":"javascript","crystal":"ruby","css-extras":"css","d":"clike","dart":"clike","fsharp":"clike","glsl":"clike","go":"clike","groovy":"clike","haml":"ruby","handlebars":"markup","haxe":"clike","jade":"javascript","java":"clike","jolie":"clike","kotlin":"clike","less":"css","markdown":"markup","nginx":"clike","objectivec":"c","parser":"markup","php":"clike","php-extras":"php","processing":"clike","protobuf":"clike","qore":"clike","jsx":["markup","javascript"],"ruby":"clike","sass":"css","scss":"css","scala":"java","smarty":"markup","swift":"clike","textile":"markup","twig":"markup","typescript":"javascript","wiki":"markup"}/*]*/; var lang_data = {}; diff --git a/plugins/autoloader/prism-autoloader.min.js b/plugins/autoloader/prism-autoloader.min.js index 472054b5ff..e982e86b94 100644 --- a/plugins/autoloader/prism-autoloader.min.js +++ b/plugins/autoloader/prism-autoloader.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var e={javascript:"clike",actionscript:"javascript",aspnet:"markup",bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",fsharp:"clike",glsl:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup",haxe:"clike",jade:"javascript",java:"clike",kotlin:"clike",less:"css",markdown:"markup",nginx:"clike",objectivec:"c",parser:"markup",php:"clike","php-extras":"php",processing:"clike",protobuf:"clike",qore:"clike",jsx:["markup","javascript"],ruby:"clike",sass:"css",scss:"css",scala:"java",smarty:"markup",swift:"clike",textile:"markup",twig:"markup",typescript:"javascript",wiki:"markup"},c={},a="none",s=Prism.plugins.autoloader={languages_path:"components/",use_minified:!0},n=function(e,c,a){var s=document.createElement("script");s.src=e,s.async=!0,s.onload=function(){document.body.removeChild(s),c&&c()},s.onerror=function(){document.body.removeChild(s),a&&a()},document.body.appendChild(s)},r=function(e){return s.languages_path+"prism-"+e+(s.use_minified?".min":"")+".js"},i=function(e,a){var s=c[e];s||(s=c[e]={});var n=a.getAttribute("data-dependencies");!n&&a.parentNode&&"pre"===a.parentNode.tagName.toLowerCase()&&(n=a.parentNode.getAttribute("data-dependencies")),n=n?n.split(/\s*,\s*/g):[],t(n,function(){l(e,function(){Prism.highlightElement(a)})})},t=function(e,c,a){"string"==typeof e&&(e=[e]);var s=0,n=e.length,r=function(){n>s?l(e[s],function(){s++,r()},function(){a&&a(e[s])}):s===n&&c&&c(e)};r()},l=function(a,s,i){var l=function(){var e=!1;a.indexOf("!")>=0&&(e=!0,a=a.replace("!",""));var t=c[a];if(t||(t=c[a]={}),s&&(t.success_callbacks||(t.success_callbacks=[]),t.success_callbacks.push(s)),i&&(t.error_callbacks||(t.error_callbacks=[]),t.error_callbacks.push(i)),!e&&Prism.languages[a])o(a);else if(!e&&t.error)u(a);else if(e||!t.loading){t.loading=!0;var l=r(a);n(l,function(){t.loading=!1,o(a)},function(){t.loading=!1,t.error=!0,u(a)})}},p=e[a];p&&p.length?t(p,l):l()},o=function(e){c[e]&&c[e].success_callbacks&&c[e].success_callbacks.length&&c[e].success_callbacks.forEach(function(c){c(e)})},u=function(e){c[e]&&c[e].error_callbacks&&c[e].error_callbacks.length&&c[e].error_callbacks.forEach(function(c){c(e)})};Prism.hooks.add("complete",function(e){e.element&&e.language&&!e.grammar&&e.language!==a&&i(e.language,e.element)})}}(); \ No newline at end of file +!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var e={javascript:"clike",actionscript:"javascript",aspnet:"markup",bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",fsharp:"clike",glsl:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup",haxe:"clike",jade:"javascript",java:"clike",jolie:"clike",kotlin:"clike",less:"css",markdown:"markup",nginx:"clike",objectivec:"c",parser:"markup",php:"clike","php-extras":"php",processing:"clike",protobuf:"clike",qore:"clike",jsx:["markup","javascript"],ruby:"clike",sass:"css",scss:"css",scala:"java",smarty:"markup",swift:"clike",textile:"markup",twig:"markup",typescript:"javascript",wiki:"markup"},c={},a="none",s=Prism.plugins.autoloader={languages_path:"components/",use_minified:!0},n=function(e,c,a){var s=document.createElement("script");s.src=e,s.async=!0,s.onload=function(){document.body.removeChild(s),c&&c()},s.onerror=function(){document.body.removeChild(s),a&&a()},document.body.appendChild(s)},r=function(e){return s.languages_path+"prism-"+e+(s.use_minified?".min":"")+".js"},i=function(e,a){var s=c[e];s||(s=c[e]={});var n=a.getAttribute("data-dependencies");!n&&a.parentNode&&"pre"===a.parentNode.tagName.toLowerCase()&&(n=a.parentNode.getAttribute("data-dependencies")),n=n?n.split(/\s*,\s*/g):[],t(n,function(){l(e,function(){Prism.highlightElement(a)})})},t=function(e,c,a){"string"==typeof e&&(e=[e]);var s=0,n=e.length,r=function(){n>s?l(e[s],function(){s++,r()},function(){a&&a(e[s])}):s===n&&c&&c(e)};r()},l=function(a,s,i){var l=function(){var e=!1;a.indexOf("!")>=0&&(e=!0,a=a.replace("!",""));var t=c[a];if(t||(t=c[a]={}),s&&(t.success_callbacks||(t.success_callbacks=[]),t.success_callbacks.push(s)),i&&(t.error_callbacks||(t.error_callbacks=[]),t.error_callbacks.push(i)),!e&&Prism.languages[a])o(a);else if(!e&&t.error)u(a);else if(e||!t.loading){t.loading=!0;var l=r(a);n(l,function(){t.loading=!1,o(a)},function(){t.loading=!1,t.error=!0,u(a)})}},p=e[a];p&&p.length?t(p,l):l()},o=function(e){c[e]&&c[e].success_callbacks&&c[e].success_callbacks.length&&c[e].success_callbacks.forEach(function(c){c(e)})},u=function(e){c[e]&&c[e].error_callbacks&&c[e].error_callbacks.length&&c[e].error_callbacks.forEach(function(c){c(e)})};Prism.hooks.add("complete",function(e){e.element&&e.language&&!e.grammar&&e.language!==a&&i(e.language,e.element)})}}(); \ No newline at end of file diff --git a/tests/helper/test-case.js b/tests/helper/test-case.js index 3a874fe208..27cb5b9039 100644 --- a/tests/helper/test-case.js +++ b/tests/helper/test-case.js @@ -65,7 +65,17 @@ module.exports = { var compiledTokenStream = Prism.tokenize(testCase.testSource, mainLanguageGrammar); var simplifiedTokenStream = TokenStreamTransformer.simplify(compiledTokenStream); - assert.deepEqual(simplifiedTokenStream, testCase.expectedTokenStream, testCase.comment); + var tzd = JSON.stringify( simplifiedTokenStream ); var exp = JSON.stringify( testCase.expectedTokenStream ); + var i = 0;var j = 0;var diff = ""; + while ( j < tzd.length ){ if (exp[i] != tzd[j] || i == exp.length) diff += tzd[j]; else i++; j++; } + + // var message = "\nToken Stream: \n" + JSON.stringify( simplifiedTokenStream, null, " " ) + + var message = "\nToken Stream: \n" + tzd + + "\n-----------------------------------------\n" + + "Expected Token Stream: \n" + exp + + "\n-----------------------------------------\n" + diff; + + var result = assert.deepEqual(simplifiedTokenStream, testCase.expectedTokenStream, testCase.comment + message); }, diff --git a/tests/languages/jolie/deployment_features.test b/tests/languages/jolie/deployment_features.test new file mode 100644 index 0000000000..ebcd86a765 --- /dev/null +++ b/tests/languages/jolie/deployment_features.test @@ -0,0 +1,43 @@ +Aggregates: First, Second with Third +Redirects: First => Second, Third => Fourth +Jolie: "logger.ol" in LoggerService +log@LoggerService( new )(); +println @ Console( "none" )() +---------------------------------------------------- + [ + [ "keyword", "Aggregates" ], + [ "operator", ":" ], + [ "aggregates", [ + [ "function", "First" ], [ "punctuation", ","], + [ "function", "Second" ], + [ "withExtension", [ + [ "keyword", "with" ], " Third" ] + ] + ] + ], + [ "keyword", "Redirects" ], + [ "operator", ":" ], + [ "redirects", + [ + [ "function", "First" ], + [ "symbol", "=>" ], + [ "function", "Second" ], [ "punctuation", ","], + [ "function", "Third" ], + [ "symbol", "=>" ], + [ "function", "Fourth" ] + ] + ], + [ "keyword", "Jolie" ], + [ "operator", ":" ], + [ "string", "\"logger.ol\"" ], + [ "keyword", "in" ], + [ "function", "LoggerService" ], + "\nlog", [ "symbol", "@" ], [ "function", "LoggerService" ], + "( ", [ "keyword", "new" ], " )()", [ "symbol", ";" ], + "\nprintln ", [ "symbol", "@" ], [ "function", "Console" ], + "( ", [ "string", "\"none\"" ], " )()" +] + +---------------------------------------------------- + +Checks for outputPorts and Aggregates and Redirect constructs. \ No newline at end of file diff --git a/tests/languages/jolie/keyword_feature.test b/tests/languages/jolie/keyword_feature.test new file mode 100644 index 0000000000..55a95cab1a --- /dev/null +++ b/tests/languages/jolie/keyword_feature.test @@ -0,0 +1,129 @@ +include +define +is_defined +undef +main +init +outputPort ; +inputPort ; +Location +Protocol +Interfaces +RequestResponse +OneWay +type +interface +extender +throws +cset +csets +forward +courier ; +Aggregates +Redirects +embedded +extender +execution +sequential +concurrent +single +scope +install +throw +comp +cH +default +global +linkIn +linkOut +synchronized +this +new +for +if +else +while +in ; +Jolie +Java +Javascript +nullProcess +spawn +constants +with +provide +until +exit +foreach +instanceof +over +service + +---------------------------------------------------- +[ + ["keyword", "include" ], + ["keyword", "define" ], + ["keyword", "is_defined" ], + ["keyword", "undef" ], + ["keyword", "main" ], + ["keyword", "init" ], + ["keyword", "outputPort" ], [ "symbol", ";" ], + ["keyword", "inputPort" ], [ "symbol", ";" ], + ["keyword", "Location" ], + ["keyword", "Protocol" ], + ["keyword", "Interfaces" ], + ["keyword", "RequestResponse" ], + ["keyword", "OneWay" ], + ["keyword", "type" ], + ["keyword", "interface" ], + ["keyword", "extender" ], + ["keyword", "throws" ], + ["keyword", "cset" ], + ["keyword", "csets" ], + ["keyword", "forward" ], + ["keyword", "courier" ], [ "symbol", ";" ], + ["keyword", "Aggregates" ], + ["keyword", "Redirects" ], + ["keyword", "embedded" ], + ["keyword", "extender" ], + ["keyword", "execution" ], + ["keyword", "sequential" ], + ["keyword", "concurrent" ], + ["keyword", "single" ], + ["keyword", "scope" ], + ["keyword", "install" ], + ["keyword", "throw" ], + ["keyword", "comp" ], + ["keyword", "cH" ], + ["keyword", "default" ], + ["keyword", "global" ], + ["keyword", "linkIn" ], + ["keyword", "linkOut" ], + ["keyword", "synchronized" ], + ["keyword", "this" ], + ["keyword", "new" ], + ["keyword", "for" ], + ["keyword", "if" ], + ["keyword", "else" ], + ["keyword", "while" ], + ["keyword", "in" ], [ "symbol", ";" ], + ["keyword", "Jolie" ], + ["keyword", "Java" ], + ["keyword", "Javascript" ], + ["keyword", "nullProcess" ], + ["keyword", "spawn" ], + ["keyword", "constants" ], + ["keyword", "with" ], + ["keyword", "provide" ], + ["keyword", "until" ], + ["keyword", "exit" ], + ["keyword", "foreach" ], + ["keyword", "instanceof" ], + ["keyword", "over" ], + ["keyword", "service" ] + +] + +---------------------------------------------------- + +Checks for all keywords. \ No newline at end of file diff --git a/tests/languages/jolie/number_feature.test b/tests/languages/jolie/number_feature.test new file mode 100644 index 0000000000..90d5c96f31 --- /dev/null +++ b/tests/languages/jolie/number_feature.test @@ -0,0 +1,19 @@ +42 +42L +1.2e3 +0.1E-4 +0.2e+1 + +---------------------------------------------------- + +[ + ["number", "42" ], + ["number", "42L" ], + ["number", "1.2e3" ], + ["number", "0.1E-4" ], + ["number", "0.2e+1" ] +] + +---------------------------------------------------- + +Checks for decimal numbers. \ No newline at end of file diff --git a/tests/languages/jolie/operator_feature.test b/tests/languages/jolie/operator_feature.test new file mode 100644 index 0000000000..963acc2f13 --- /dev/null +++ b/tests/languages/jolie/operator_feature.test @@ -0,0 +1,42 @@ ++ ++ += +- -- -= +! != +< <= > >= -> << += == +&& +? * / % ; : | @ + +---------------------------------------------------- + +[ + ["operator", "+"], + ["operator", "++"], + ["operator", "+="], + ["operator", "-"], + ["operator", "--"], + ["operator", "-="], + ["operator", "!"], + ["operator", "!="], + ["operator", "<" ], + ["operator", "<=" ], + ["operator", ">" ], + ["operator", ">=" ], + ["operator", "->" ], + ["operator", "<<" ], + ["operator", "=" ], + ["operator", "==" ], + ["operator", "&&" ], + [ "operator", "?" ], + [ "operator", "*" ], + [ "operator", "/" ], + [ "operator", "%" ], + [ "symbol", ";" ], + [ "operator", ":" ], + [ "symbol", "|" ], + [ "symbol", "@" ] + +] + +---------------------------------------------------- + +Checks for all operators and symbols. \ No newline at end of file