| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| /* Just enough of CodeMirror to run runMode under node.js */ | ||
|
|
||
| function splitLines(string){ return string.split(/\r?\n|\r/); }; | ||
|
|
||
| function StringStream(string) { | ||
| this.pos = this.start = 0; | ||
| this.string = string; | ||
| } | ||
| StringStream.prototype = { | ||
| eol: function() {return this.pos >= this.string.length;}, | ||
| sol: function() {return this.pos == 0;}, | ||
| peek: function() {return this.string.charAt(this.pos) || null;}, | ||
| next: function() { | ||
| if (this.pos < this.string.length) | ||
| return this.string.charAt(this.pos++); | ||
| }, | ||
| eat: function(match) { | ||
| var ch = this.string.charAt(this.pos); | ||
| if (typeof match == "string") var ok = ch == match; | ||
| else var ok = ch && (match.test ? match.test(ch) : match(ch)); | ||
| if (ok) {++this.pos; return ch;} | ||
| }, | ||
| eatWhile: function(match) { | ||
| var start = this.pos; | ||
| while (this.eat(match)){} | ||
| return this.pos > start; | ||
| }, | ||
| eatSpace: function() { | ||
| var start = this.pos; | ||
| while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; | ||
| return this.pos > start; | ||
| }, | ||
| skipToEnd: function() {this.pos = this.string.length;}, | ||
| skipTo: function(ch) { | ||
| var found = this.string.indexOf(ch, this.pos); | ||
| if (found > -1) {this.pos = found; return true;} | ||
| }, | ||
| backUp: function(n) {this.pos -= n;}, | ||
| column: function() {return this.start;}, | ||
| indentation: function() {return 0;}, | ||
| match: function(pattern, consume, caseInsensitive) { | ||
| if (typeof pattern == "string") { | ||
| function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} | ||
| if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { | ||
| if (consume !== false) this.pos += pattern.length; | ||
| return true; | ||
| } | ||
| } | ||
| else { | ||
| var match = this.string.slice(this.pos).match(pattern); | ||
| if (match && consume !== false) this.pos += match[0].length; | ||
| return match; | ||
| } | ||
| }, | ||
| current: function(){return this.string.slice(this.start, this.pos);} | ||
| }; | ||
| exports.StringStream = StringStream; | ||
|
|
||
| exports.startState = function(mode, a1, a2) { | ||
| return mode.startState ? mode.startState(a1, a2) : true; | ||
| }; | ||
|
|
||
| var modes = exports.modes = {}, mimeModes = exports.mimeModes = {}; | ||
| exports.defineMode = function(name, mode) { modes[name] = mode; }; | ||
| exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; }; | ||
| exports.getMode = function(options, spec) { | ||
| if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) | ||
| spec = mimeModes[spec]; | ||
| if (typeof spec == "string") | ||
| var mname = spec, config = {}; | ||
| else if (spec != null) | ||
| var mname = spec.name, config = spec; | ||
| var mfactory = modes[mname]; | ||
| if (!mfactory) throw new Error("Unknown mode: " + spec); | ||
| return mfactory(options, config || {}); | ||
| }; | ||
|
|
||
| exports.runMode = function(string, modespec, callback) { | ||
| var mode = exports.getMode({indentUnit: 2}, modespec); | ||
| var lines = splitLines(string), state = exports.startState(mode); | ||
| for (var i = 0, e = lines.length; i < e; ++i) { | ||
| if (i) callback("\n"); | ||
| var stream = new exports.StringStream(lines[i]); | ||
| while (!stream.eol()) { | ||
| var style = mode.token(stream, state); | ||
| callback(stream.current(), style, i, stream.start); | ||
| stream.start = stream.pos; | ||
| } | ||
| } | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| CodeMirror.defineMode("commonlisp", function (config) { | ||
| var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/; | ||
| var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/; | ||
| var symbol = /[^\s'`,@()\[\]";]/; | ||
| var type; | ||
|
|
||
| function readSym(stream) { | ||
| var ch; | ||
| while (ch = stream.next()) { | ||
| if (ch == "\\") stream.next(); | ||
| else if (!symbol.test(ch)) { stream.backUp(1); break; } | ||
| } | ||
| return stream.current(); | ||
| } | ||
|
|
||
| function base(stream, state) { | ||
| if (stream.eatSpace()) {type = "ws"; return null;} | ||
| if (stream.match(numLiteral)) return "number"; | ||
| var ch = stream.next(); | ||
| if (ch == "\\") ch = stream.next(); | ||
|
|
||
| if (ch == '"') return (state.tokenize = inString)(stream, state); | ||
| else if (ch == "(") { type = "open"; return "bracket"; } | ||
| else if (ch == ")" || ch == "]") { type = "close"; return "bracket"; } | ||
| else if (ch == ";") { stream.skipToEnd(); type = "ws"; return "comment"; } | ||
| else if (/['`,@]/.test(ch)) return null; | ||
| else if (ch == "|") { | ||
| if (stream.skipTo("|")) { stream.next(); return "symbol"; } | ||
| else { stream.skipToEnd(); return "error"; } | ||
| } else if (ch == "#") { | ||
| var ch = stream.next(); | ||
| if (ch == "[") { type = "open"; return "bracket"; } | ||
| else if (/[+\-=\.']/.test(ch)) return null; | ||
| else if (/\d/.test(ch) && stream.match(/^\d*#/)) return null; | ||
| else if (ch == "|") return (state.tokenize = inComment)(stream, state); | ||
| else if (ch == ":") { readSym(stream); return "meta"; } | ||
| else return "error"; | ||
| } else { | ||
| var name = readSym(stream); | ||
| if (name == ".") return null; | ||
| type = "symbol"; | ||
| if (name == "nil" || name == "t") return "atom"; | ||
| if (name.charAt(0) == ":") return "keyword"; | ||
| if (name.charAt(0) == "&") return "variable-2"; | ||
| return "variable"; | ||
| } | ||
| } | ||
|
|
||
| function inString(stream, state) { | ||
| var escaped = false, next; | ||
| while (next = stream.next()) { | ||
| if (next == '"' && !escaped) { state.tokenize = base; break; } | ||
| escaped = !escaped && next == "\\"; | ||
| } | ||
| return "string"; | ||
| } | ||
|
|
||
| function inComment(stream, state) { | ||
| var next, last; | ||
| while (next = stream.next()) { | ||
| if (next == "#" && last == "|") { state.tokenize = base; break; } | ||
| last = next; | ||
| } | ||
| type = "ws"; | ||
| return "comment"; | ||
| } | ||
|
|
||
| return { | ||
| startState: function () { | ||
| return {ctx: {prev: null, start: 0, indentTo: 0}, tokenize: base}; | ||
| }, | ||
|
|
||
| token: function (stream, state) { | ||
| if (stream.sol() && typeof state.ctx.indentTo != "number") | ||
| state.ctx.indentTo = state.ctx.start + 1; | ||
|
|
||
| type = null; | ||
| var style = state.tokenize(stream, state); | ||
| if (type != "ws") { | ||
| if (state.ctx.indentTo == null) { | ||
| if (type == "symbol" && assumeBody.test(stream.current())) | ||
| state.ctx.indentTo = state.ctx.start + config.indentUnit; | ||
| else | ||
| state.ctx.indentTo = "next"; | ||
| } else if (state.ctx.indentTo == "next") { | ||
| state.ctx.indentTo = stream.column(); | ||
| } | ||
| } | ||
| if (type == "open") state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null}; | ||
| else if (type == "close") state.ctx = state.ctx.prev || state.ctx; | ||
| return style; | ||
| }, | ||
|
|
||
| indent: function (state, textAfter) { | ||
| var i = state.ctx.indentTo; | ||
| return typeof i == "number" ? i : state.ctx.start + 1; | ||
| } | ||
| }; | ||
| }); | ||
|
|
||
| CodeMirror.defineMIME("text/x-common-lisp", "commonlisp"); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>CodeMirror: Common Lisp mode</title> | ||
| <link rel="stylesheet" href="../../lib/codemirror.css"> | ||
| <script src="../../lib/codemirror.js"></script> | ||
| <script src="commonlisp.js"></script> | ||
| <style>.CodeMirror {background: #f8f8f8;}</style> | ||
| <link rel="stylesheet" href="../../doc/docs.css"> | ||
| </head> | ||
| <body> | ||
| <h1>CodeMirror: Common Lisp mode</h1> | ||
| <form><textarea id="code" name="code">(in-package :cl-postgres) | ||
|
|
||
| ;; These are used to synthesize reader and writer names for integer | ||
| ;; reading/writing functions when the amount of bytes and the | ||
| ;; signedness is known. Both the macro that creates the functions and | ||
| ;; some macros that use them create names this way. | ||
| (eval-when (:compile-toplevel :load-toplevel :execute) | ||
| (defun integer-reader-name (bytes signed) | ||
| (intern (with-standard-io-syntax | ||
| (format nil "~a~a~a~a" '#:read- (if signed "" '#:u) '#:int bytes)))) | ||
| (defun integer-writer-name (bytes signed) | ||
| (intern (with-standard-io-syntax | ||
| (format nil "~a~a~a~a" '#:write- (if signed "" '#:u) '#:int bytes))))) | ||
|
|
||
| (defmacro integer-reader (bytes) | ||
| "Create a function to read integers from a binary stream." | ||
| (let ((bits (* bytes 8))) | ||
| (labels ((return-form (signed) | ||
| (if signed | ||
| `(if (logbitp ,(1- bits) result) | ||
| (dpb result (byte ,(1- bits) 0) -1) | ||
| result) | ||
| `result)) | ||
| (generate-reader (signed) | ||
| `(defun ,(integer-reader-name bytes signed) (socket) | ||
| (declare (type stream socket) | ||
| #.*optimize*) | ||
| ,(if (= bytes 1) | ||
| `(let ((result (the (unsigned-byte 8) (read-byte socket)))) | ||
| (declare (type (unsigned-byte 8) result)) | ||
| ,(return-form signed)) | ||
| `(let ((result 0)) | ||
| (declare (type (unsigned-byte ,bits) result)) | ||
| ,@(loop :for byte :from (1- bytes) :downto 0 | ||
| :collect `(setf (ldb (byte 8 ,(* 8 byte)) result) | ||
| (the (unsigned-byte 8) (read-byte socket)))) | ||
| ,(return-form signed)))))) | ||
| `(progn | ||
| ;; This causes weird errors on SBCL in some circumstances. Disabled for now. | ||
| ;; (declaim (inline ,(integer-reader-name bytes t) | ||
| ;; ,(integer-reader-name bytes nil))) | ||
| (declaim (ftype (function (t) (signed-byte ,bits)) | ||
| ,(integer-reader-name bytes t))) | ||
| ,(generate-reader t) | ||
| (declaim (ftype (function (t) (unsigned-byte ,bits)) | ||
| ,(integer-reader-name bytes nil))) | ||
| ,(generate-reader nil))))) | ||
|
|
||
| (defmacro integer-writer (bytes) | ||
| "Create a function to write integers to a binary stream." | ||
| (let ((bits (* 8 bytes))) | ||
| `(progn | ||
| (declaim (inline ,(integer-writer-name bytes t) | ||
| ,(integer-writer-name bytes nil))) | ||
| (defun ,(integer-writer-name bytes nil) (socket value) | ||
| (declare (type stream socket) | ||
| (type (unsigned-byte ,bits) value) | ||
| #.*optimize*) | ||
| ,@(if (= bytes 1) | ||
| `((write-byte value socket)) | ||
| (loop :for byte :from (1- bytes) :downto 0 | ||
| :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value) | ||
| socket))) | ||
| (values)) | ||
| (defun ,(integer-writer-name bytes t) (socket value) | ||
| (declare (type stream socket) | ||
| (type (signed-byte ,bits) value) | ||
| #.*optimize*) | ||
| ,@(if (= bytes 1) | ||
| `((write-byte (ldb (byte 8 0) value) socket)) | ||
| (loop :for byte :from (1- bytes) :downto 0 | ||
| :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value) | ||
| socket))) | ||
| (values))))) | ||
|
|
||
| ;; All the instances of the above that we need. | ||
|
|
||
| (integer-reader 1) | ||
| (integer-reader 2) | ||
| (integer-reader 4) | ||
| (integer-reader 8) | ||
|
|
||
| (integer-writer 1) | ||
| (integer-writer 2) | ||
| (integer-writer 4) | ||
|
|
||
| (defun write-bytes (socket bytes) | ||
| "Write a byte-array to a stream." | ||
| (declare (type stream socket) | ||
| (type (simple-array (unsigned-byte 8)) bytes) | ||
| #.*optimize*) | ||
| (write-sequence bytes socket)) | ||
|
|
||
| (defun write-str (socket string) | ||
| "Write a null-terminated string to a stream \(encoding it when UTF-8 | ||
| support is enabled.)." | ||
| (declare (type stream socket) | ||
| (type string string) | ||
| #.*optimize*) | ||
| (enc-write-string string socket) | ||
| (write-uint1 socket 0)) | ||
|
|
||
| (declaim (ftype (function (t unsigned-byte) | ||
| (simple-array (unsigned-byte 8) (*))) | ||
| read-bytes)) | ||
| (defun read-bytes (socket length) | ||
| "Read a byte array of the given length from a stream." | ||
| (declare (type stream socket) | ||
| (type fixnum length) | ||
| #.*optimize*) | ||
| (let ((result (make-array length :element-type '(unsigned-byte 8)))) | ||
| (read-sequence result socket) | ||
| result)) | ||
|
|
||
| (declaim (ftype (function (t) string) read-str)) | ||
| (defun read-str (socket) | ||
| "Read a null-terminated string from a stream. Takes care of encoding | ||
| when UTF-8 support is enabled." | ||
| (declare (type stream socket) | ||
| #.*optimize*) | ||
| (enc-read-string socket :null-terminated t)) | ||
|
|
||
| (defun skip-bytes (socket length) | ||
| "Skip a given number of bytes in a binary stream." | ||
| (declare (type stream socket) | ||
| (type (unsigned-byte 32) length) | ||
| #.*optimize*) | ||
| (dotimes (i length) | ||
| (read-byte socket))) | ||
|
|
||
| (defun skip-str (socket) | ||
| "Skip a null-terminated string." | ||
| (declare (type stream socket) | ||
| #.*optimize*) | ||
| (loop :for char :of-type fixnum = (read-byte socket) | ||
| :until (zerop char))) | ||
|
|
||
| (defun ensure-socket-is-closed (socket &key abort) | ||
| (when (open-stream-p socket) | ||
| (handler-case | ||
| (close socket :abort abort) | ||
| (error (error) | ||
| (warn "Ignoring the error which happened while trying to close PostgreSQL socket: ~A" error))))) | ||
| </textarea></form> | ||
| <script> | ||
| var editor = CodeMirror.fromTextArea(document.getElementById("code"), {lineNumbers: true}); | ||
| </script> | ||
|
|
||
| <p><strong>MIME types defined:</strong> <code>text/x-common-lisp</code>.</p> | ||
|
|
||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,343 @@ | ||
| var MT = ModeTest; | ||
| MT.modeName = 'stex'; | ||
| MT.modeOptions = {}; | ||
|
|
||
| MT.testMode( | ||
| 'word', | ||
| 'foo', | ||
| [ | ||
| null, 'foo' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'twoWords', | ||
| 'foo bar', | ||
| [ | ||
| null, 'foo bar' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'beginEndDocument', | ||
| '\\begin{document}\n\\end{document}', | ||
| [ | ||
| 'tag', '\\begin', | ||
| 'bracket', '{', | ||
| 'atom', 'document', | ||
| 'bracket', '}', | ||
| 'tag', '\\end', | ||
| 'bracket', '{', | ||
| 'atom', 'document', | ||
| 'bracket', '}' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'beginEndEquation', | ||
| '\\begin{equation}\n E=mc^2\n\\end{equation}', | ||
| [ | ||
| 'tag', '\\begin', | ||
| 'bracket', '{', | ||
| 'atom', 'equation', | ||
| 'bracket', '}', | ||
| null, ' E=mc^2', | ||
| 'tag', '\\end', | ||
| 'bracket', '{', | ||
| 'atom', 'equation', | ||
| 'bracket', '}' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'beginModule', | ||
| '\\begin{module}[]', | ||
| [ | ||
| 'tag', '\\begin', | ||
| 'bracket', '{', | ||
| 'atom', 'module', | ||
| 'bracket', '}[]' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'beginModuleId', | ||
| '\\begin{module}[id=bbt-size]', | ||
| [ | ||
| 'tag', '\\begin', | ||
| 'bracket', '{', | ||
| 'atom', 'module', | ||
| 'bracket', '}[', | ||
| null, 'id=bbt-size', | ||
| 'bracket', ']' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'importModule', | ||
| '\\importmodule[b-b-t]{b-b-t}', | ||
| [ | ||
| 'tag', '\\importmodule', | ||
| 'bracket', '[', | ||
| 'string', 'b-b-t', | ||
| 'bracket', ']{', | ||
| 'builtin', 'b-b-t', | ||
| 'bracket', '}' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'importModulePath', | ||
| '\\importmodule[\\KWARCslides{dmath/en/cardinality}]{card}', | ||
| [ | ||
| 'tag', '\\importmodule', | ||
| 'bracket', '[', | ||
| 'tag', '\\KWARCslides', | ||
| 'bracket', '{', | ||
| 'string', 'dmath/en/cardinality', | ||
| 'bracket', '}]{', | ||
| 'builtin', 'card', | ||
| 'bracket', '}' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'psForPDF', | ||
| '\\PSforPDF[1]{#1}', // could treat #1 specially | ||
| [ | ||
| 'tag', '\\PSforPDF', | ||
| 'bracket', '[', | ||
| 'atom', '1', | ||
| 'bracket', ']{', | ||
| null, '#1', | ||
| 'bracket', '}' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'comment', | ||
| '% foo', | ||
| [ | ||
| 'comment', '% foo' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagComment', | ||
| '\\item% bar', | ||
| [ | ||
| 'tag', '\\item', | ||
| 'comment', '% bar' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'commentTag', | ||
| ' % \\item', | ||
| [ | ||
| null, ' ', | ||
| 'comment', '% \\item' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'commentLineBreak', | ||
| '%\nfoo', | ||
| [ | ||
| 'comment', '%', | ||
| null, 'foo' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagErrorCurly', | ||
| '\\begin}{', | ||
| [ | ||
| 'tag', '\\begin', | ||
| 'error', '}', | ||
| 'bracket', '{' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagErrorSquare', | ||
| '\\item]{', | ||
| [ | ||
| 'tag', '\\item', | ||
| 'error', ']', | ||
| 'bracket', '{' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'commentCurly', | ||
| '% }', | ||
| [ | ||
| 'comment', '% }' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagHash', | ||
| 'the \\# key', | ||
| [ | ||
| null, 'the ', | ||
| 'tag', '\\#', | ||
| null, ' key' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagNumber', | ||
| 'a \\$5 stetson', | ||
| [ | ||
| null, 'a ', | ||
| 'tag', '\\$', | ||
| 'atom', 5, | ||
| null, ' stetson' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagPercent', | ||
| '100\\% beef', | ||
| [ | ||
| 'atom', '100', | ||
| 'tag', '\\%', | ||
| null, ' beef' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagAmpersand', | ||
| 'L \\& N', | ||
| [ | ||
| null, 'L ', | ||
| 'tag', '\\&', | ||
| null, ' N' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagUnderscore', | ||
| 'foo\\_bar', | ||
| [ | ||
| null, 'foo', | ||
| 'tag', '\\_', | ||
| null, 'bar' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagBracketOpen', | ||
| '\\emph{\\{}', | ||
| [ | ||
| 'tag', '\\emph', | ||
| 'bracket', '{', | ||
| 'tag', '\\{', | ||
| 'bracket', '}' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagBracketClose', | ||
| '\\emph{\\}}', | ||
| [ | ||
| 'tag', '\\emph', | ||
| 'bracket', '{', | ||
| 'tag', '\\}', | ||
| 'bracket', '}' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagLetterNumber', | ||
| 'section \\S1', | ||
| [ | ||
| null, 'section ', | ||
| 'tag', '\\S', | ||
| 'atom', '1' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'textTagNumber', | ||
| 'para \\P2', | ||
| [ | ||
| null, 'para ', | ||
| 'tag', '\\P', | ||
| 'atom', '2' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'thinspace', | ||
| 'x\\,y', // thinspace | ||
| [ | ||
| null, 'x', | ||
| 'tag', '\\,', | ||
| null, 'y' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'thickspace', | ||
| 'x\\;y', // thickspace | ||
| [ | ||
| null, 'x', | ||
| 'tag', '\\;', | ||
| null, 'y' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'negativeThinspace', | ||
| 'x\\!y', // negative thinspace | ||
| [ | ||
| null, 'x', | ||
| 'tag', '\\!', | ||
| null, 'y' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'periodNotSentence', | ||
| 'J.\\ L.\\ is', // period not ending a sentence | ||
| [ | ||
| null, 'J.\\ L.\\ is' | ||
| ] | ||
| ); // maybe could be better | ||
|
|
||
| MT.testMode( | ||
| 'periodSentence', | ||
| 'X\\@. The', // period ending a sentence | ||
| [ | ||
| null, 'X', | ||
| 'tag', '\\@', | ||
| null, '. The' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'italicCorrection', | ||
| '{\\em If\\/} I', // italic correction | ||
| [ | ||
| 'bracket', '{', | ||
| 'tag', '\\em', | ||
| null, ' If', | ||
| 'tag', '\\/', | ||
| 'bracket', '}', | ||
| null, ' I' | ||
| ] | ||
| ); | ||
|
|
||
| MT.testMode( | ||
| 'tagBracket', | ||
| '\\newcommand{\\pop}', | ||
| [ | ||
| 'tag', '\\newcommand', | ||
| 'bracket', '{', | ||
| 'tag', '\\pop', | ||
| 'bracket', '}' | ||
| ] | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,15 +8,3 @@ | |
| .mt-output .mt-style { | ||
| font-size: x-small; | ||
| } | ||