|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
const CodeMirror = require('codemirror')
|
|
|
|
|
|
|
|
|
|
CodeMirror.defineMode('nimrod', function(conf, parserConf) {
|
|
|
|
@ -375,10 +374,10 @@ CodeMirror.defineMode('nimrod', function(conf, parserConf) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Handle Number Literals
|
|
|
|
|
if (stream.match(/^[0-9\.]/, false)) {
|
|
|
|
|
if (stream.match(/^[0-9.]/, false)) {
|
|
|
|
|
var floatLiteral = false
|
|
|
|
|
// Floats
|
|
|
|
|
if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) {
|
|
|
|
|
if (stream.match(/^\d*\.\d+(e[+-]?\d+)?/i)) {
|
|
|
|
|
floatLiteral = true
|
|
|
|
|
}
|
|
|
|
|
if (stream.match(/^\d+\.\d*/)) {
|
|
|
|
@ -407,10 +406,9 @@ CodeMirror.defineMode('nimrod', function(conf, parserConf) {
|
|
|
|
|
intLiteral = true
|
|
|
|
|
}
|
|
|
|
|
// Decimal
|
|
|
|
|
if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
|
|
|
|
|
if (stream.match(/^[1-9]\d*(e[+-]?\d+)?/)) {
|
|
|
|
|
// Decimal literals may be "imaginary"
|
|
|
|
|
stream.eat(/J/i)
|
|
|
|
|
// TODO - Can you have imaginary longs?
|
|
|
|
|
intLiteral = true
|
|
|
|
|
}
|
|
|
|
|
// Zero by itself with no other piece of number.
|
|
|
|
@ -572,7 +570,7 @@ CodeMirror.defineMode('nimrod', function(conf, parserConf) {
|
|
|
|
|
|
|
|
|
|
if (delimiter_index !== -1) {
|
|
|
|
|
indent(stream, state, '])}'.slice(delimiter_index, delimiter_index + 1))
|
|
|
|
|
} else if (stream.eol() && current.match(/\=|\:|import|include|type|const|var|let/)) {
|
|
|
|
|
} else if (stream.eol() && current.match(/=|:|import|include|type|const|var|let/)) {
|
|
|
|
|
indent(stream, state)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|