Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Lang "qb"
- Option Explicit
- Const shaderfile = "repak-c.shader"
- Dim brackets As Integer
- Dim inline As String
- Dim filehandle As Integer
- Dim Lnum As Long
- filehandle = Freefile
- Open shaderfile For Input As #filehandle
- Do Until Eof( filehandle )
- lnum = lnum + 1
- Line Input #filehandle, inline
- 'check if all brackets were closed before a new shader starts'
- If Left$( lcase$( inline ), 1 ) = "textures/" And brackets > 0 Then Goto abnormalexit
- 'check opening brackets'
- If Instr( 1, inline, "{" ) <> 0 And brackets <= 2 Then brackets = brackets + 1
- 'check closing brackets'
- If Instr (1, inline, "}" ) <> 0 And brackets > 0 Then brackets = brackets - 1
- 'check invalid bracket num'
- If brackets < 0 Or brackets > 2 Then Goto abnormalexit
- Loop
- Close #filehandle
- Print "all shaders parsed; no bracket mismatches found!"
- Sleep
- End
- abnormalexit:
- Close #filehandle
- Print "error in line "; lnum , inline
- Sleep
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement