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