From 0d2d099d229a8999d1ee7c4ab81d8dc8a22fa177 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Wed, 6 May 2020 14:41:08 -0400 Subject: [PATCH] Change helper file name to p5-keywords.js --- client/utils/p5-javascript.js | 2 +- client/utils/{p5-javascript-template.js => p5-keywords.js} | 4 ++-- server/scripts/update-syntax-highlighting.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename client/utils/{p5-javascript-template.js => p5-keywords.js} (98%) diff --git a/client/utils/p5-javascript.js b/client/utils/p5-javascript.js index b0606b0c..aad59977 100644 --- a/client/utils/p5-javascript.js +++ b/client/utils/p5-javascript.js @@ -2,7 +2,7 @@ // Distributed under an MIT license: https://codemirror.net/LICENSE /*eslint-disable*/ -var p5_javascript_template = require("./p5-javascript-template"); +var p5_javascript_template = require("./p5-keywords"); var p5FunctionKeywords = p5_javascript_template.p5FunctionKeywords; var p5VariableKeywords = p5_javascript_template.p5VariableKeywords; diff --git a/client/utils/p5-javascript-template.js b/client/utils/p5-keywords.js similarity index 98% rename from client/utils/p5-javascript-template.js rename to client/utils/p5-keywords.js index 36b3a7f2..f25aab28 100644 --- a/client/utils/p5-javascript-template.js +++ b/client/utils/p5-keywords.js @@ -1,5 +1,5 @@ -/*eslint-disable*/ -/*helper file for syntax highlighting generated by update-syntax-highlighting script*/ +/* eslint-disable */ +/* generated: do not edit! helper file for syntax highlighting. generated by update-syntax-highlighting script */ var p5Function = {type: "variable", style: "p5-function"}; var p5Variable = {type: "variable", style: "p5-variable"}; let p5VariableKeywords = {"P2D":p5Variable,"WEBGL":p5Variable,"ARROW":p5Variable,"CROSS":p5Variable,"HAND":p5Variable,"MOVE":p5Variable,"TEXT":p5Variable,"WAIT":p5Variable,"HALF_PI":p5Variable,"PI":p5Variable,"QUARTER_PI":p5Variable,"TAU":p5Variable,"TWO_PI":p5Variable,"DEGREES":p5Variable,"RADIANS":p5Variable,"CORNER":p5Variable,"CORNERS":p5Variable,"RADIUS":p5Variable,"RIGHT":p5Variable,"LEFT":p5Variable,"CENTER":p5Variable,"TOP":p5Variable,"BOTTOM":p5Variable,"BASELINE":p5Variable,"POINTS":p5Variable,"LINES":p5Variable,"LINE_STRIP":p5Variable,"LINE_LOOP":p5Variable,"TRIANGLES":p5Variable,"TRIANGLE_FAN":p5Variable,"TRIANGLE_STRIP":p5Variable,"QUADS":p5Variable,"QUAD_STRIP":p5Variable,"TESS":p5Variable,"CLOSE":p5Variable,"OPEN":p5Variable,"CHORD":p5Variable,"PIE":p5Variable,"PROJECT":p5Variable,"SQUARE":p5Variable,"ROUND":p5Variable,"BEVEL":p5Variable,"MITER":p5Variable,"RGB":p5Variable,"HSB":p5Variable,"HSL":p5Variable,"AUTO":p5Variable,"ALT":p5Variable,"BACKSPACE":p5Variable,"CONTROL":p5Variable,"DELETE":p5Variable,"DOWN_ARROW":p5Variable,"ENTER":p5Variable,"ESCAPE":p5Variable,"LEFT_ARROW":p5Variable,"OPTION":p5Variable,"RETURN":p5Variable,"RIGHT_ARROW":p5Variable,"SHIFT":p5Variable,"TAB":p5Variable,"UP_ARROW":p5Variable,"BLEND":p5Variable,"REMOVE":p5Variable,"ADD":p5Variable,"DARKEST":p5Variable,"LIGHTEST":p5Variable,"DIFFERENCE":p5Variable,"SUBTRACT":p5Variable,"EXCLUSION":p5Variable,"MULTIPLY":p5Variable,"SCREEN":p5Variable,"REPLACE":p5Variable,"OVERLAY":p5Variable,"HARD_LIGHT":p5Variable,"SOFT_LIGHT":p5Variable,"DODGE":p5Variable,"BURN":p5Variable,"THRESHOLD":p5Variable,"GRAY":p5Variable,"OPAQUE":p5Variable,"INVERT":p5Variable,"POSTERIZE":p5Variable,"DILATE":p5Variable,"ERODE":p5Variable,"BLUR":p5Variable,"NORMAL":p5Variable,"ITALIC":p5Variable,"BOLD":p5Variable,"BOLDITALIC":p5Variable,"LINEAR":p5Variable,"QUADRATIC":p5Variable,"BEZIER":p5Variable,"CURVE":p5Variable,"STROKE":p5Variable,"FILL":p5Variable,"TEXTURE":p5Variable,"IMMEDIATE":p5Variable,"IMAGE":p5Variable,"NEAREST":p5Variable,"REPEAT":p5Variable,"CLAMP":p5Variable,"MIRROR":p5Variable,"LANDSCAPE":p5Variable,"PORTRAIT":p5Variable,"GRID":p5Variable,"AXES":p5Variable,"frameCount":p5Variable,"deltaTime":p5Variable,"focused":p5Variable,"displayWidth":p5Variable,"displayHeight":p5Variable,"windowWidth":p5Variable,"windowHeight":p5Variable,"width":p5Variable,"height":p5Variable,"disableFriendlyErrors":p5Variable,"drawingContext":p5Variable,"VIDEO":p5Variable,"AUDIO":p5Variable,"deviceOrientation":p5Variable,"accelerationX":p5Variable,"accelerationY":p5Variable,"accelerationZ":p5Variable,"pAccelerationX":p5Variable,"pAccelerationY":p5Variable,"pAccelerationZ":p5Variable,"rotationX":p5Variable,"rotationY":p5Variable,"rotationZ":p5Variable,"pRotationX":p5Variable,"pRotationY":p5Variable,"pRotationZ":p5Variable,"turnAxis":p5Variable,"keyIsPressed":p5Variable,"key":p5Variable,"keyCode":p5Variable,"movedX":p5Variable,"movedY":p5Variable,"mouseX":p5Variable,"mouseY":p5Variable,"pmouseX":p5Variable,"pmouseY":p5Variable,"winMouseX":p5Variable,"winMouseY":p5Variable,"pwinMouseX":p5Variable,"pwinMouseY":p5Variable,"mouseButton":p5Variable,"mouseIsPressed":p5Variable,"touches":p5Variable,"pixels":p5Variable}; diff --git a/server/scripts/update-syntax-highlighting.js b/server/scripts/update-syntax-highlighting.js index 6fcf1a5d..d9b1d564 100644 --- a/server/scripts/update-syntax-highlighting.js +++ b/server/scripts/update-syntax-highlighting.js @@ -27,15 +27,15 @@ request('https://p5js.org/reference/data.json', (err, res) => { p5VariablePart = p5VariablePart.replace(/"p5Variable"/g, 'p5Variable'); p5FunctionPart = p5FunctionPart.replace(/"p5Function"/g, 'p5Function'); - let generatedCode = '/*eslint-disable*/ \n'; - generatedCode += '/*helper file for syntax highlighting generated by update-syntax-highlighting script*/ \n'; + let generatedCode = '/* eslint-disable */ \n'; + generatedCode += '/* generated: do not edit! helper file for syntax highlighting. generated by update-syntax-highlighting script */ \n'; generatedCode += 'var p5Function = {type: "variable", style: "p5-function"};\n'; generatedCode += 'var p5Variable = {type: "variable", style: "p5-variable"};\n'; generatedCode += `let p5VariableKeywords = ${p5VariablePart}; \n`; generatedCode += `let p5FunctionKeywords = ${p5FunctionPart}; \n`; generatedCode += 'exports.p5FunctionKeywords = p5FunctionKeywords;\n'; generatedCode += 'exports.p5VariableKeywords = p5VariableKeywords;\n'; - fs.writeFile(`${process.cwd()}/client/utils/p5-javascript-template.js`, generatedCode, (error) => { + fs.writeFile(`${process.cwd()}/client/utils/p5-keywords.js`, generatedCode, (error) => { if (error) { console.log("Error!! Couldn't write to the file", error); } else {