<< Previous Suneido > Contents > Language > Reference > ScannerNext >> 
Builtin

Scanner

(string) => scanner

Returns a scanner object on the string that tokenizes the same way as the Suneido language compiler.

For example, to remove comments:

text_in = "hello /* there */ world"
text_out = ""
scan = Scanner(text_in)
for token in scan
    if (scan.Type() isnt SCAN.COMMENT) // comment
        text_out $= token
return text_out

=> "hello  world"

<< Previous Suneido > Contents > Language > Reference > ScannerNext >> 
Copyright (C) 2000-2007 Suneido Software Corp. All rights reserved worldwide.