Skip to content

Commit

Permalink
Merge pull request #125 from shanielh/master
Browse files Browse the repository at this point in the history
Allow extending user defined traits by adding option 'trait' to messages
  • Loading branch information
SandroGrzicic committed Mar 8, 2016
2 parents 7928eb3 + a342e6b commit 984edef
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ class Generator protected (sourceName: String, importedSymbols: Map[String, Impo
}
out.append('\n').append(indent1).append("with net.sandrogrzicic.scalabuff.Parser[").append(name).append("]")

for (OptionValue(_, value) <- body.options.filter(_.key == "trait")) {
out.append('\n').append(indent1).append("with ").append(value.replace("$name", name).stripQuotes)
}

out.append(" {\n\n")

// setters
Expand Down

0 comments on commit 984edef

Please sign in to comment.