Scanning: 1) rationalize end-of-input everywhere, 2) prevent infinite loop at end-of-input, 3) use positive chars.
Fixes issue #25. (char 255 aliased to -1 and missing tests for end of input). 1) All layers of input scanning now share a single EndOfInput value. This avoids translation of it across layers of encapsulation. 2) Some places looking for end of line were not stopping on EndOfInput. 3) Use of "char" for the input made char values > 127 be negative numbers. This allowed for aliasing of 255 to -1, etc. This is fixed by using unsigned char.
This commit is contained in:
@@ -3,7 +3,7 @@ ERROR: 0:144: '#elif' : #elif after #else
|
||||
ERROR: 0:152: '#else' : #else after #else
|
||||
ERROR: 0:161: '#elif' : #elif after #else
|
||||
ERROR: 0:169: '#else' : #else after #else
|
||||
ERROR: 0:177: 'macro expansion' : EOF in macro FUNC
|
||||
ERROR: 0:177: 'macro expansion' : End of input in macro FUNC
|
||||
ERROR: 0:178: '' : syntax error
|
||||
ERROR: 6 compilation errors. No code generated.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user