nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pep8analysis: Fix no init call
[nit.git]
/
contrib
/
pep8analysis
/
src
/
parser
/
lexer.nit
diff --git
a/contrib/pep8analysis/src/parser/lexer.nit
b/contrib/pep8analysis/src/parser/lexer.nit
index
f1a3c44
..
f985cf7
100644
(file)
--- a/
contrib/pep8analysis/src/parser/lexer.nit
+++ b/
contrib/pep8analysis/src/parser/lexer.nit
@@
-1,19
+1,19
@@
# Lexer and its tokens.
# This file was generated by SableCC (http://www.sablecc.org/).
# Lexer and its tokens.
# This file was generated by SableCC (http://www.sablecc.org/).
-module lexer
+module lexer is generated, no_warning("missing-doc", "old-init")
intrude import parser_nodes
private import tables
redef class Token
intrude import parser_nodes
private import tables
redef class Token
- var _text: nullable String
+ var text_cache: nullable String
redef fun text
do
redef fun text
do
- var res = _text
+ var res = _text_cache
if res != null then return res
res = location.text
if res != null then return res
res = location.text
- _text = res
+ _text_cache = res
return res
end
return res
end
@@
-245,7
+245,7
@@
redef class EOF
init(loc: Location)
do
init(loc: Location)
do
- _text = ""
+ _text_cache = ""
_location = loc
end
end
_location = loc
end
end
@@
-255,7
+255,7
@@
redef class AError
init init_error(message: String, loc: Location)
do
init init_error(message: String, loc: Location)
do
- init(loc)
+ self.location = loc
self.message = message
end
end
self.message = message
end
end
@@
-266,25
+266,25
@@
end
class Lexer
super TablesCapable
# Last peeked token
class Lexer
super TablesCapable
# Last peeked token
- var _token: nullable Token
+ var token: nullable Token
# Lexer current state
# Lexer current state
- var _state: Int = 0
+ var state: Int = 0
# The source file
# The source file
- var _file: SourceFile
+ var file: SourceFile
# Current character in the stream
# Current character in the stream
- var _stream_pos: Int = 0
+ var stream_pos: Int = 0
# Current line number in the input stream
# Current line number in the input stream
- var _line: Int = 0
+ var line: Int = 0
# Current column in the input stream
# Current column in the input stream
- var _pos: Int = 0
+ var pos: Int = 0
# Was the last character a cariage-return?
# Was the last character a cariage-return?
- var _cr: Bool = false
+ var cr: Bool = false
# Constante state values
private fun state_initial: Int do return 0 end
# Constante state values
private fun state_initial: Int do return 0 end
@@
-337,7
+337,8
@@
class Lexer
if sp >= string_len then
dfa_state = -1
else
if sp >= string_len then
dfa_state = -1
else
- var c = string[sp].ascii
+ var c = string[sp].code_point
+ if c >= 255 then c = 255
sp += 1
var cr = _cr
sp += 1
var cr = _cr