Skip to content

Commit

Permalink
Remove some confused code from the Julia mode
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Mar 2, 2021
1 parent 3c69c82 commit 92eea89
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions mode/julia.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,6 @@ function tokenBase(stream, state) {
state.isDefinition = false;
return "def";
}
if (stream.match(/^({[^}]*})*\(/, false)) {
state.tokenize = tokenCallOrDef;
return state.tokenize(stream, state);
}
state.leavingExpr = true;
return "variable";
}
Expand All @@ -237,46 +233,6 @@ function tokenBase(stream, state) {
return "error";
}

function tokenCallOrDef(stream, state) {
for (;;) {
var match = stream.match(/^(\(\s*)/), charsAdvanced = 0;
if (match) {
if (state.firstParenPos < 0)
state.firstParenPos = state.scopes.length;
state.scopes.push('(');
charsAdvanced += match[1].length;
}
if (currentScope(state) == '(' && stream.match(')')) {
state.scopes.pop();
charsAdvanced += 1;
if (state.scopes.length <= state.firstParenPos) {
var isDefinition = stream.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/, false);
stream.backUp(charsAdvanced);
state.firstParenPos = -1;
state.tokenize = tokenBase;
if (isDefinition)
return "def";
return "builtin";
}
}
// Unfortunately javascript does not support multiline strings, so we have
// to undo anything done upto here if a function call or definition splits
// over two or more lines.
if (stream.match(/^$/g, false)) {
stream.backUp(charsAdvanced);
while (state.scopes.length > state.firstParenPos)
state.scopes.pop();
state.firstParenPos = -1;
state.tokenize = tokenBase;
return "builtin";
}
if (!stream.match(/^[^()]+/)) {
stream.next()
return null
}
}
}

function tokenAnnotation(stream, state) {
stream.match(/.*?(?=[,;{}()=\s]|$)/);
if (stream.match('{')) {
Expand Down

0 comments on commit 92eea89

Please sign in to comment.