Skip to content
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

Merged
merged 10 commits into from
Jan 2, 2018
Merged

add Io syntax #1251

merged 10 commits into from
Jan 2, 2018

Conversation

ales-tsurko
Copy link
Contributor

No description provided.

Copy link
Contributor

@Golmote Golmote left a 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.

lookbehind: true
},
{
pattern: /(^|[^\\:])#.*/,
Copy link
Contributor

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).

}
],
'triple-quoted-string': {
pattern: /"""(?:\\.|(?!""")[^\\])*"""/,
Copy link
Contributor

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.

alias: 'string'
},
'string': {
pattern: /"(?:\\.|(?!")[^\\\r\n])*"/,
Copy link
Contributor

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.

'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|@@?|\?\??|\.\./,
Copy link
Contributor

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
Copy link
Contributor

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.

@@ -0,0 +1,31 @@
Prism.languages.io = {
'comment': [
Copy link
Contributor

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
}
Copy link
Contributor

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.

@Golmote Golmote merged commit 84ed3ed into PrismJS:gh-pages Jan 2, 2018
@Golmote
Copy link
Contributor

Golmote commented Jan 2, 2018

LGTM, thanks!

papandreou added a commit to papandreou/prism that referenced this pull request Jan 29, 2018
* 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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants