项目作者: julsam

项目描述 :
C# Templating Engine
高级语言: C#
项目地址: git://github.com/julsam/VineScript.git
创建时间: 2017-03-08T16:53:57Z
项目社区:https://github.com/julsam/VineScript

开源协议:MIT License

下载


VineScript is a language designed for interactive storytelling and dialogues in games.

This is still work in progress and in no way ready to be used!

Syntax example:

  1. /*
  2. This is a multiline comment
  3. */
  4. // this is a line comment
  5. This is a simple text.
  6. // Here's a variable definition:
  7. << set myvar to 42 >>
  8. // There's 4 different types and 2 data structures:
  9. << set myInt = 22 >>
  10. << set myNumber = 22.022 >>
  11. << set myBool = true >> // could also be false
  12. << set myString = "This is a string" >>
  13. << set myArray = [1, 2, 3.2, false, myString] >>
  14. << set myDictionnary = {
  15. "Vine": "Templating langague written in C#",
  16. "Libs used": "Antlr 4.5"
  17. } >>
  18. Let's do a condition:
  19. << if myvar > 0 >>
  20. Let's print it: {{ myvar }}
  21. << end >>
  22. // The type of a variable is dynamic and can be changed:
  23. << set myvar = "Hello, World!" >>
  24. Calling functions:
  25. << if IsInt(myvar) >>
  26. "{{ myvar }}" is an integer!
  27. << elif IsString(myvar) >>
  28. "{{ myvar }}" is a string!
  29. << else >>
  30. "{{ myvar }}" is something else!
  31. << end >>
  32. // All variables are global. When you're done with a variable, you can unset it:
  33. << unset myvar >>
  34. Loops:
  35. << set prev = 0, result = 0 >>
  36. << for i in [1, 2, 4] >>
  37. << set prev = result, result += i >>
  38. {{ prev }} + {{ i }} = {{ result }}
  39. << end >>