Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dusk-lang
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Matta
dusk-lang
Commits
8685181a
Commit
8685181a
authored
6 years ago
by
Peter Matta
Browse files
Options
Downloads
Patches
Plain Diff
[dusk-format][Fix] Not printing colon after for iterator
parent
41b09e13
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/AST/ASTPrinter.cpp
+19
-32
19 additions, 32 deletions
lib/AST/ASTPrinter.cpp
with
19 additions
and
32 deletions
lib/AST/ASTPrinter.cpp
+
19
−
32
View file @
8685181a
...
...
@@ -78,22 +78,6 @@ public:
Printer
.
printNewline
();
}
// void visitLetDecl(LetDecl *D) {
// Printer.printDeclPre(D);
// Printer << D->getName();
//
// if (D->hasTypeRepr()) {
// Printer << ": ";
// super::visit(D->getTypeRepr());
// }
//
// if (D->hasValue()) {
// Printer << " " << tok::assign << " ";
// super::visit(D->getValue());
// }
// Printer.printDeclPost(D);
// }
void
visitVarDecl
(
VarDecl
*
D
)
{
Printer
.
printDeclPre
(
D
);
Printer
<<
D
->
getName
();
...
...
@@ -125,10 +109,12 @@ public:
}
void
visitParamDecl
(
ParamDecl
*
D
)
{
Printer
.
printDeclPost
(
D
);
Printer
<<
D
->
getName
()
<<
": "
;
if
(
D
->
hasTypeRepr
())
Printer
.
printDeclPre
(
D
);
Printer
<<
D
->
getName
();
if
(
D
->
hasTypeRepr
())
{
Printer
<<
": "
;
super
::
visit
(
D
->
getTypeRepr
());
}
Printer
.
printDeclPost
(
D
);
}
...
...
@@ -337,16 +323,22 @@ public:
virtual
void
printDeclPre
(
Decl
*
D
)
override
{
tok
KW
;
switch
(
D
->
getKind
())
{
// case DeclKind::Let:
// if (!isAtStartOfLine())
// printNewline();
// KW = tok::kw_let;
// break;
case
DeclKind
::
Var
:
case
DeclKind
::
Var
:
{
if
(
!
isAtStartOfLine
())
printNewline
();
KW
=
tok
::
kw_var
;
KW
=
D
->
getVarDecl
()
->
isLet
()
?
tok
::
kw_let
:
tok
::
kw_var
;
break
;
}
case
DeclKind
::
Param
:
{
if
(
D
->
getParamDecl
()
->
isInOut
())
KW
=
tok
::
kw_inout
;
else
return
;
break
;
}
case
DeclKind
::
Func
:
KW
=
tok
::
kw_func
;
break
;
...
...
@@ -357,13 +349,8 @@ public:
}
virtual
void
printDeclPost
(
Decl
*
D
)
override
{
switch
(
D
->
getKind
())
{
// case DeclKind::Let:
case
DeclKind
::
Var
:
if
(
D
->
isKind
(
DeclKind
::
Var
))
return
printText
(
";"
);
default:
return
;
}
}
virtual
void
printStmtPre
(
Stmt
*
S
)
override
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment