-
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
Add support for the Jolie language #1014
Changes from 2 commits
16c27f9
fc3ff78
bb0e214
f1f90dd
bfd007d
f4b1bc2
5cbbe99
456374d
f9dd349
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Prism.languages.jolie = Prism.languages.extend('java', { | ||
'keyword': /(<-|=>)|\b(is_defined|undef|include|main|outputPort|inputPort|Location|Protocol|RequestResponse|throw|OneWay|interface|any|long|type|void|sequential|raw|scope|forward|install|execution|single|concurrent|Interfaces|cset|csets|double|global|linkIn|linkOut|string|bool|int|synchronized|courier|extender|throws|this|new|Interfaces|nullprocess|Redirects|embedded|extender|Aggregates|spawn|constants|with|foreach|instanceof|<-|over|define)\b/g, | ||
'builtin': /\b(string|int|long|Byte|bool|double|float|char|any)\b/g, | ||
'number': /\b0x[\da-f]*\.?[\da-f\-]+\b|\b\d*\.?\d+[e]?[\d]*[dfl]?\b/gi, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need for the square brackets around |
||
'operator': /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|\||\*|\//g, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are Also, you could make the regexp more clear by combining all single symbols into a character class : |
||
'punctuation': /[{}[\]()\.:]/g, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The dot |
||
'operation': /[a-z][A-Za-z0-9_]+(?=\@)/gm, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Also, why the |
||
'service': { | ||
pattern: /((?:(?:\@\s*)))[A-Z][A-Za-z0-9_]+/ig, | ||
lookbehind: true, | ||
}, | ||
'symbol': /\||;|\@/g, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, a character class would make the regexp more clear, IMO: |
||
'string': /(""")[\W\w]*?\1|("|\/)[\W\w]*?\2|('.')/g | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Finally, could you add the non-capturing part There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last pair of parentheses looks unneeded to me. There is nothing to group or capture here ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don't see any use for the last pair of parentheses. They should be removed. |
||
}); | ||
delete Prism.languages.jolie['class-name']; | ||
delete Prism.languages.jolie['function']; |
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.
I think the arrow
<-
near the end of the regexp was not intended to be there anymore.