-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlexer.py
64 lines (63 loc) · 3.98 KB
/
lexer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter
from pygments.lexer import RegexLexer, words
from pygments.token import *
class ProcessingPyLexer(PythonLexer):
tokens = {
'builtins': [
(words((
'__import__', 'abs', 'all', 'any', 'bin', 'bool', 'bytearray',
'bytes', 'chr', 'classmethod', 'cmp', 'compile', 'complex',
'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'filter',
'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr',
'hash', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass',
'iter', 'len', 'list', 'locals', 'map', 'max', 'memoryview',
'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print',
'property', 'range', 'repr', 'reversed', 'round', 'set', 'setattr',
'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple',
'type', 'vars', 'zip',
# processing.py additions
'abs', 'acos', 'alpha', 'ambient', 'ambientLight', 'applyMatrix',
'arc', 'asin', 'atan', 'atan2', 'background', 'beginCamera',
'beginContour', 'beginRaw', 'beginShape', 'bezier', 'bezierDetail',
'bezierPoint', 'bezierTangent', 'bezierVertex', 'blend',
'blendColor', 'blendMode', 'blue', 'box', 'brightness', 'camera',
'ceil', 'circle', 'clear', 'clip', 'color', 'colorMode',
'constrain', 'copy', 'cos', 'createFont', 'createGraphics',
'createImage', 'createReader', 'createShape', 'createWriter',
'cursor', 'curve', 'curveDetail', 'curvePoint', 'curveTangent',
'curveTightness', 'curveVertex', 'day', 'degrees',
'directionalLight', 'dist', 'draw', 'ellipse', 'ellipseMode',
'emissive', 'endCamera', 'endContour', 'endRaw', 'endShape',
'exit', 'exp', 'fill', 'filter', 'floor', 'frameRate', 'frustum',
'fullScreen', 'get', 'green', 'hour', 'hue', 'image', 'imageMode',
'keyPressed', 'keyReleased', 'keyTyped', 'lerp', 'lerpColor',
'lightFalloff', 'lightSpecular', 'lights', 'line', 'loadBytes',
'loadFont', 'loadImage', 'loadPixels', 'loadShader', 'loadShape',
'loadStrings', 'log', 'loop', 'mag', 'map', 'max', 'millis', 'min',
'minute', 'modelX', 'modelY', 'modelZ', 'month', 'mouseButton',
'mouseClicked', 'mouseDragged', 'mouseMoved', 'mousePressed',
'mousePressed', 'mouseReleased', 'mouseWheel', 'noClip',
'noCursor', 'noFill', 'noLights', 'noLoop', 'noSmooth', 'noStroke',
'noTint', 'noise', 'noiseDetail', 'noiseSeed', 'norm', 'normal',
'ortho', 'perspective', 'pixels', 'point', 'pointLight',
'popMatrix', 'popStyle', 'pow', 'printCamera', 'println',
'printMatrix', 'printProjection', 'pushMatrix', 'pushStyle',
'quad', 'quadraticVertex', 'radians', 'random', 'randomGaussian',
'randomSeed', 'range', 'rect', 'rectMode', 'red', 'redraw',
'requestImage', 'resetMatrix', 'resetShader', 'rotate', 'rotateX',
'rotateY', 'rotateZ', 'round', 'saturation', 'save', 'saveBytes',
'saveFrame', 'saveStrings', 'scale', 'screenX', 'screenY',
'screenZ', 'second', 'selectFolder', 'selectInput', 'selectOutput',
'set', 'setup', 'shader', 'shape', 'shapeMode', 'shearX', 'shearY',
'shininess', 'sin', 'size', 'smooth', 'specular', 'sphere',
'sphereDetail', 'spotLight', 'sq', 'sqrt', 'square', 'stroke',
'strokeCap', 'strokeJoin', 'strokeWeight', 'tan', 'text',
'textAlign', 'textAscent', 'textDescent', 'textFont',
'textLeading', 'textMode', 'textSize', 'textWidth', 'texture',
'textureMode', 'textureWrap', 'tint', 'translate', 'triangle',
'updatePixels', 'vertex', 'year'
), prefix=r'(?<!\.)', suffix=r'\b'), Name.Builtin)
],
}