-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve printed output for C files to look more like actual C
- Loading branch information
Showing
9 changed files
with
121 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package vct.col.ast.unsorted | ||
|
||
//import vct.col.ast.CNoParam | ||
//import vct.col.ast.ops.{CNoParamOps, CNoParamFamilyOps} | ||
//import vct.col.print._ | ||
// | ||
//trait CNoParamImpl[G] extends CNoParamOps[G] with CNoParamFamilyOps[G] { this: CNoParam[G] => | ||
// // override def layout(implicit ctx: Ctx): Doc = ??? | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package vct.col.ast.unsorted | ||
|
||
import vct.col.ast.SimplifiedLoop | ||
import vct.col.ast.ops.SimplifiedLoopOps | ||
import vct.col.print._ | ||
|
||
trait SimplifiedLoopImpl[G] extends SimplifiedLoopOps[G] { | ||
this: SimplifiedLoop[G] => | ||
// override def layout(implicit ctx: Ctx): Doc = ??? | ||
} |
26 changes: 26 additions & 0 deletions
26
src/col/vct/col/ast/unsorted/SimplifiedProcedureInvocationImpl.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package vct.col.ast.unsorted | ||
|
||
import vct.col.ast.{SimplifiedProcedureInvocation, Type, Variable} | ||
import vct.col.ast.ops.SimplifiedProcedureInvocationOps | ||
import vct.col.print._ | ||
|
||
trait SimplifiedProcedureInvocationImpl[G] | ||
extends SimplifiedProcedureInvocationOps[G] { | ||
this: SimplifiedProcedureInvocation[G] => | ||
override def precedence: Int = Precedence.POSTFIX | ||
|
||
override def layout(implicit ctx: Ctx): Doc = | ||
Group( | ||
Group( | ||
Text(ctx.name(ref)) <> | ||
(if (typeArgs.nonEmpty) | ||
Text("<") <> Doc.args(typeArgs) <> ">" | ||
else | ||
Empty) <> "(" | ||
) <> Doc.args(args ++ outArgs) <> ")" <> | ||
DocUtil.givenYields(givenMap, yields) | ||
) | ||
|
||
override def typeEnv: Map[Variable[G], Type[G]] = | ||
ref.decl.typeArgs.zip(typeArgs).toMap | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters