Advertisement
Guest User

Untitled

a guest
May 10th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 1.20 KB | None | 0 0
  1. import "nre"
  2.  
  3. type
  4.   LexingRuleActionKind = enum
  5.     intAction, floatAction, stringAction
  6.  
  7.   LexingRuleAction* = object
  8.     case kind*: LexingRuleActionKind
  9.     of intAction:
  10.       callback: proc(match: string, env: int): tuple[ttype: string, value: int])
  11.     of floatAction:
  12.       callback: proc(match: string, env: int): tuple[ttype: string, value: float])
  13.     of stringAction:
  14.       callback: proc(match: string, env: int): tuple[ttype: string, value: string])
  15.  
  16.   LexingRule* = ref object of RootObj
  17.     action*: LexingRuleAction
  18.     pattern*: Regex
  19.     flags*: seq[string]
  20.  
  21. #   Hint: system [Processing]
  22. #   Hint: test [Processing]
  23. #   Hint: nre [Processing]
  24. #   Hint: pcre [Processing]
  25. #   Hint: util [Processing]
  26. #   Hint: tables [Processing]
  27. #   Hint: hashes [Processing]
  28. #   Hint: strutils [Processing]
  29. #   Hint: parseutils [Processing]
  30. #   Hint: etcpriv [Processing]
  31. #   Hint: math [Processing]
  32. #   Hint: times [Processing]
  33. #   Hint: unsigned [Processing]
  34. #   lib/impure/nre.nim(13, 8) Warning: unsigned is deprecated [Deprecated]
  35. #   Hint: options [Processing]
  36. #   Hint: typetraits [Processing]
  37. #   Hint: unicode [Processing]
  38. #   test.nim(8, 5) Error: not all cases are covered
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement