summaryrefslogtreecommitdiff
path: root/lexer.h
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-08-01 20:21:37 +1200
committerDavid Phillips <david@sighup.nz>2018-08-01 20:29:38 +1200
commit328e34077a2017d4017f907ac69c7ed5d6c160d4 (patch)
tree1795fd0d10293320dae0854b5b1d34a59e8fdbec /lexer.h
parent70c76b708308c72956e83163b2819be69f725a7e (diff)
downloadhence-328e34077a2017d4017f907ac69c7ed5d6c160d4.tar.xz
Trim leading whitespace from contextual error, detect EOF
Side-note that the token location tuple maintains the correct column number to include the whitespace in the source file. Side-side note: tabs are counted as one column but many editors will count them as whatever the tabstop/tabwidth is.
Diffstat (limited to 'lexer.h')
-rw-r--r--lexer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lexer.h b/lexer.h
index 2e27ffa..3ce15f4 100644
--- a/lexer.h
+++ b/lexer.h
@@ -19,6 +19,7 @@ enum TOKEN_TYPE {
struct location {
size_t line;
size_t column;
+ size_t leading_whitespace_len;
};
struct token {