From b292748d9f5fc2ac89a75df4b160a1451a767851 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Sun, 14 Jun 2020 20:09:11 -0700 Subject: preproc, srcfile: much saner handling of %line directives %line directives really need to be preprocessed early, before normal directive processing. In particular, they are *not* affected by such thing as smacro expansion, or deferred into an mmacro expansion. The %line directive is special because it is explicitly indented to be inserted by an external preprocessor, which can happen at any point. For mmacro and rep expansions, store the current file and line for each expansion line. Similarly, let each istk entry contain such information. Don't emit empty lines in preprocessing-only mode when we are already required to issue a %line directive anyway. This cuts down on clutter a fair bit. Quote filenames in %line directives (and accept quoted filenames in %line directives) if and only if it is necessary for disambiguation. This is required if: 1. The filename contains control characters; 2. The filename begins or ends with whitespace or a quotation mark; 3. The filename is empty. Otherwise issue the filename as-is, for backwards compatibility. Signed-off-by: H. Peter Anvin (Intel) --- travis/test/weirdpaste.i.t | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'travis') diff --git a/travis/test/weirdpaste.i.t b/travis/test/weirdpaste.i.t index ac7ddf08..1725bdf5 100644 --- a/travis/test/weirdpaste.i.t +++ b/travis/test/weirdpaste.i.t @@ -1,9 +1,4 @@ -%line 3+1 ./travis/test/weirdpaste.asm - - - -%line 10+1 ./travis/test/weirdpaste.asm - +%line 11+1 ./travis/test/weirdpaste.asm dw 25 %line 18+1 ./travis/test/weirdpaste.asm -- cgit v1.2.1