2
2
// Distributed under an MIT license: https://codemirror.net/LICENSE
3
3
4
4
/*eslint-disable*/
5
+ var p5_javascript_template = require ( "./p5-keywords" ) ;
6
+ var p5FunctionKeywords = p5_javascript_template . p5FunctionKeywords ;
7
+ var p5VariableKeywords = p5_javascript_template . p5VariableKeywords ;
8
+
5
9
( function ( mod ) {
6
10
if ( typeof exports == "object" && typeof module == "object" ) // CommonJS
7
11
mod ( require ( "codemirror" ) ) ;
@@ -25,8 +29,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
25
29
function kw ( type ) { return { type : type , style : "keyword" } ; }
26
30
var A = kw ( "keyword a" ) , B = kw ( "keyword b" ) , C = kw ( "keyword c" ) ;
27
31
var operator = kw ( "operator" ) , atom = { type : "atom" , style : "atom" } ;
28
- var p5Function = { type : "variable" , style : "p5-function" } ;
29
- var p5Variable = { type : "variable" , style : "p5-variable" } ;
30
32
31
33
var jsKeywords = {
32
34
"if" : kw ( "if" ) , "while" : A , "with" : A , "else" : B , "do" : B , "try" : B , "finally" : B ,
@@ -41,85 +43,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
41
43
"await" : C , "async" : kw ( "async" )
42
44
} ;
43
45
44
- var p5FunctionKeywords = {
45
- 'alpha' : p5Function , 'blue' : p5Function , 'brightness' : p5Function , 'color' : p5Function , 'green' : p5Function , 'hue' : p5Function ,
46
- 'lerpColor' : p5Function , 'lightness' : p5Function , 'red' : p5Function , 'saturation' : p5Function , 'background' : p5Function , 'clear' : p5Function ,
47
- 'colorMode' : p5Function , 'fill' : p5Function , 'noFill' : p5Function , 'noStroke' : p5Function , 'stroke' : p5Function , 'arc' : p5Function ,
48
- 'ellipse' : p5Function , 'circle' : p5Function , 'line' : p5Function , 'point' : p5Function , 'quad' : p5Function , 'rect' : p5Function ,
49
- 'square' : p5Function , 'triangle' : p5Function , 'ellipseMode' : p5Function , 'noSmooth' : p5Function , 'rectMode' : p5Function , 'smooth' : p5Function ,
50
- 'strokeCap' : p5Function , 'strokeJoin' : p5Function , 'strokeWeight' : p5Function , 'bezier' : p5Function , 'bezierDetail' : p5Function , 'bezierPoint' : p5Function ,
51
- 'bezierTangent' : p5Function , 'curve' : p5Function , 'curveDetail' : p5Function , 'curveTightness' : p5Function , 'curvePoint' : p5Function , 'curveTangent' : p5Function ,
52
- 'beginContour' : p5Function , 'beginShape' : p5Function , 'bezierVertex' : p5Function , 'curveVertex' : p5Function , 'endContour' : p5Function , 'endShape' : p5Function ,
53
- 'quadraticVertex' : p5Function , 'vertex' : p5Function , 'print' : p5Function , 'cursor' : p5Function , 'frameRate' : p5Function , 'noCursor' : p5Function ,
54
- 'windowResized' : p5Function , 'fullscreen' : p5Function , 'pixelDensity' : p5Function , 'displayDensity' : p5Function , 'getURL' : p5Function , 'getURLPath' : p5Function ,
55
- 'getURLParams' : p5Function , 'preload' : p5Function , 'setup' : p5Function , 'draw' : p5Function , 'remove' : p5Function , 'createCanvas' : p5Function ,
56
- 'resizeCanvas' : p5Function , 'noCanvas' : p5Function , 'createGraphics' : p5Function , 'blendMode' : p5Function , 'noLoop' : p5Function , 'loop' : p5Function ,
57
- 'push' : p5Function , 'pop' : p5Function , 'redraw' : p5Function , 'applyMatrix' : p5Function , 'resetMatrix' : p5Function , 'rotate' : p5Function ,
58
- 'rotateX' : p5Function , 'rotateY' : p5Function , 'rotateZ' : p5Function , 'scale' : p5Function , 'shearX' : p5Function , 'shearY' : p5Function ,
59
- 'translate' : p5Function , 'createStringDict' : p5Function , 'createNumberDict' : p5Function , 'setMoveThreshold' : p5Function , 'setShakeThreshold' : p5Function ,
60
- 'deviceTurned' : p5Function , 'deviceShaken' : p5Function , 'keyPressed' : p5Function , 'keyReleased' : p5Function , 'keyTyped' : p5Function , 'keyIsDown' : p5Function ,
61
- 'mouseMoved' : p5Function , 'mouseDragged' : p5Function , 'mousePressed' : p5Function , 'mouseReleased' : p5Function , 'mouseClicked' : p5Function , 'doubleClicked' : p5Function ,
62
- 'mouseWheel' : p5Function , 'touchStarted' : p5Function , 'touchMoved' : p5Function , 'touchEnded' : p5Function , 'createImage' : p5Function , 'saveCanvas' : p5Function ,
63
- 'saveFrames' : p5Function , 'loadImage' : p5Function , 'image' : p5Function , 'tint' : p5Function , 'noTint' : p5Function , 'imageMode' : p5Function ,
64
- 'blend' : p5Function , 'copy' : p5Function , 'filter' : p5Function , 'get' : p5Function , 'loadPixels' : p5Function , 'set' : p5Function ,
65
- 'updatePixels' : p5Function , 'loadJSON' : p5Function , 'loadStrings' : p5Function , 'loadTable' : p5Function , 'loadXML' : p5Function , 'loadBytes' : p5Function ,
66
- 'httpGet' : p5Function , 'httpPost' : p5Function , 'httpDo' : p5Function , 'createWriter' : p5Function , 'save' : p5Function , 'saveJSON' : p5Function ,
67
- 'saveStrings' : p5Function , 'saveTable' : p5Function , 'abs' : p5Function , 'ceil' : p5Function , 'constrain' : p5Function , 'dist' : p5Function ,
68
- 'exp' : p5Function , 'floor' : p5Function , 'lerp' : p5Function , 'log' : p5Function , 'mag' : p5Function , 'map' : p5Function ,
69
- 'max' : p5Function , 'min' : p5Function , 'norm' : p5Function , 'pow' : p5Function , 'round' : p5Function , 'sq' : p5Function ,
70
- 'sqrt' : p5Function , 'createVector' : p5Function , 'noise' : p5Function , 'noiseDetail' : p5Function , 'noiseSeed' : p5Function , 'randomSeed' : p5Function ,
71
- 'random' : p5Function , 'randomGaussian' : p5Function , 'acos' : p5Function , 'asin' : p5Function , 'atan' : p5Function , 'atan2' : p5Function ,
72
- 'cos' : p5Function , 'sin' : p5Function , 'tan' : p5Function , 'degrees' : p5Function , 'radians' : p5Function , 'angleMode' : p5Function ,
73
- 'textAlign' : p5Function , 'textLeading' : p5Function , 'textSize' : p5Function , 'textStyle' : p5Function , 'textWidth' : p5Function , 'textAscent' : p5Function ,
74
- 'textDescent' : p5Function , 'loadFont' : p5Function , 'text' : p5Function , 'textFont' : p5Function , 'append' : p5Function , 'arrayCopy' : p5Function ,
75
- 'concat' : p5Function , 'reverse' : p5Function , 'shorten' : p5Function , 'shuffle' : p5Function , 'sort' : p5Function , 'splice' : p5Function ,
76
- 'subset' : p5Function , 'float' : p5Function , 'int' : p5Function , 'str' : p5Function , 'boolean' : p5Function , 'byte' : p5Function ,
77
- 'char' : p5Function , 'unchar' : p5Function , 'hex' : p5Function , 'unhex' : p5Function , 'join' : p5Function , 'match' : p5Function ,
78
- 'matchAll' : p5Function , 'nf' : p5Function , 'nfc' : p5Function , 'nfp' : p5Function , 'nfs' : p5Function , 'split' : p5Function ,
79
- 'splitTokens' : p5Function , 'trim' : p5Function , 'day' : p5Function , 'hour' : p5Function , 'minute' : p5Function , 'millis' : p5Function ,
80
- 'month' : p5Function , 'second' : p5Function , 'year' : p5Function , 'plane' : p5Function , 'box' : p5Function , 'sphere' : p5Function ,
81
- 'cylinder' : p5Function , 'cone' : p5Function , 'ellipsoid' : p5Function , 'torus' : p5Function , 'orbitControl' : p5Function , 'debugMode' : p5Function ,
82
- 'noDebugMode' : p5Function , 'ambientLight' : p5Function , 'directionalLight' : p5Function , 'pointLight' : p5Function , 'loadModel' : p5Function ,
83
- 'loadShader' : p5Function , 'createShader' : p5Function , 'shader' : p5Function , 'normalMaterial' : p5Function , 'texture' : p5Function ,
84
- 'ambientMaterial' : p5Function , 'specularMaterial' : p5Function , 'camera' : p5Function , 'perspective' : p5Function , 'ortho' : p5Function ,
85
- 'setCamera' : p5Function , 'setAttributes' : p5Function , 'select' : p5Function , 'selectAll' : p5Function , 'removeElements' : p5Function , 'changed' : p5Function ,
86
- 'input' : p5Function , 'createDiv' : p5Function , 'createP' : p5Function , 'createSpan' : p5Function , 'createImg' : p5Function , 'createA' : p5Function ,
87
- 'createSlider' : p5Function , 'createButton' : p5Function , 'createCheckbox' : p5Function , 'createSelect' : p5Function , 'createRadio' : p5Function ,
88
- 'createColorPicker' : p5Function , 'textureMode' : p5Function , 'createCamera' : p5Function , 'model' : p5Function ,
89
- 'createInput' : p5Function , 'createFileInput' : p5Function , 'createVideo' : p5Function , 'createAudio' : p5Function , 'createCapture' : p5Function ,
90
- 'createElement' : p5Function , 'deviceMoved' : p5Function ,
91
- 'sampleRate' : p5Function , 'freqToMidi' : p5Function , 'midiToFreq' : p5Function , 'soundFormats' : p5Function , 'saveSound' : p5Function ,
92
- } ;
93
-
94
- var p5VariableKeywords = {
95
- 'P2D' : p5Variable , 'WEBGL' : p5Variable , 'ARROW' : p5Variable , 'CROSS' : p5Variable , 'HAND' : p5Variable ,
96
- 'MOVE' : p5Variable , 'TEXT' : p5Variable ,
97
- 'WAIT' : p5Variable , 'HALF_PI' : p5Variable , 'PI' : p5Variable , 'QUARTER_PI' : p5Variable ,
98
- 'TAU' : p5Variable , 'TWO_PI' : p5Variable , 'DEGREES' : p5Variable ,
99
- 'RADIANS' : p5Variable , 'CORNER' : p5Variable , 'CORNERS' : p5Variable , 'RADIUS' : p5Variable ,
100
- 'RIGHT' : p5Variable , 'LEFT' : p5Variable , 'CENTER' : p5Variable , 'TOP' : p5Variable , 'BOTTOM' : p5Variable ,
101
- 'BASELINE' : p5Variable , 'POINTS' : p5Variable , 'LINES' : p5Variable , 'LINE_STRIP' : p5Variable , 'LINE_LOOP' : p5Variable ,
102
- 'TRIANGLES' : p5Variable , 'TRIANGLE_FAN' : p5Variable , 'TRIANGLE_STRIP' : p5Variable , 'QUADS' : p5Variable ,
103
- 'QUAD_STRIP' : p5Variable , 'CLOSE' : p5Variable , 'OPEN' : p5Variable , 'CHORD' : p5Variable , 'PIE' : p5Variable ,
104
- 'PROJECT' : p5Variable , 'SQUARE' : p5Variable , 'ROUND' : p5Variable , 'BEVEL' : p5Variable , 'MITER' : p5Variable ,
105
- 'RGB' : p5Variable , 'HSB' : p5Variable , 'HSL' : p5Variable , 'AUTO' : p5Variable , 'BLEND' : p5Variable , 'ADD' : p5Variable ,
106
- 'DARKEST' : p5Variable , 'LIGHTEST' : p5Variable , 'DIFFERENCE' : p5Variable , 'EXCLUSION' : p5Variable , 'MULTIPLY' : p5Variable ,
107
- 'SCREEN' : p5Variable , 'REPLACE' : p5Variable , 'OVERLAY' : p5Variable , 'HARD_LIGHT' : p5Variable , 'SOFT_LIGHT' : p5Variable ,
108
- 'DODGE' : p5Variable , 'BURN' : p5Variable , 'THRESHOLD' : p5Variable , 'GRAY' : p5Variable , 'OPAQUE' : p5Variable ,
109
- 'INVERT' : p5Variable , 'POSTERIZE' : p5Variable , 'DILATE' : p5Variable , 'ERODE' : p5Variable , 'BLUR' : p5Variable ,
110
- 'NORMAL' : p5Variable , 'ITALIC' : p5Variable , 'BOLD' : p5Variable , 'BOLDITALIC' : p5Variable , 'LANDSCAPE' : p5Variable ,
111
- 'PORTRAIT' : p5Variable , 'GRID' : p5Variable , 'AXES' : p5Variable , 'frameCount' : p5Variable , 'focused' : p5Variable ,
112
- 'displayWidth' : p5Variable , 'displayHeight' : p5Variable , 'windowWidth' : p5Variable , 'windowHeight' : p5Variable ,
113
- 'width' : p5Variable , 'height' : p5Variable , 'deviceOrientation' : p5Variable , 'accelerationX' : p5Variable ,
114
- 'accelerationY' : p5Variable , 'accelerationZ' : p5Variable , 'pAccelerationX' : p5Variable , 'pAccelerationY' : p5Variable ,
115
- 'pAccelerationZ' : p5Variable , 'rotationX' : p5Variable , 'rotationY' : p5Variable , 'rotationZ' : p5Variable ,
116
- 'pRotationX' : p5Variable , 'pRotationY' : p5Variable , 'pRotationZ' : p5Variable , 'turnAxis' : p5Variable ,
117
- 'keyIsPressed' : p5Variable , 'key' : p5Variable , 'keyCode' : p5Variable , 'mouseX' : p5Variable , 'mouseY' : p5Variable ,
118
- 'pmouseX' : p5Variable , 'pmouseY' : p5Variable , 'winMouseX' : p5Variable , 'winMouseY' : p5Variable ,
119
- 'pwinMouseX' : p5Variable , 'pwinMouseY' : p5Variable , 'mouseButton' : p5Variable ,
120
- 'mouseIsPressed' : p5Variable , 'touches' : p5Variable , 'pixels' : p5Variable , 'VIDEO' : p5Variable , 'AUDIO' : p5Variable
121
- } ;
122
-
123
46
for ( var attr in p5FunctionKeywords ) {
124
47
jsKeywords [ attr ] = p5FunctionKeywords [ attr ] ;
125
48
}
0 commit comments