Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/assets/rainbow/generic.js
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45/**6* Generic language patterns7*8* @author Craig Campbell9* @version 1.0.910*/11Rainbow.extend([12{13'matches': {141: {15'name': 'keyword.operator',16'pattern': /\=/g17},182: {19'name': 'string',20'matches': {21'name': 'constant.character.escape',22'pattern': /\\('|"){1}/g23}24}25},26'pattern': /(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm27},28{29'name': 'comment',30'pattern': /\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm31},32{33'name': 'constant.numeric',34'pattern': /\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi35},36{37'matches': {381: 'keyword'39},40'pattern': /\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi41},42{43'name': 'constant.language',44'pattern': /true|false|null/g45},46{47'name': 'keyword.operator',48'pattern': /\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g49},50{51'matches': {521: 'function.call'53},54'pattern': /(\w+?)(?=\()/g55},56{57'matches': {581: 'storage.function',592: 'entity.name.function'60},61'pattern': /(function)\s(.*?)(?=\()/g62}63]);646566