Skip to content

Commit

Permalink
Use let instead of var.
Browse files Browse the repository at this point in the history
  • Loading branch information
niw committed Jan 4, 2021
1 parent 2eacd31 commit 5918123
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions runtime/Swift/Sources/Antlr4/ANTLRFileStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ public class ANTLRFileStream: ANTLRInputStream {

public init(_ fileName: String, _ encoding: String.Encoding? = nil) throws {
self.fileName = fileName
super.init()
let fileContents = try String(contentsOfFile: fileName, encoding: encoding ?? .utf8)
data = fileContents.unicodeScalars
n = data.count
let unicodeScalars = fileContents.unicodeScalars
super.init(unicodeScalars, unicodeScalars.count)
}

override
Expand Down
2 changes: 1 addition & 1 deletion runtime/Swift/Sources/Antlr4/ANTLRInputStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ANTLRInputStream: CharStream {
///
/// The data being scanned
///
internal var data: String.UnicodeScalarView
internal let data: String.UnicodeScalarView

///
/// How many unicode scalars are actually in the buffer
Expand Down

0 comments on commit 5918123

Please sign in to comment.