diff --git a/lib/ace/mode/_test/tokens_jade.json b/lib/ace/mode/_test/tokens_jade.json index 502c6c1d..5bf45968 100644 --- a/lib/ace/mode/_test/tokens_jade.json +++ b/lib/ace/mode/_test/tokens_jade.json @@ -27,28 +27,29 @@ ],[ "start" ],[ - "comment_block", - ["punctuation.section.comment","// "] + ["comment_block",0,"start"], + ["comment","// "] ],[ - "comment_block", - ["comment.block.jade"," here it is. a block comment!"] + ["comment_block",0,"start"], + ["comment"," here it is. a block comment!"] ],[ - "comment_block", - ["comment.block.jade"," and another row!"] + ["comment_block",0,"start"], + ["comment"," and another row!"] ],[ "start", - ["text","but not here."] + ["meta.tag.any.jade","but"], + ["text"," not here."] ],[ "start" ],[ - "comment_block", - ["punctuation.section.comment"," // "] + ["comment_block",5,"start"], + ["comment"," // "] ],[ - "comment_block", - ["comment.block.jade"," a far spaced"] + ["comment_block",5,"start"], + ["comment"," a far spaced"] ],[ - "comment_block", - ["comment.block.jade"," should be lack of block"] + "start", + ["text"," should be lack of block"] ],[ "start" ],[ diff --git a/lib/ace/mode/_test/tokens_lsl.json b/lib/ace/mode/_test/tokens_lsl.json new file mode 100644 index 00000000..7fbdc397 --- /dev/null +++ b/lib/ace/mode/_test/tokens_lsl.json @@ -0,0 +1,1680 @@ +[[ + "start", + ["comment.line","//////////////////////////////////////////////////////////////////// "] +],[ + "start", + ["comment.line","//"] +],[ + "start", + ["comment.line","// AbcText"] +],[ + "start", + ["comment.line","// by Ange Capalini"] +],[ + "start", + ["comment.line","// Originally Written 10/31/2011"] +],[ + "start", + ["comment.line","// code released to the public domain"] +],[ + "start", + ["comment.line","// "] +],[ + "start", + ["comment.line","//////////////////////////////////////////////////////////////////// "] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "] +],[ + "start", + ["comment.line","//=================================================================="] +],[ + "start", + ["comment.line","// INSTRUCTIONS"] +],[ + "start", + ["comment.line","//=================================================================="] +],[ + "start", + ["comment.line","//"] +],[ + "start", + ["comment.line","// - set Max Particles to 4096"] +],[ + "start", + ["comment.line","// - create white cube \"board\" <15.500, 0.010, 0.800>"] +],[ + "start", + ["comment.line","// - create red cube \"cursor\" <0.050, 0.010, 0.030> & drop AbcText"] +],[ + "start", + ["comment.line","// - link cursor (child) to board (root)"] +],[ + "start", + ["comment.line","// - send message <= 25 char. to chanel 20"] +],[ + "start", + ["comment.line","// - that's all folk's"] +],[ + "start", + ["comment.line","//"] +],[ + "start", + ["comment.line","/////////////////////////////////////////////////////////////////////"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "] +],[ + "start", + ["comment.line","//==========================================="] +],[ + "start", + ["comment.line","// CONSTANTS"] +],[ + "start", + ["comment.line","//==========================================="] +],[ + "start", + ["storage.type","float"], + ["text"," "], + ["identifier","Size_Point"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["constant.numeric","0.1"], + ["punctuation.operator",";"], + ["text"," "], + ["comment.line","//pixel size"] +],[ + "start", + ["storage.type","string"], + ["text"," "], + ["identifier","Txt_Point"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["string.double","\"\""], + ["punctuation.operator",";"], + ["text"," "], + ["comment.line","//pixel texture"] +],[ + "start", + ["storage.type","vector"], + ["text"," "], + ["identifier","Color_Point"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["keyword.operator","<"], + ["text"," "], + ["constant.numeric","0"], + ["punctuation.operator",".,"], + ["text"," "], + ["constant.numeric","0"], + ["punctuation.operator",".,"], + ["text"," "], + ["constant.numeric","1"], + ["punctuation.operator","."], + ["text"," "], + ["keyword.operator",">"], + ["punctuation.operator",";"], + ["text"," "], + ["comment.line","//pixel color"] +],[ + "start", + ["storage.type","vector"], + ["text"," "], + ["identifier","Size_Affich"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["keyword.operator","<"], + ["constant.numeric","15.5"], + ["punctuation.operator",","], + ["text"," "], + ["punctuation.operator","."], + ["constant.numeric","01"], + ["punctuation.operator",","], + ["text"," "], + ["punctuation.operator","."], + ["constant.numeric","8"], + ["keyword.operator",">"], + ["punctuation.operator",";"], + ["text"," "], + ["comment.line","//display size"] +],[ + "start", + ["text"," "] +],[ + "start", + ["comment.line","//==========================================="] +],[ + "start", + ["comment.line","// GLOBALS VARIABLES"] +],[ + "start", + ["comment.line","//==========================================="] +],[ + "start", + ["storage.type","list"], + ["text"," "], + ["identifier","Alphabet"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["paren.lparen","["], + ["text"," "], + ["string.double","\" \""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"A\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"B\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"C\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"D\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"E\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"F\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"G\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"H\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"I\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"J\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"K\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"L\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"M\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"N\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"O\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"P\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"Q\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"R\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"S\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"T\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"U\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"V\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"W\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"X\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"Y\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"Z\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"a\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"b\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"c\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"d\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"e\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"f\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"g\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"h\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"i\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"j\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"k\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"l\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"m\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"n\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"o\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"p\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"q\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"r\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"s\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"t\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"u\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"v\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"w\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"x\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"y\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"z\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"0\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"1\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"2\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"3\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"4\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"5\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"6\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"7\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"8\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"9\""], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\":\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"'\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\",\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"!\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"?\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"#\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\".\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"/\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"-\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"�\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"�\""], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"�\""], + ["text"," "], + ["paren.rparen","]"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "] +],[ + "start", + ["comment.line","//char matrix 6 x 5 points"] +],[ + "start", + ["storage.type","list"], + ["text"," "], + ["identifier","Matrices"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["paren.lparen","["], + ["text"," "], + ["string.double","\" \""], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"011001001010010111101001000000\""], + ["punctuation.operator",","], + ["text"," "], + ["comment.line","//A"] +],[ + "start", + ["text"," "], + ["string.double","\"111001001011100100101110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011001000010000100000110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111001001010010100101110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111001000011100100001110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111001000011100100001000000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011101000010110100100111000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100101001011110100101001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111000100001000010001110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"001100001000010100100110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100101010011000101001001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100001000010000100001110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100011101110101100011000100000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100101101010110100101001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011001001010010100100110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111001001010010111001000000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011001001010010100100110000010\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111001001010010111001001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011101000001100000101110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111000100001000010000100000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100101001010010100100110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100101001010100101000100000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100011010110101101010101000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100101001001100100101001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100101001001110000100110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111100001001100100001111000000\""], + ["punctuation.operator",","], + ["text"," "], + ["comment.line","//Z"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"000000110010010100100111000000\""], + ["punctuation.operator",","], + ["text"," "], + ["comment.line","//a"] +],[ + "start", + ["text"," "], + ["string.double","\"100001110010010100101110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000000110010000100000110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000100111010010100100111000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000000111010010101000111000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011001000011000100001000000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011001001010010011100001001100\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100001110010010100101001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100000000010000100001000000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"001000000000100001000010011000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100001001010100110101001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100001000010000100001000000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000001101010101101011010100000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000001110010010100101001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000000110010010100100110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111001001010010111001000010000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011101001010010011100001000010\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000001010011000100001000000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000000111011000001101110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"010001110001000010000100000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000001001010010100100111000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000001001010010100100110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000001010110101101010101000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000001001001100011001001000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"100101001010010011100001001100\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000001111000100010001111000000\""], + ["punctuation.operator",","], + ["text"," "], + ["comment.line","//z"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"011001001010010100100110000000\""], + ["punctuation.operator",","], + ["text"," "], + ["comment.line","//0"] +],[ + "start", + ["text"," "], + ["string.double","\"011000010000100001000010000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111000001001100100001111000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111000001001100000101110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"001000110010100111100010000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111101000011100000101110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011001000011100100100110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"111100001000100010000100000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011001001001100100100110000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"011001001001110000100110000000\""], + ["punctuation.operator",","], + ["text"," "], + ["comment.line","//9"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"000000000000100000000010000000\""], + ["punctuation.operator",","], + ["text"," "], + ["comment.line","//:"] +],[ + "start", + ["text"," "], + ["string.double","\"000100010000000000000000000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"000000000000000000100010000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"001000010000100000000010000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"001000101000010001000000000100\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"010101111101010111110101000000\""], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"000000000000000000000010000000\""], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"000010001000100010001000000000\""], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"000000000001110000000000000000\""], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["string.double","\"000100110010010101000111000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"010000111010010101000111000000\""], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["string.double","\"010000110010010100100111000000\""], + ["text"," "], + ["comment.line","//�"] +],[ + "start", + ["text"," "], + ["paren.rparen","]"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "] +],[ + "start", + ["storage.type","list"], + ["text"," "], + ["identifier","Particle_Parameters"], + ["keyword.operator","="], + ["paren.lparen","["], + ["paren.rparen","]"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","vector"], + ["text"," "], + ["identifier","Origine"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","string"], + ["text"," "], + ["identifier","Texte"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","integer"], + ["text"," "], + ["identifier","id_Phrase"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","integer"], + ["text"," "], + ["identifier","len_Phrase"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","integer"], + ["text"," "], + ["identifier","id_Lettre"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","string"], + ["text"," "], + ["identifier","Lettre"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","string"], + ["text"," "], + ["identifier","matrice_Lettre"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","vector"], + ["text"," "], + ["identifier","point_zero"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","integer"], + ["text"," "], + ["identifier","x"], + ["punctuation.operator",";"] +],[ + "start", + ["storage.type","integer"], + ["text"," "], + ["identifier","z"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "] +],[ + "start", + ["comment.line","//==========================================="] +],[ + "start", + ["comment.line","// SET PARTICLES"] +],[ + "start", + ["comment.line","//==========================================="] +],[ + "start", + ["text"," "] +],[ + "start", + ["identifier","init_particles"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["paren.lparen","{"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","Particle_Parameters"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["paren.lparen","["], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_SRC_TEXTURE"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","Txt_Point"], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_PART_START_SCALE"], + ["punctuation.operator",","], + ["text"," "], + ["keyword.operator","<"], + ["text"," "], + ["identifier","Size_Point"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","Size_Point"], + ["punctuation.operator",","], + ["text"," "], + ["constant.language","FALSE"], + ["text"," "], + ["keyword.operator",">"], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_PART_END_SCALE"], + ["punctuation.operator",","], + ["text"," "], + ["keyword.operator","<"], + ["text"," "], + ["identifier","Size_Point"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","Size_Point"], + ["punctuation.operator",","], + ["text"," "], + ["constant.language","FALSE"], + ["text"," "], + ["keyword.operator",">"], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_PART_START_COLOR"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","Color_Point"], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_PART_END_COLOR"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","Color_Point"], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_SRC_BURST_PART_COUNT"], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","("], + ["storage.type","integer"], + ["paren.rparen",")"], + ["constant.numeric","1"], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_SRC_BURST_RATE"], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","("], + ["storage.type","float"], + ["paren.rparen",")"], + ["text"," "], + ["constant.numeric","0.0"], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_PART_MAX_AGE"], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","("], + ["storage.type","float"], + ["paren.rparen",")"], + ["text"," "], + ["constant.numeric","30.0"], + ["punctuation.operator",","], + ["text"," "] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_SRC_PATTERN"], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","("], + ["storage.type","integer"], + ["paren.rparen",")"], + ["text"," "], + ["constant.numeric","1"], + ["punctuation.operator",","] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","PSYS_PART_FLAGS"], + ["punctuation.operator",","] +],[ + "start", + ["text"," "], + ["identifier","PSYS_PART_EMISSIVE_MASK"] +],[ + "start", + ["text"," "], + ["paren.rparen","]"], + ["punctuation.operator",";"] +],[ + "start", + ["paren.rparen","}"] +],[ + "start", + ["text"," "] +],[ + "start", + ["comment.line","//==========================================="] +],[ + "start", + ["comment.line","// SET DISPLAY"] +],[ + "start", + ["comment.line","//==========================================="] +],[ + "start", + ["identifier","affichage"], + ["text"," "], + ["paren.lparen","("], + ["storage.type","string"], + ["text"," "], + ["identifier","phrase"], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["storage.type","integer"], + ["text"," "], + ["identifier","len_Phrase"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["support.function","llStringLength"], + ["paren.lparen","("], + ["identifier","phrase"], + ["paren.rparen",")"], + ["constant.numeric","-1"], + ["punctuation.operator",";"], + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.control","for"], + ["paren.lparen","("], + ["identifier","id_Phrase"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["constant.numeric","0"], + ["punctuation.operator",";"], + ["text"," "], + ["identifier","id_Phrase"], + ["text"," "], + ["keyword.operator","<="], + ["text"," "], + ["identifier","len_Phrase"], + ["punctuation.operator",";"], + ["keyword.operator","++"], + ["identifier","id_Phrase"], + ["paren.rparen",")"], + ["paren.lparen","{"], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","Lettre"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["support.function","llGetSubString"], + ["paren.lparen","("], + ["identifier","phrase"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","id_Phrase"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","id_Phrase"], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["identifier","id_Lettre"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["support.function","llListFindList"], + ["paren.lparen","("], + ["identifier","Alphabet"], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","["], + ["identifier","Lettre"], + ["paren.rparen","])"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["identifier","matrice_Lettre"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["support.function","llList2String"], + ["paren.lparen","("], + ["identifier","Matrices"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","id_Lettre"], + ["paren.rparen",")"], + ["punctuation.operator",";"], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","z"], + ["keyword.operator","="], + ["constant.numeric","0"], + ["punctuation.operator",";"], + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.control","do"], + ["paren.lparen","{"], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","x"], + ["keyword.operator","="], + ["constant.numeric","0"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.control","do"], + ["paren.lparen","{"] +],[ + "start", + ["text"," "], + ["keyword.control","if"], + ["paren.lparen","("], + ["text"," "], + ["paren.lparen","("], + ["storage.type","integer"], + ["paren.rparen",")"], + ["support.function","llGetSubString"], + ["paren.lparen","("], + ["identifier","matrice_Lettre"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","x"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric","5"], + ["keyword.operator","*"], + ["identifier","z"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","x"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric","5"], + ["keyword.operator","*"], + ["identifier","z"], + ["paren.rparen",")"], + ["text"," "], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"] +],[ + "start", + ["text"," "], + ["support.function","llSetLinkPrimitiveParamsFast"], + ["paren.lparen","("], + ["constant.language","LINK_THIS"], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","["], + ["constant.language","PRIM_POSITION"], + ["punctuation.operator",","], + ["text"," "], + ["identifier","point_zero"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["keyword.operator","<"], + ["text"," "], + ["identifier","x"], + ["keyword.operator","*"], + ["identifier","Size_Point"], + ["punctuation.operator",","], + ["text"," "], + ["constant.numeric","0.0"], + ["punctuation.operator",","], + ["text"," "], + ["keyword.operator","-"], + ["identifier","z"], + ["keyword.operator","*"], + ["identifier","Size_Point"], + ["text"," "], + ["keyword.operator",">"], + ["text"," "], + ["paren.rparen","])"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["support.function","llParticleSystem"], + ["paren.lparen","("], + ["text"," "], + ["identifier","Particle_Parameters"], + ["text"," "], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["support.function","llSleep"], + ["paren.lparen","("], + ["constant.numeric","0.12"], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["support.function","llParticleSystem"], + ["paren.lparen","("], + ["text"," "], + ["paren.lparen","["], + ["paren.rparen","]"], + ["text"," "], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["paren.rparen","}"] +],[ + "start", + ["text"," "], + ["paren.rparen","}"], + ["text"," "], + ["keyword.control","while"], + ["paren.lparen","("], + ["text"," "], + ["keyword.operator","++"], + ["identifier","x"], + ["text"," "], + ["keyword.operator","<="], + ["text"," "], + ["constant.numeric","4"], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["paren.rparen","}"], + ["text"," "], + ["keyword.control","while"], + ["paren.lparen","("], + ["text"," "], + ["keyword.operator","++"], + ["identifier","z"], + ["text"," "], + ["keyword.operator","<="], + ["text"," "], + ["constant.numeric","5"], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","point_zero"], + ["text"," "], + ["keyword.operator","+="], + ["text"," "], + ["keyword.operator","<"], + ["text"," "], + ["constant.numeric","6"], + ["punctuation.operator","."], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["identifier","Size_Point"], + ["punctuation.operator",","], + ["text"," "], + ["constant.numeric","0.0"], + ["punctuation.operator",","], + ["text"," "], + ["constant.numeric","0.0"], + ["text"," "], + ["keyword.operator",">"], + ["punctuation.operator",";"], + ["text"," "], + ["comment.line","//locate next char"] +],[ + "start", + ["text"," "], + ["paren.rparen","}"] +],[ + "start", + ["paren.rparen","}"] +],[ + "start", + ["comment.line","/////////////////////////////////////"] +],[ + "start", + ["comment.line","///////////////////////////////////// "] +],[ + "start", + ["comment.line","/////////////////////////////////////"] +],[ + "start", + ["comment.line","/////////////////////////////////////"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "] +],[ + "start", + ["keyword.other","default"], + ["text"," "], + ["paren.lparen","{"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.other","state_entry"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["support.function","llListen"], + ["paren.lparen","("], + ["constant.numeric","20"], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"\""], + ["punctuation.operator",","], + ["text"," "], + ["support.function","llGetOwner"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["punctuation.operator",","], + ["text"," "], + ["string.double","\"\""], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["identifier","init_particles"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["punctuation.operator",";"], + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","Origine"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["keyword.operator","<"], + ["text"," "], + ["paren.lparen","("], + ["constant.numeric","-0.48"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["identifier","Size_Affich"], + ["punctuation.operator","."], + ["identifier","x"], + ["paren.rparen",")"], + ["text"," "], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","("], + ["constant.numeric","-1.25"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["identifier","Size_Point"], + ["paren.rparen",")"], + ["text"," "], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","("], + ["constant.numeric","0.3"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["identifier","Size_Affich"], + ["punctuation.operator","."], + ["identifier","z"], + ["paren.rparen",")"], + ["text"," "], + ["keyword.operator",">"], + ["punctuation.operator",";"], + ["text"," "], + ["comment.line","//raz cursor"] +],[ + "start", + ["text"," "], + ["paren.rparen","}"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.other","listen"], + ["paren.lparen","("], + ["text"," "], + ["storage.type","integer"], + ["text"," "], + ["identifier","channel"], + ["punctuation.operator",","], + ["text"," "], + ["storage.type","string"], + ["text"," "], + ["identifier","name"], + ["punctuation.operator",","], + ["text"," "], + ["storage.type","key"], + ["text"," "], + ["identifier","id"], + ["punctuation.operator",","], + ["text"," "], + ["storage.type","string"], + ["text"," "], + ["identifier","msg"], + ["text"," "], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","Texte"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["identifier","msg"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["identifier","point_zero"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["identifier","Origine"], + ["punctuation.operator",";"], + ["text"," "], + ["comment.line","//raz cursor "] +],[ + "start", + ["text"," "], + ["support.function","llSetTimerEvent"], + ["paren.lparen","("], + ["constant.numeric","30"], + ["punctuation.operator","."], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["identifier","affichage"], + ["paren.lparen","("], + ["identifier","Texte"], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["paren.rparen","}"], + ["text"," "] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.other","timer"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["paren.lparen","{"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["identifier","point_zero"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["identifier","Origine"], + ["punctuation.operator",";"], + ["text"," "], + ["comment.line","//raz cursor"] +],[ + "start", + ["text"," "], + ["identifier","affichage"], + ["paren.lparen","("], + ["identifier","Texte"], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["text"," "], + ["paren.rparen","}"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.other","on_rez"], + ["paren.lparen","("], + ["storage.type","integer"], + ["text"," "], + ["identifier","param"], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"], + ["support.function","llResetScript"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["punctuation.operator",";"], + ["paren.rparen","}"] +],[ + "start", + ["text"," "], + ["keyword.other","changed"], + ["paren.lparen","("], + ["storage.type","integer"], + ["text"," "], + ["identifier","mask"], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"], + ["keyword.control","if"], + ["paren.lparen","("], + ["identifier","mask"], + ["text"," "], + ["keyword.operator","&"], + ["text"," "], + ["constant.language","CHANGED_OWNER"], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"], + ["support.function","llResetScript"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["punctuation.operator",";"], + ["paren.rparen","}}"], + ["text"," "] +],[ + "start", + ["text"," "] +],[ + "start", + ["paren.rparen","}"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_pascal.json b/lib/ace/mode/_test/tokens_pascal.json new file mode 100644 index 00000000..0797ca0b --- /dev/null +++ b/lib/ace/mode/_test/tokens_pascal.json @@ -0,0 +1,297 @@ +[[ + "punctuation.definition.comment.pascal2", + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one","****************************************************************************"] +],[ + "punctuation.definition.comment.pascal2", + ["comment.block.pascal.one"," * A simple bubble sort program. Reads integers, one per line, and prints *"] +],[ + "punctuation.definition.comment.pascal2", + ["comment.block.pascal.one"," * them out in sorted order. Blows up if there are more than 49. *"] +],[ + "start", + ["comment.block.pascal.one"," ****************************************************************************"], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["keyword.control.pascal","PROGRAM"], + ["text"," Sort(input"], + ["keyword.operator",","], + ["text"," output)"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","CONST"] +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one"," Max array size. "], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["text"," MaxElts "], + ["keyword.operator","="], + ["text"," "], + ["constant.numeric.pascal","50"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","TYPE"], + ["text"," "] +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one"," Type of the element array. "], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["text"," IntArrType "], + ["keyword.operator","="], + ["text"," "], + ["keyword.control.pascal","ARRAY"], + ["text"," ["], + ["constant.numeric.pascal","1"], + ["text","..MaxElts] "], + ["keyword.control.pascal","OF"], + ["text"," Integer"], + ["keyword.operator",";"] +],[ + "start" +],[ + "start", + ["text"," "], + ["keyword.control.pascal","VAR"] +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one"," Indexes, exchange temp, array size. "], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["text"," i"], + ["keyword.operator",","], + ["text"," j"], + ["keyword.operator",","], + ["text"," tmp"], + ["keyword.operator",","], + ["text"," size: integer"], + ["keyword.operator",";"] +],[ + "start" +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one"," Array of ints "], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["text"," arr: IntArrType"], + ["keyword.operator",";"] +],[ + "start" +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one"," Read in the integers. "], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["text"," "], + ["variable.pascal","PROCEDURE"], + ["text"," "], + ["storage.type.function.pascal","ReadArr"], + ["text","("], + ["keyword.control.pascal","VAR"], + ["text"," size: Integer"], + ["keyword.operator",";"], + ["text"," "], + ["keyword.control.pascal","VAR"], + ["text"," a: IntArrType)"], + ["keyword.operator",";"], + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","BEGIN"] +],[ + "start", + ["text"," size "], + ["keyword.operator",":="], + ["text"," "], + ["constant.numeric.pascal","1"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","WHILE"], + ["text"," "], + ["keyword.control.pascal","NOT"], + ["text"," eof "], + ["keyword.control.pascal","DO"], + ["text"," "], + ["keyword.control.pascal","BEGIN"] +],[ + "start", + ["text"," readln(a[size])"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","IF"], + ["text"," "], + ["keyword.control.pascal","NOT"], + ["text"," eof "], + ["keyword.control.pascal","THEN"], + ["text"," "] +],[ + "start", + ["text"," size "], + ["keyword.operator",":="], + ["text"," size "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric.pascal","1"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","END"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","END"], + ["keyword.operator",";"] +],[ + "start" +],[ + "start", + ["text"," "], + ["keyword.control.pascal","BEGIN"] +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one"," Read "], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["text"," ReadArr(size"], + ["keyword.operator",","], + ["text"," arr)"], + ["keyword.operator",";"] +],[ + "start" +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one"," Sort using bubble sort. "], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","FOR"], + ["text"," i "], + ["keyword.operator",":="], + ["text"," size "], + ["keyword.operator","-"], + ["text"," "], + ["constant.numeric.pascal","1"], + ["text"," DOWNTO "], + ["constant.numeric.pascal","1"], + ["text"," "], + ["keyword.control.pascal","DO"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","FOR"], + ["text"," j "], + ["keyword.operator",":="], + ["text"," "], + ["constant.numeric.pascal","1"], + ["text"," "], + ["keyword.control.pascal","TO"], + ["text"," i "], + ["keyword.control.pascal","DO"], + ["text"," "] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","IF"], + ["text"," arr[j] > arr[j "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric.pascal","1"], + ["text","] "], + ["keyword.control.pascal","THEN"], + ["text"," "], + ["keyword.control.pascal","BEGIN"] +],[ + "start", + ["text"," tmp "], + ["keyword.operator",":="], + ["text"," arr[j]"], + ["keyword.operator",";"] +],[ + "start", + ["text"," arr[j] "], + ["keyword.operator",":="], + ["text"," arr[j "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric.pascal","1"], + ["text","]"], + ["keyword.operator",";"] +],[ + "start", + ["text"," arr[j "], + ["keyword.operator","+"], + ["text"," "], + ["constant.numeric.pascal","1"], + ["text","] "], + ["keyword.operator",":="], + ["text"," tmp"], + ["keyword.operator",";"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","END"], + ["keyword.operator",";"] +],[ + "start" +],[ + "start", + ["text"," "], + ["punctuation.definition.comment.pascal","(*"], + ["comment.block.pascal.one"," Print. "], + ["punctuation.definition.comment.pascal","*)"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","FOR"], + ["text"," i "], + ["keyword.operator",":="], + ["text"," "], + ["constant.numeric.pascal","1"], + ["text"," "], + ["keyword.control.pascal","TO"], + ["text"," size "], + ["keyword.control.pascal","DO"] +],[ + "start", + ["text"," writeln(arr[i])"] +],[ + "start", + ["text"," "], + ["keyword.control.pascal","END"], + ["text","."] +],[ + "start", + ["text"," "] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_sass.json b/lib/ace/mode/_test/tokens_sass.json new file mode 100644 index 00000000..c0b85682 --- /dev/null +++ b/lib/ace/mode/_test/tokens_sass.json @@ -0,0 +1,229 @@ +[[ + "start", + ["comment","// sass ace mode;"] +],[ + "start" +],[ + "start", + ["keyword","@import"], + ["text"," "], + ["support.function","url("], + ["string","http://fonts.googleapis.com/css?family=Ace:700"], + ["support.function",")"] +],[ + "start" +],[ + "start", + ["variable.language","html"], + ["text",", "], + ["variable.language","body"] +],[ + "start", + ["support.type"," :background-color "], + ["constant.numeric","#ace"] +],[ + "start", + ["text"," "], + ["support.type","text-align"], + ["text",": "], + ["constant.language","center"] +],[ + "start", + ["text"," "], + ["support.type","height"], + ["text",": "], + ["constant.numeric","100%"] +],[ + ["comment",-1,2,"start"], + ["comment"," /*;*********;"] +],[ + ["comment",3,2,"start"], + ["comment"," ;comment ;"] +],[ + ["comment",3,2,"start"], + ["comment"," ;*********;"] +],[ + "start" +],[ + "start", + ["variable.language",".toggle"] +],[ + "start", + ["text"," "], + ["variable","$size"], + ["text",": "], + ["constant.numeric","14px"] +],[ + "start" +],[ + "start", + ["support.type"," :background "], + ["support.function","url("], + ["string","http://subtlepatterns.com/patterns/dark_stripes.png"], + ["support.function",")"] +],[ + "start", + ["text"," "], + ["support.type","border-radius"], + ["text",": "], + ["constant.numeric","8px"] +],[ + "start", + ["text"," "], + ["support.type","height"], + ["text",": "], + ["variable","$size"] +],[ + "start" +],[ + "start", + ["text"," &"], + ["variable.language",":before"] +],[ + "start", + ["text"," "], + ["variable","$radius"], + ["text",": "], + ["variable","$size"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["constant.numeric","0.845"] +],[ + "start", + ["text"," "], + ["variable","$glow"], + ["text",": "], + ["variable","$size"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["constant.numeric","0.125"] +],[ + "start" +],[ + "start", + ["text"," "], + ["support.type","box-shadow"], + ["text",": "], + ["constant.numeric","0"], + ["text"," "], + ["constant.numeric","0"], + ["text"," "], + ["variable","$glow"], + ["text"," "], + ["variable","$glow"], + ["text"," / "], + ["constant.numeric","2"], + ["text"," "], + ["constant.numeric","#fff"] +],[ + "start", + ["text"," "], + ["support.type","border-radius"], + ["text",": "], + ["variable","$radius"] +],[ + "start", + ["text"," "] +],[ + "start", + ["text"," &"], + ["variable.language",":active"] +],[ + "start", + ["text"," ~ "], + ["variable.language",".button"] +],[ + "start", + ["text"," "], + ["support.type","box-shadow"], + ["text",": "], + ["constant.numeric","0"], + ["text"," "], + ["constant.numeric","15px"], + ["text"," "], + ["constant.numeric","25px"], + ["text"," "], + ["constant.numeric","-4px"], + ["text"," "], + ["support.function","rgba"], + ["paren.lparen","("], + ["constant.numeric","0"], + ["text",","], + ["constant.numeric","0"], + ["text",","], + ["constant.numeric","0"], + ["text",","], + ["constant.numeric","0.4"], + ["paren.rparen",")"], + ["text"," "] +],[ + "start", + ["text"," ~ "], + ["variable.language",".label"] +],[ + "start", + ["text"," "], + ["support.type","font-size"], + ["text",": "], + ["constant.numeric","40px"] +],[ + "start", + ["text"," "], + ["support.type","color"], + ["text",": "], + ["support.function","rgba"], + ["paren.lparen","("], + ["constant.numeric","0"], + ["text",","], + ["constant.numeric","0"], + ["text",","], + ["constant.numeric","0"], + ["text",","], + ["constant.numeric","0.45"], + ["paren.rparen",")"] +],[ + "start" +],[ + "start", + ["text"," &"], + ["variable.language",":checked"], + ["text"," "] +],[ + "start", + ["text"," ~ "], + ["variable.language",".button"] +],[ + "start", + ["text"," "], + ["support.type","box-shadow"], + ["text",": "], + ["constant.numeric","0"], + ["text"," "], + ["constant.numeric","15px"], + ["text"," "], + ["constant.numeric","25px"], + ["text"," "], + ["constant.numeric","-4px"], + ["text"," "], + ["constant.numeric","#ace"] +],[ + "start", + ["text"," ~ "], + ["variable.language",".label"] +],[ + "start", + ["text"," "], + ["support.type","font-size"], + ["text",": "], + ["constant.numeric","40px"] +],[ + "start", + ["text"," "], + ["support.type","color"], + ["text",": "], + ["constant.numeric","#c9c9c9"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_tmsnippet.json b/lib/ace/mode/_test/tokens_tmsnippet.json new file mode 100644 index 00000000..17eaeb47 --- /dev/null +++ b/lib/ace/mode/_test/tokens_tmsnippet.json @@ -0,0 +1,132 @@ +[[ + "start", + ["doc,comment","$$------------------------------------"] +],[ + "start" +],[ + "start", + ["text","tabTrigger: t"] +],[ + "start" +],[ + "start", + ["text","name: Heading 3"] +],[ + "start" +],[ + "start", + ["text","scope: language"] +],[ + "start" +],[ + "start", + ["text","content: -----------------------------"] +],[ + "start" +],[ + "start", + ["text","\\begin{"], + ["markup.list","${"], + ["constant.numeric","1"], + ["punctuation.operator",":"], + ["text","documnet"], + ["markup.list","}"], + ["text","}"] +],[ + "start" +],[ + "start", + ["text"," "], + ["markup.list","${"], + ["constant.numeric","2"], + ["punctuation.operator",":"], + ["keyword","$TM_SELECTED_TEXT"], + ["text",":some latex"], + ["markup.list","}"] +],[ + "start" +],[ + "start", + ["text"," "], + ["markup.list","${"], + ["constant.numeric","3"], + ["punctuation.operator",":"], + ["keyword","$TM_SELECTED_TEXT"], + ["text","/a/b/c"], + ["markup.list","}"] +],[ + "start" +],[ + "start", + ["text"," "], + ["markup.list","${"], + ["constant.numeric","4"], + ["punctuation.operator",":"], + ["markup.list","${"], + ["keyword","TM_SELECTED_TEXT"], + ["string.regex","/(.)/"], + ["string","\\"], + ["keyword","\\u"], + ["variable","$1"], + ["string.regex","/g:"], + ["text","7"], + ["markup.list","}}"] +],[ + "start" +],[ + "start", + ["text","\\end{"], + ["variable","$1"], + ["text","}"] +],[ + "start" +],[ + "start", + ["variable","$0"], + ["constant.language.escape","\\\\"], + ["text","$$"] +],[ + "start" +],[ + "start", + ["doc,comment","$$------------------------------------"] +],[ + "start" +],[ + "start", + ["text","tabTrigger: ^3"] +],[ + "start" +],[ + "start", + ["text","name: Heading 3"] +],[ + "start" +],[ + "start", + ["text","scope: language"] +],[ + "start" +],[ + "start", + ["text","content: -----------------------------"] +],[ + "start" +],[ + "start" +],[ + "start" +],[ + "start", + ["markup.list","${"], + ["keyword","TM_CURRENT_LINE"], + ["string.regex","/./"], + ["string","^"], + ["string.regex","/g"], + ["markup.list","}"] +],[ + "start" +],[ + "start", + ["doc,comment","$$------------------------------------"] +]] \ No newline at end of file diff --git a/lib/ace/mode/jade_highlight_rules.js b/lib/ace/mode/jade_highlight_rules.js index ea7e7dbd..95650bb1 100644 --- a/lib/ace/mode/jade_highlight_rules.js +++ b/lib/ace/mode/jade_highlight_rules.js @@ -85,10 +85,11 @@ var JadeHighlightRules = function() { regex : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)" }, { - token : function(space, text) { - return "punctuation.section.comment"; + onMatch: function(value, currentState, stack) { + stack.unshift(this.next, value.length - 2, currentState); + return "comment"; }, - regex : "^((\\s*)\/\/)(?:\\s*$)", + regex: /^\s*\/\//, next: "comment_block" }, mixin_embed("markdown", "markdown-"), @@ -155,18 +156,18 @@ var JadeHighlightRules = function() { } ], "comment_block": [ - { - token: function(text) { + {regex: /^\s*/, onMatch: function(value, currentState, stack) { + if (value.length <= stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack.shift(); return "text"; - }, - regex: "^(\\1\\S|$)", - "captures": "1", - next: "start" - }, - { - token: "comment.block.jade", - regex : ".+" - } + } else { + this.next = ""; + return "comment"; + } + }, next: "start"}, + {defaultToken: "comment"} ], /* diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index 277f9744..77426ab3 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -246,11 +246,11 @@ var JavaScriptHighlightRules = function() { }, { // invalid operators token : "invalid", - regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ }, { // operators token : "constant.language.escape", - regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/ + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/ }, { token : "constant.language.delimiter", regex: /\|/ diff --git a/lib/ace/mode/lua_highlight_rules.js b/lib/ace/mode/lua_highlight_rules.js index 4a762ab4..e9768d6a 100644 --- a/lib/ace/mode/lua_highlight_rules.js +++ b/lib/ace/mode/lua_highlight_rules.js @@ -98,14 +98,14 @@ var LuaHighlightRules = function() { this.$rules = { "start" : [{ stateName: "bracketedComment", - token : function(value, currentState, stack){ + onMatch : function(value, currentState, stack){ stack.unshift(this.next, value.length, currentState); return "comment"; }, regex : /\-\-\[=*\[/, next : [ { - token : function(value, currentState, stack) { + onMatch : function(value, currentState, stack) { if (value.length == stack[1]) { stack.shift(); stack.shift(); @@ -129,14 +129,14 @@ var LuaHighlightRules = function() { }, { stateName: "bracketedString", - token : function(value, currentState, stack){ + onMatch : function(value, currentState, stack){ stack.unshift(this.next, value.length, currentState); return "comment"; }, regex : /\[=*\[/, next : [ { - token : function(value, currentState, stack) { + onMatch : function(value, currentState, stack) { if (value.length == stack[1]) { stack.shift(); stack.shift(); diff --git a/lib/ace/mode/php_highlight_rules.js b/lib/ace/mode/php_highlight_rules.js index 7b1dce7a..3be84f56 100644 --- a/lib/ace/mode/php_highlight_rules.js +++ b/lib/ace/mode/php_highlight_rules.js @@ -971,7 +971,7 @@ var PhpLangHighlightRules = function() { // TODO: Unicode identifiers regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - token : function(value, currentSate, state) { + onMatch : function(value, currentSate, state) { value = value.substr(3); if (value[0] == "'" || value[0] == '"') value = value.slice(1, -1); @@ -996,7 +996,7 @@ var PhpLangHighlightRules = function() { ], "heredoc" : [ { - token : function(value, currentSate, stack) { + onMatch : function(value, currentSate, stack) { if (stack[1] + ";" != value) return "string"; stack.shift(); diff --git a/lib/ace/mode/r_highlight_rules.js b/lib/ace/mode/r_highlight_rules.js index 106eeadf..99a74376 100644 --- a/lib/ace/mode/r_highlight_rules.js +++ b/lib/ace/mode/r_highlight_rules.js @@ -91,8 +91,7 @@ define(function(require, exports, module) regex : "`.*?`" }, { - token : function(value) - { + onMatch : function(value) { if (keywords[value]) return "keyword"; else if (buildinConstants[value]) diff --git a/lib/ace/mode/ruby_highlight_rules.js b/lib/ace/mode/ruby_highlight_rules.js index 2fd64a85..99841aaf 100644 --- a/lib/ace/mode/ruby_highlight_rules.js +++ b/lib/ace/mode/ruby_highlight_rules.js @@ -173,7 +173,7 @@ var RubyHighlightRules = function() { regex : "=>" }, { stateName: "heredoc", - token : function(value, currentState, stack) { + onMatch : function(value, currentState, stack) { var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; var tokens = value.split(this.splitRegex); stack.push(next, tokens[3]); @@ -187,7 +187,7 @@ var RubyHighlightRules = function() { regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", rules: { heredoc: [{ - token: function(value, currentState, stack) { + onMatch: function(value, currentState, stack) { if (value == stack[1]) { stack.shift(); stack.shift(); @@ -202,7 +202,7 @@ var RubyHighlightRules = function() { token: "string", regex: "^ +" }, { - token: function(value, currentState, stack) { + onMatch: function(value, currentState, stack) { if (value == stack[1]) { stack.shift(); stack.shift(); diff --git a/lib/ace/mode/sass_highlight_rules.js b/lib/ace/mode/sass_highlight_rules.js index c98f07f2..09f30262 100644 --- a/lib/ace/mode/sass_highlight_rules.js +++ b/lib/ace/mode/sass_highlight_rules.js @@ -40,8 +40,8 @@ var SassHighlightRules = function() { var start = this.$rules.start; if (start[1].token == "comment") { start.splice(1, 1, { - token: function(value, currentState, stack) { - stack.unshift(this.next, value.length - 2, currentState); + onMatch: function(value, currentState, stack) { + stack.unshift(this.next, -1, value.length - 2, currentState); return "comment"; }, regex: /^\s*\/\*/, @@ -55,14 +55,14 @@ var SassHighlightRules = function() { }); this.$rules.comment = [ - {regex: /^\s*/, token: function(value, currentState, stack) { - if (value.length < stack[1]) { - stack.shift(); - stack.shift(); + {regex: /^\s*/, onMatch: function(value, currentState, stack) { + if (stack[1] === -1) + stack[1] = Math.max(stack[2], value.length - 1); + if (value.length <= stack[1]) { + /*shift3x*/stack.shift();stack.shift();stack.shift(); this.next = stack.shift(); return "text"; } else { - stack[1] = value.length; this.next = ""; return "comment"; } diff --git a/lib/ace/mode/tmsnippet.js b/lib/ace/mode/tmsnippet.js index 68638e56..8f777719 100644 --- a/lib/ace/mode/tmsnippet.js +++ b/lib/ace/mode/tmsnippet.js @@ -16,14 +16,14 @@ var SnippetHighlightRules = function() { {token:"constant.language.escape", regex: /\\[\$}`\\]/}, {token:"keyword", regex: "\\$(?:TM_)?(?:" + builtins + ")\\b"}, {token:"variable", regex: "\\$\\w+"}, - {token: function(value, state, stack) { + {onMatch: function(value, state, stack) { if (stack[1]) stack[1]++; else stack.unshift("start", 1); return this.tokenName; }, tokenName: "markup.list", regex: "\\${", next: "varDecl"}, - {token: function(value, state, stack) { + {onMatch: function(value, state, stack) { if (!stack[1]) return "text"; stack[1]--; diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 6ed271b1..602b521e 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -79,10 +79,15 @@ var Tokenizer = function(rules) { rule.token = rule.token[0]; } else { rule.tokenArray = rule.token; - rule.token = this.$arrayTokens; + rule.onMatch = this.$arrayTokens; } + } else if (typeof rule.token == "function" && !rule.onMatch) { + if (matchcount > 1) + rule.onMatch = this.$applyToken; + else + rule.onMatch = rule.token; } - + if (matchcount > 1) { if (/\\\d/.test(rule.regex)) { // Replace any backreferences and offset appropriately. @@ -101,6 +106,11 @@ var Tokenizer = function(rules) { matchTotal += matchcount; ruleRegExps.push(adjustedregex); + + // makes property access faster + if (!rule.onMatch) + rule.onMatch = null; + rule.__proto__ = null; } this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); @@ -108,6 +118,25 @@ var Tokenizer = function(rules) { }; (function() { + this.$applyToken = function(str) { + var values = this.splitRegex.exec(str).slice(1); + var types = this.token.apply(this, values); + + // required for compatibility with old modes + if (typeof types === "string") + return [{type: types, value: str}]; + + var tokens = []; + for (var i = 0, l = types.length; i < l; i++) { + if (values[i]) + tokens[tokens.length] = { + type: types[i], + value: values[i] + }; + } + return tokens; + }, + this.$arrayTokens = function(str) { if (!str) return []; @@ -119,13 +148,12 @@ var Tokenizer = function(rules) { console.error(types , values, str, this.splitRegex, this); return [{type: "error.invalid", value: str}]; } - for (var i = 0; i < types.length; i++) { - if (values[i + 1]) { + for (var i = 0, l = types.length; i < l; i++) { + if (values[i + 1]) tokens[tokens.length] = { type: types[i], value: values[i + 1] }; - } } return tokens; }; @@ -188,10 +216,10 @@ var Tokenizer = function(rules) { rule = state[mapping[i]]; - // compute token type - type = typeof rule.token == "function" - ? rule.token(value, currentState, stack) - : rule.token; + if (rule.onMatch) + type = rule.onMatch(value, currentState, stack); + else + type = rule.token; if (rule.next) { if (typeof rule.next == "string")