def setOption(key:String, value:String) {switch key {case "TargetLanguage" {targetLanguage = value;}case "TokenType" {tokenTypeName = value;}case "TokenPrefix" {tokenNamePrefix = value;}case "StateType" {stateTypeName = value;}case "StartState" {startStateName = value;}else {// log unknown option}}}
In fact, it wouldn't be hard to extend this to any data type that is (a) hashable, and (b) representable as a constant literal. However, I'm not sure I want to go that far.
No comments:
Post a Comment