Syntax.nsi 795 B

1234567891011121314151617181920212223242526272829303132333435
  1. !include MUI2.nsh
  2. Name `nsJSON plug-in`
  3. OutFile nsJSON_Syntax.exe
  4. RequestExecutionLevel user
  5. ShowInstDetails show
  6. !insertmacro MUI_PAGE_INSTFILES
  7. !insertmacro MUI_LANGUAGE English
  8. !macro DoTest JSON Description
  9. StrCpy $R0 ``
  10. ClearErrors
  11. nsJSON::Set /value `${JSON}`
  12. nsJSON::Serialize
  13. Pop $R0
  14. DetailPrint `${Description}:`
  15. DetailPrint `${JSON} -> $R0`
  16. IfErrors 0 +2
  17. DetailPrint `Error flag is set!`
  18. DetailPrint ``
  19. !macroend
  20. Section
  21. !insertmacro DoTest `{ "Input": [ { "test1": false, } ] }` `Trailing comma`
  22. !insertmacro DoTest `{ "Input": [ { "test1": false } .? ] }` `Junk characters`
  23. !insertmacro DoTest `{ "Input": [ { "test1": false } }` `Missing square bracket`
  24. !insertmacro DoTest `{ "Input": [ { "test1": false ] }` `Missing curly brace`
  25. SectionEnd