Anonymous user
Compiler/lexical analyzer: Difference between revisions
m
→{{header|kotlin}}
Line 9,967:
getNextChar()
} // while
if (text.
error(line, pos, "Lexer: Unrecognized character: (%d) %c".
format(this.chr.code, this.chr))
Line 10,391:
// With no source specified, run the test of all symbols.
fun main(args: Array<String>) {
if (args.size > 1) { // file specified on command line▼
source +=
if
Lexer(source).printTokens()
▲ try {
▲ else
▲ ""
val digits = source.filter { it in '0'..'9' }
when {
Line 10,426 ⟶ 10,417:
Lexer(source).printTokens()
} // when
}
}
} //
} // main</lang>
{{out|case=test case 3}}
<b>
|