class Hollicode::Scanner

Overview

Scanner class. Takes a string of code and produces an array of tokens.

Defined in:

core/scanner.cr

Constant Summary

ERROR_MESSAGE_BAD_UNINDENT = "unmatched indentation level"
ERROR_MESSAGE_MIXED_INDENTATION = "mixed tabs and spaces"
ERROR_MESSAGE_UNEXPECTED_CHARACTER = "unexpected character"
ERROR_MESSAGE_UNTERMINATED_EXPRESSION = "mismatched expression brackets"
ERROR_MESSAGE_UNTERMINATED_PARENTHESES = "mismatched parentheses"
ERROR_MESSAGE_UNTERMINATED_STRING = "unterminated string"
TAB_SIZE = 8

Instance Method Summary

Instance Method Detail

def scan(source : String) #

Scans a string of source, populating the #tokens array with scanned tokens.


[View source]
def tokens : Array(Hollicode::Token) #

[View source]