nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pep8analysis: remove old-style accessors in the AST
[nit.git]
/
contrib
/
pep8analysis
/
src
/
parser
/
parser_prod.nit
diff --git
a/contrib/pep8analysis/src/parser/parser_prod.nit
b/contrib/pep8analysis/src/parser/parser_prod.nit
index
05bb5b2
..
8f71631
100644
(file)
--- a/
contrib/pep8analysis/src/parser/parser_prod.nit
+++ b/
contrib/pep8analysis/src/parser/parser_prod.nit
@@
-8,7
+8,9
@@
private import tables
redef class ANode
# Parent of the node in the AST
redef class ANode
# Parent of the node in the AST
- readable writable var _parent: nullable ANode
+ var _parent: nullable ANode
+ fun parent: nullable ANode do return _parent
+ fun parent=(p: nullable ANode) do _parent = p
# Remove a child from the AST
fun remove_child(child: ANode)
# Remove a child from the AST
fun remove_child(child: ANode)
@@
-57,14
+59,14
@@
abstract class Visitor
# This methos should not be redefined
fun enter_visit(e: nullable ANode)
do
# This methos should not be redefined
fun enter_visit(e: nullable ANode)
do
- var old = _current_node
- _current_node = e
+ var old = current_node
+ current_node = e
visit(e)
visit(e)
- _current_node = old
+ current_node = old
end
# The current visited node
end
# The current visited node
- readable var _current_node: nullable ANode = null
+ var current_node: nullable ANode = null
end
redef class AListing
end
redef class AListing