Permalink
Browse files

Actually use the Regex to store the contract, report on error.

  • Loading branch information...
1 parent acf0a84 commit 178b7e4eed33bd2825d07600dd3c3ced63c37869 @colder committed Jun 14, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/insane/AST/CodeExtraction.scala
@@ -118,7 +118,13 @@ trait CodeExtraction extends Extractors with Contracts {
val regex = l.value.stringValue
- reporter.debug("Found regex: "+RegexParser.parseString(regex))
+
+ RegexParser.parseString(regex) match {
+ case Some(r) =>
+ fun.contrEffects +:= AssertUntouched(r)
+ case _ =>
+ reporter.error("Unable to parse regex: "+regex, Some(annot.pos));
+ }
case _ =>
}
case _ =>

0 comments on commit 178b7e4

Please sign in to comment.