return nb
end
- # Return one the item of the collection
+ # Return the first item of the collection
#
# assert [1,2,3].first == 1
fun first: E
end
# A collection that contains only one item.
+# Used to pass arguments by reference
class Container[E]
super Collection[E]
# Abstract sets.
#
-# Set contains contains only one element with the same value (according to ==).
+# Set is a collection without ducplicates (according to ==)
# var s: Set[String] = new ArraySet[String]
# var a = "Hello"
# var b = "Hel" + "lo"
# gtksourceview (gedit and other GTK editors)
To install in your home, just link (or copy) the language definition file in ~/.local/share/gtksourceview-2.0/language-specs
+# syntaxhighlighter
+
+Nit brush for the Alex Gorbatchev's JS syntaxhighlighter.
+
+To install the JS syntaxhighlighter, please refer to http://alexgorbatchev.com/SyntaxHighlighter/
+
+Then can add the brush to your html page:
+
+ <script type="text/javascript" src="shBrushNit.js"></script>
+
# vim
vim is a powerful text editor.
--- /dev/null
+/* This file is part of NIT ( http://www.nitlanguage.org ).
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Nit Brush for SyntaxHighlighter
+ * see http://alexgorbatchev.com/SyntaxHighlighter
+ */
+
+;(function()
+{
+ // CommonJS
+ typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
+
+ function Brush()
+ {
+ var keywords = 'abort abstract and as assert break class continue do else end enum extern false for fun' +
+ 'if import in init interface intrude is isa isset label loop module new null nullable not' +
+ 'once or protected private redef return self super then type true universal var' +
+ 'when while writable';
+ var builtins = 'exit sys args get_time getc getcwd gets print printn';
+
+ this.regexList = [
+ { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
+ { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // types
+ { regex: /[A-Z][A-Za-z0-9_]*/g, css: 'color2' }, // classes
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
+ { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color3' } // builtins
+ ];
+ this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
+ };
+
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
+ Brush.aliases = ['nit'];
+
+ SyntaxHighlighter.brushes.Nit = Brush;
+
+ // CommonJS
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
+})();
+