mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-10-31 07:04:04 +00:00 
			
		
		
		
	Add elm syntax regression test
This commit is contained in:
		
				
					committed by
					
						 David Peter
						David Peter
					
				
			
			
				
	
			
			
			
						parent
						
							0c3344d0c4
						
					
				
				
					commit
					66c7aca2f6
				
			
							
								
								
									
										137
									
								
								tests/syntax-tests/highlighted/Elm/test.elm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								tests/syntax-tests/highlighted/Elm/test.elm
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,137 @@ | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m elm install elm-explorations/linear-algebra[0m | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m elm install elm-explorations/webgl[0m | ||||
|  | ||||
|  | ||||
| [38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;248;248;242mBrowser[0m | ||||
| [38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;248;248;242mBrowser.Events[0m[38;2;248;248;242m [0m[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;248;248;242mE[0m | ||||
| [38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;248;248;242mHtml[0m[38;2;248;248;242m [0m[38;2;249;38;114mexposing[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;102;217;239mHtml[0m[38;2;248;248;242m)[0m | ||||
| [38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;248;248;242mHtml.Attributes[0m[38;2;248;248;242m [0m[38;2;249;38;114mexposing[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;166;226;46mwidth[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mheight[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mstyle[0m[38;2;248;248;242m)[0m | ||||
| [38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;248;248;242mMath.Matrix4[0m[38;2;248;248;242m [0m[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;248;248;242mMat4[0m[38;2;248;248;242m [0m[38;2;249;38;114mexposing[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;102;217;239mMat4[0m[38;2;248;248;242m)[0m | ||||
| [38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;248;248;242mMath.Vector3[0m[38;2;248;248;242m [0m[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;248;248;242mVec3[0m[38;2;248;248;242m [0m[38;2;249;38;114mexposing[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;102;217;239mVec3[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mvec3[0m[38;2;248;248;242m)[0m | ||||
| [38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;248;248;242mWebGL[0m | ||||
|  | ||||
|  | ||||
|  | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m MAIN[0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46mmain [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;190;132;255mBrowser[0m[38;2;249;38;114m.[0m[38;2;248;248;242melement[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m{[0m[38;2;248;248;242m init [0m[38;2;249;38;114m=[0m[38;2;248;248;242m init[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m,[0m[38;2;248;248;242m view [0m[38;2;249;38;114m=[0m[38;2;248;248;242m view[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m,[0m[38;2;248;248;242m update [0m[38;2;249;38;114m=[0m[38;2;248;248;242m update[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m,[0m[38;2;248;248;242m subscriptions [0m[38;2;249;38;114m=[0m[38;2;248;248;242m subscriptions[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m}[0m | ||||
|  | ||||
|  | ||||
|  | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m MODEL[0m | ||||
|  | ||||
|  | ||||
| [38;2;249;38;114mtype alias [0m[38;2;166;226;46mModel[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;190;132;255mFloat[0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46minit[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[38;2;102;217;239m()[0m[38;2;248;248;242m [0m[38;2;249;38;114m->[0m[38;2;248;248;242m ([0m[3;38;2;102;217;239mModel[0m[38;2;248;248;242m, [0m[3;38;2;102;217;239mCmd[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mMsg[0m[38;2;248;248;242m)[0m | ||||
| [38;2;166;226;46minit [0m[38;2;190;132;255m()[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;249;38;114m([0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;102;217;239m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mCmd[0m[38;2;249;38;114m.[0m[38;2;248;248;242mnone [0m[38;2;249;38;114m)[0m | ||||
|  | ||||
|  | ||||
|  | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m UPDATE[0m | ||||
|  | ||||
|  | ||||
| [38;2;249;38;114mtype [0m[38;2;166;226;46mMsg[0m | ||||
| [38;2;248;248;242m  [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mTimeDelta[0m[38;2;248;248;242m [0m[38;2;190;132;255mFloat[0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46mupdate[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mMsg[0m[38;2;248;248;242m [0m[38;2;249;38;114m->[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mModel[0m[38;2;248;248;242m [0m[38;2;249;38;114m->[0m[38;2;248;248;242m ([0m[3;38;2;102;217;239mModel[0m[38;2;248;248;242m, [0m[3;38;2;102;217;239mCmd[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mMsg[0m[38;2;248;248;242m)[0m | ||||
| [38;2;166;226;46mupdate [0m[38;2;248;248;242mmsg currentTime [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;249;38;114mcase [0m[38;2;248;248;242mmsg [0m[38;2;249;38;114mof[0m | ||||
| [38;2;248;248;242m    [0m[38;2;190;132;255mTimeDelta[0m[38;2;248;248;242m delta [0m[38;2;249;38;114m->[0m | ||||
| [38;2;248;248;242m      [0m[38;2;249;38;114m([0m[38;2;248;248;242m delta [0m[38;2;249;38;114m+[0m[38;2;248;248;242m currentTime[0m[38;2;102;217;239m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mCmd[0m[38;2;249;38;114m.[0m[38;2;248;248;242mnone [0m[38;2;249;38;114m)[0m | ||||
|  | ||||
|  | ||||
|  | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m SUBSCRIPTIONS[0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46msubscriptions[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mModel[0m[38;2;248;248;242m [0m[38;2;249;38;114m->[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mSub[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mMsg[0m | ||||
| [38;2;166;226;46msubscriptions [0m[38;2;248;248;242m_ [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;190;132;255mE[0m[38;2;249;38;114m.[0m[38;2;248;248;242monAnimationFrameDelta [0m[38;2;190;132;255mTimeDelta[0m | ||||
|  | ||||
|  | ||||
|  | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m VIEW[0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46mview[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mModel[0m[38;2;248;248;242m [0m[38;2;249;38;114m->[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mHtml[0m[38;2;248;248;242m [0m[38;2;255;255;255mmsg[0m | ||||
| [38;2;166;226;46mview [0m[38;2;248;248;242mt [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;190;132;255mWebGL[0m[38;2;249;38;114m.[0m[38;2;248;248;242mtoHtml[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m[[0m[38;2;248;248;242m width [0m[38;2;190;132;255m400[0m[38;2;102;217;239m,[0m[38;2;248;248;242m height [0m[38;2;190;132;255m400[0m[38;2;102;217;239m,[0m[38;2;248;248;242m style [0m[38;2;230;219;116m"[0m[38;2;230;219;116mdisplay[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mblock[0m[38;2;230;219;116m"[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m][0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m[[0m[38;2;248;248;242m [0m[38;2;190;132;255mWebGL[0m[38;2;249;38;114m.[0m[38;2;248;248;242mentity vertexShader fragmentShader mesh [0m[38;2;102;217;239m{[0m[38;2;248;248;242m perspective [0m[38;2;249;38;114m=[0m[38;2;248;248;242m perspective [0m[38;2;249;38;114m([0m[38;2;248;248;242mt [0m[38;2;249;38;114m/[0m[38;2;248;248;242m [0m[38;2;190;132;255m1000[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;102;217;239m}[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m][0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46mperspective[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mFloat[0m[38;2;248;248;242m [0m[38;2;249;38;114m->[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mMat4[0m | ||||
| [38;2;166;226;46mperspective [0m[38;2;248;248;242mt [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;190;132;255mMat4[0m[38;2;249;38;114m.[0m[38;2;248;248;242mmul[0m | ||||
| [38;2;248;248;242m    [0m[38;2;249;38;114m([0m[38;2;190;132;255mMat4[0m[38;2;249;38;114m.[0m[38;2;248;248;242mmakePerspective [0m[38;2;190;132;255m45[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m0.01[0m[38;2;248;248;242m [0m[38;2;190;132;255m100[0m[38;2;249;38;114m)[0m | ||||
| [38;2;248;248;242m    [0m[38;2;249;38;114m([0m[38;2;190;132;255mMat4[0m[38;2;249;38;114m.[0m[38;2;248;248;242mmakeLookAt [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;249;38;114m([0m[38;2;190;132;255m4[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[38;2;248;248;242m cos t[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;190;132;255m4[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[38;2;248;248;242m sin t[0m[38;2;249;38;114m)[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m)[0m[38;2;249;38;114m)[0m | ||||
|  | ||||
|  | ||||
|  | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m MESH[0m | ||||
|  | ||||
|  | ||||
| [38;2;249;38;114mtype alias [0m[38;2;166;226;46mVertex[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;102;217;239m{[0m[38;2;248;248;242m position [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[38;2;190;132;255mVec3[0m | ||||
| [38;2;248;248;242m  [0m[38;2;102;217;239m,[0m[38;2;248;248;242m color [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[38;2;190;132;255mVec3[0m | ||||
| [38;2;248;248;242m  [0m[38;2;102;217;239m}[0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46mmesh[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mWebGL[0m[38;2;248;248;242m.[0m[3;38;2;102;217;239mMesh[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mVertex[0m | ||||
| [38;2;166;226;46mmesh [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;190;132;255mWebGL[0m[38;2;249;38;114m.[0m[38;2;248;248;242mtriangles[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m[[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242m [0m[38;2;190;132;255mVertex[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m)[0m | ||||
| [38;2;248;248;242m      [0m[38;2;102;217;239m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mVertex[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m)[0m | ||||
| [38;2;248;248;242m      [0m[38;2;102;217;239m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mVertex[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mvec3 [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m | ||||
| [38;2;248;248;242m      [0m[38;2;249;38;114m)[0m | ||||
| [38;2;248;248;242m    [0m[38;2;102;217;239m][0m | ||||
|  | ||||
|  | ||||
|  | ||||
| [38;2;117;113;94m--[0m[38;2;117;113;94m SHADERS[0m | ||||
|  | ||||
|  | ||||
| [38;2;249;38;114mtype alias [0m[38;2;166;226;46mUniforms[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m  [0m[38;2;102;217;239m{[0m[38;2;248;248;242m perspective [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[38;2;190;132;255mMat4[0m | ||||
| [38;2;248;248;242m  [0m[38;2;102;217;239m}[0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46mvertexShader[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mWebGL[0m[38;2;248;248;242m.[0m[3;38;2;102;217;239mShader[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mVertex[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mUniforms[0m[38;2;248;248;242m { [0m[38;2;255;255;255mvcolor[0m[38;2;248;248;242m : [0m[3;38;2;102;217;239mVec3[0m[38;2;248;248;242m }[0m | ||||
| [38;2;166;226;46mvertexShader [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m    [0m[38;2;249;38;114m[[0m[38;2;102;217;239mglsl[0m[38;2;249;38;114m|[0m | ||||
| [38;2;166;226;46m        [0m[38;2;249;38;114mattribute[0m[38;2;166;226;46m [0m[3;38;2;102;217;239mvec3[0m[38;2;166;226;46m position[0m[38;2;166;226;46m;[0m | ||||
| [38;2;166;226;46m        [0m[38;2;249;38;114mattribute[0m[38;2;166;226;46m [0m[3;38;2;102;217;239mvec3[0m[38;2;166;226;46m color[0m[38;2;166;226;46m;[0m | ||||
| [38;2;166;226;46m        [0m[38;2;249;38;114muniform[0m[38;2;166;226;46m [0m[3;38;2;102;217;239mmat4[0m[38;2;166;226;46m perspective[0m[38;2;166;226;46m;[0m | ||||
| [38;2;166;226;46m        [0m[38;2;249;38;114mvarying[0m[38;2;166;226;46m [0m[3;38;2;102;217;239mvec3[0m[38;2;166;226;46m vcolor[0m[38;2;166;226;46m;[0m | ||||
|  | ||||
| [38;2;166;226;46m        [0m[3;38;2;102;217;239mvoid[0m[38;2;166;226;46m [0m[38;2;166;226;46mmain[0m[38;2;166;226;46m [0m[38;2;166;226;46m([0m[38;2;166;226;46m)[0m[38;2;166;226;46m [0m[38;2;166;226;46m{[0m | ||||
| [38;2;166;226;46m            [0m[38;2;255;255;255mgl_Position[0m[38;2;166;226;46m [0m[38;2;249;38;114m=[0m[38;2;166;226;46m perspective [0m[38;2;249;38;114m*[0m[38;2;166;226;46m [0m[3;38;2;102;217;239mvec4[0m[38;2;166;226;46m([0m[38;2;166;226;46mposition[0m[38;2;166;226;46m,[0m[38;2;166;226;46m [0m[38;2;190;132;255m1.0[0m[38;2;166;226;46m)[0m[38;2;166;226;46m;[0m | ||||
| [38;2;166;226;46m            vcolor [0m[38;2;249;38;114m=[0m[38;2;166;226;46m color[0m[38;2;166;226;46m;[0m | ||||
| [38;2;166;226;46m        [0m[38;2;166;226;46m}[0m | ||||
| [38;2;166;226;46m    [0m[38;2;249;38;114m|][0m | ||||
|  | ||||
|  | ||||
| [38;2;166;226;46mfragmentShader[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mWebGL[0m[38;2;248;248;242m.[0m[3;38;2;102;217;239mShader[0m[38;2;248;248;242m {} [0m[3;38;2;102;217;239mUniforms[0m[38;2;248;248;242m { [0m[38;2;255;255;255mvcolor[0m[38;2;248;248;242m : [0m[3;38;2;102;217;239mVec3[0m[38;2;248;248;242m }[0m | ||||
| [38;2;166;226;46mfragmentShader [0m[38;2;249;38;114m=[0m | ||||
| [38;2;248;248;242m    [0m[38;2;249;38;114m[[0m[38;2;102;217;239mglsl[0m[38;2;249;38;114m|[0m | ||||
| [38;2;166;226;46m        precision mediump [0m[3;38;2;102;217;239mfloat[0m[38;2;166;226;46m;[0m | ||||
| [38;2;166;226;46m        [0m[38;2;249;38;114mvarying[0m[38;2;166;226;46m [0m[3;38;2;102;217;239mvec3[0m[38;2;166;226;46m vcolor[0m[38;2;166;226;46m;[0m | ||||
|  | ||||
| [38;2;166;226;46m        [0m[3;38;2;102;217;239mvoid[0m[38;2;166;226;46m [0m[38;2;166;226;46mmain[0m[38;2;166;226;46m [0m[38;2;166;226;46m([0m[38;2;166;226;46m)[0m[38;2;166;226;46m [0m[38;2;166;226;46m{[0m | ||||
| [38;2;166;226;46m            [0m[38;2;255;255;255mgl_FragColor[0m[38;2;166;226;46m [0m[38;2;249;38;114m=[0m[38;2;166;226;46m [0m[3;38;2;102;217;239mvec4[0m[38;2;166;226;46m([0m[38;2;166;226;46mvcolor[0m[38;2;166;226;46m,[0m[38;2;166;226;46m [0m[38;2;190;132;255m1.0[0m[38;2;166;226;46m)[0m[38;2;166;226;46m;[0m | ||||
| [38;2;166;226;46m        [0m[38;2;166;226;46m}[0m | ||||
| [38;2;166;226;46m    [0m[38;2;249;38;114m|][0m | ||||
							
								
								
									
										32
									
								
								tests/syntax-tests/source/Elm/LICENSE.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								tests/syntax-tests/source/Elm/LICENSE.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| The `test.elm` file has been added from [https://elm-lang.org/examples/triangle] under the following license: | ||||
|  | ||||
| Copyright (c) 2012-present Evan Czaplicki | ||||
|  | ||||
| All rights reserved. | ||||
|  | ||||
| Redistribution and use in source and binary forms, with or without | ||||
| modification, are permitted provided that the following conditions are met: | ||||
|  | ||||
|     * Redistributions of source code must retain the above copyright | ||||
|       notice, this list of conditions and the following disclaimer. | ||||
|  | ||||
|     * Redistributions in binary form must reproduce the above | ||||
|       copyright notice, this list of conditions and the following | ||||
|       disclaimer in the documentation and/or other materials provided | ||||
|       with the distribution. | ||||
|  | ||||
|     * Neither the name of Evan Czaplicki nor the names of other | ||||
|       contributors may be used to endorse or promote products derived | ||||
|       from this software without specific prior written permission. | ||||
|  | ||||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
							
								
								
									
										137
									
								
								tests/syntax-tests/source/Elm/test.elm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								tests/syntax-tests/source/Elm/test.elm
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,137 @@ | ||||
| -- elm install elm-explorations/linear-algebra | ||||
| -- elm install elm-explorations/webgl | ||||
|  | ||||
|  | ||||
| import Browser | ||||
| import Browser.Events as E | ||||
| import Html exposing (Html) | ||||
| import Html.Attributes exposing (width, height, style) | ||||
| import Math.Matrix4 as Mat4 exposing (Mat4) | ||||
| import Math.Vector3 as Vec3 exposing (Vec3, vec3) | ||||
| import WebGL | ||||
|  | ||||
|  | ||||
|  | ||||
| -- MAIN | ||||
|  | ||||
|  | ||||
| main = | ||||
|   Browser.element | ||||
|     { init = init | ||||
|     , view = view | ||||
|     , update = update | ||||
|     , subscriptions = subscriptions | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
| -- MODEL | ||||
|  | ||||
|  | ||||
| type alias Model = | ||||
|   Float | ||||
|  | ||||
|  | ||||
| init : () -> (Model, Cmd Msg) | ||||
| init () = | ||||
|   ( 0, Cmd.none ) | ||||
|  | ||||
|  | ||||
|  | ||||
| -- UPDATE | ||||
|  | ||||
|  | ||||
| type Msg | ||||
|   = TimeDelta Float | ||||
|  | ||||
|  | ||||
| update : Msg -> Model -> (Model, Cmd Msg) | ||||
| update msg currentTime = | ||||
|   case msg of | ||||
|     TimeDelta delta -> | ||||
|       ( delta + currentTime, Cmd.none ) | ||||
|  | ||||
|  | ||||
|  | ||||
| -- SUBSCRIPTIONS | ||||
|  | ||||
|  | ||||
| subscriptions : Model -> Sub Msg | ||||
| subscriptions _ = | ||||
|   E.onAnimationFrameDelta TimeDelta | ||||
|  | ||||
|  | ||||
|  | ||||
| -- VIEW | ||||
|  | ||||
|  | ||||
| view : Model -> Html msg | ||||
| view t = | ||||
|   WebGL.toHtml | ||||
|     [ width 400, height 400, style "display" "block" | ||||
|     ] | ||||
|     [ WebGL.entity vertexShader fragmentShader mesh { perspective = perspective (t / 1000) } | ||||
|     ] | ||||
|  | ||||
|  | ||||
| perspective : Float -> Mat4 | ||||
| perspective t = | ||||
|   Mat4.mul | ||||
|     (Mat4.makePerspective 45 1 0.01 100) | ||||
|     (Mat4.makeLookAt (vec3 (4 * cos t) 0 (4 * sin t)) (vec3 0 0 0) (vec3 0 1 0)) | ||||
|  | ||||
|  | ||||
|  | ||||
| -- MESH | ||||
|  | ||||
|  | ||||
| type alias Vertex = | ||||
|   { position : Vec3 | ||||
|   , color : Vec3 | ||||
|   } | ||||
|  | ||||
|  | ||||
| mesh : WebGL.Mesh Vertex | ||||
| mesh = | ||||
|   WebGL.triangles | ||||
|     [ ( Vertex (vec3 0 0 0) (vec3 1 0 0) | ||||
|       , Vertex (vec3 1 1 0) (vec3 0 1 0) | ||||
|       , Vertex (vec3 1 -1 0) (vec3 0 0 1) | ||||
|       ) | ||||
|     ] | ||||
|  | ||||
|  | ||||
|  | ||||
| -- SHADERS | ||||
|  | ||||
|  | ||||
| type alias Uniforms = | ||||
|   { perspective : Mat4 | ||||
|   } | ||||
|  | ||||
|  | ||||
| vertexShader : WebGL.Shader Vertex Uniforms { vcolor : Vec3 } | ||||
| vertexShader = | ||||
|     [glsl| | ||||
|         attribute vec3 position; | ||||
|         attribute vec3 color; | ||||
|         uniform mat4 perspective; | ||||
|         varying vec3 vcolor; | ||||
|  | ||||
|         void main () { | ||||
|             gl_Position = perspective * vec4(position, 1.0); | ||||
|             vcolor = color; | ||||
|         } | ||||
|     |] | ||||
|  | ||||
|  | ||||
| fragmentShader : WebGL.Shader {} Uniforms { vcolor : Vec3 } | ||||
| fragmentShader = | ||||
|     [glsl| | ||||
|         precision mediump float; | ||||
|         varying vec3 vcolor; | ||||
|  | ||||
|         void main () { | ||||
|             gl_FragColor = vec4(vcolor, 1.0); | ||||
|         } | ||||
|     |] | ||||
		Reference in New Issue
	
	Block a user