-
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 Io syntax #1251
add Io syntax #1251
Conversation
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.
Thanks for contributing! Can you take a look at my comments?
Also, it would be nice if you could add an example file (refer to existing ones for the format).
Please note that I will be unable to merge this PR until 2018 due to Christmas holidays.
components/prism-io.js
Outdated
lookbehind: true | ||
}, | ||
{ | ||
pattern: /(^|[^\\:])#.*/, |
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 you can remove the :
in the lookbehind as it is (was?) used to prevent URLs to match //
comments (not even sure it's useful anymore).
components/prism-io.js
Outdated
} | ||
], | ||
'triple-quoted-string': { | ||
pattern: /"""(?:\\.|(?!""")[^\\])*"""/, |
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.
Are you sure line terminators can't be escaped? Cause if they are you need to replace \\.
with \\[\s\S]
. Please double check.
components/prism-io.js
Outdated
alias: 'string' | ||
}, | ||
'string': { | ||
pattern: /"(?:\\.|(?!")[^\\\r\n])*"/, |
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.
You can remove the negative look-ahead if you include "
in the negated character class.
components/prism-io.js
Outdated
'builtin':/\b(?:Array|AudioDevice|AudioMixer|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Regex|SGML|SGMLElement|SGMLParser|SQLite|Server|Sequence|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink|Random|BigNum|Sequence)\b/, | ||
'boolean': /\b(?:true|false|nil)\b/, | ||
'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e-?\d+)?)\b/i, | ||
'operator': /==|\!=|\*=|\/=|%=|\+=|-=|\^=|>>?=?|<<?=?|&=|\|=|:?:?=|\+\+?|--?|\*\*?|\/\/?|%|\|\|?|&&?|return|and|or|not|@@?|\?\??|\.\./, |
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 some of those could be combined. Please try to group them by starting character (like \/[=/]?
for example).
Also you should probably add word boundaries around the keyword operators (\b(?:return|and|or|not)\b
)
.gitignore
Outdated
@@ -2,3 +2,4 @@ hide-*.js | |||
node_modules | |||
.idea/ | |||
.DS_Store | |||
package-lock.json |
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 don't include this change in this PR. It is irrelevant to the addition of the support for Io.
components/prism-io.js
Outdated
@@ -0,0 +1,31 @@ | |||
Prism.languages.io = { | |||
'comment': [ |
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'm reviewing from my phone so I can't actually check, but can you make sure you're using tabs for indentation in this file please?
package.json
Outdated
} |
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 don't include this change in this PR. It is irrelevant to the addition of the support for Io.
LGTM, thanks! |
* gh-pages: (326 commits) Add C++ platform-independent types (PrismJS#1271) Release 1.10.0 Unescaped markup plugin: Make it work with any language (PrismJS#1265) Previewers: New plugin combining previous plugins Previewer: Base, Previewer: Angle, Previewer: Color, Previewer: Easing, Previewer: Gradient and Previewer: Time. Fix PrismJS#913 (PrismJS#1244) Add Elm (elm-lang.org) support (PrismJS#1174) IchigoJam: Remove unneeded escape Run gulp add Io syntax (PrismJS#1251) package.json: add attribute `style` (PrismJS#1256) Add the C++11 raw string feature to the cpp language IchigoJam: Make strings greedy BASIC: Make strings greedy Run gulp Add support for IchigoJam BASIC (PrismJS#1246) Add support for 6502 assembly (PrismJS#1245) fix for autoloader plugin Run gulp and reorder components alphabetically Xeora Language implementation (PrismJS#1239) upgrade autoloader Release 1.9.0 ...
No description provided.