From a67f6a28f9ad8779aeddab46cab366b523dffb53 Mon Sep 17 00:00:00 2001
From: Pablo Zubieta <pabloferz@yahoo.com.mx>
Date: Sat, 8 Jul 2017 14:13:28 -0500
Subject: [PATCH] [julia mode] Consistent use tokens

---
 mode/julia/julia.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/mode/julia/julia.js b/mode/julia/julia.js
index a8b114a7..0f290007 100644
--- a/mode/julia/julia.js
+++ b/mode/julia/julia.js
@@ -233,7 +233,8 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
         return "def";
       }
       if (stream.match(/^({[^}]*})*\(/, false)) {
-        return callOrDef(stream, state);
+        state.tokenize = tokenCallOrDef;
+        return state.tokenize(stream, state);
       }
       state.leavingExpr = true;
       return "variable";
@@ -244,7 +245,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
     return "error";
   }
 
-  function callOrDef(stream, state) {
+  function tokenCallOrDef(stream, state) {
     var match = stream.match(/^(\(\s*)/);
     if (match) {
       if (state.firstParenPos < 0)
@@ -260,6 +261,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
         stream.backUp(state.charsAdvanced);
         state.firstParenPos = -1;
         state.charsAdvanced = 0;
+        state.tokenize = tokenBase;
         if (isDefinition)
           return "def";
         return "builtin";
@@ -274,10 +276,11 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
         state.scopes.pop();
       state.firstParenPos = -1;
       state.charsAdvanced = 0;
+      state.tokenize = tokenBase;
       return "builtin";
     }
     state.charsAdvanced += stream.match(/^([^()]*)/)[1].length;
-    return callOrDef(stream, state);
+    return state.tokenize(stream, state);
   }
 
   function tokenAnnotation(stream, state) {
-- 
GitLab