nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
3cf6a30
)
syntax: warn on superfluous empty parentheses on calls
author
Jean Privat
<jean@pryen.org>
Fri, 24 Feb 2012 16:55:45 +0000
(11:55 -0500)
committer
Jean Privat
<jean@pryen.org>
Fri, 24 Feb 2012 16:55:45 +0000
(11:55 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>
src/syntax/typing.nit
patch
|
blob
|
history
diff --git
a/src/syntax/typing.nit
b/src/syntax/typing.nit
index
77f9779
..
4155ecc
100644
(file)
--- a/
src/syntax/typing.nit
+++ b/
src/syntax/typing.nit
@@
-403,6
+403,15
@@
redef class AParExpr
end
end
+redef class AParExprs
+ redef fun after_typing(v)
+ do
+ if n_exprs.is_empty then
+ v.warning(self, "Warning: superfluous parentheses.")
+ end
+ end
+end
+
redef class AVardeclExpr
var _variable: nullable VarVariable
redef fun variable do return _variable.as(not null)