|
|
|
@ -493,6 +493,16 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format ("
@@ -493,6 +493,16 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format ("
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class LineProcessorDirective : PreProcessorDirective |
|
|
|
|
{ |
|
|
|
|
public int LineNumber { get; set; } |
|
|
|
|
public string FileName { get; set; } |
|
|
|
|
|
|
|
|
|
public LineProcessorDirective (int line, int col, int endLine, int endCol, Tokenizer.PreprocessorDirective cmd, string arg) : base (line, col, endLine, endCol, cmd, arg) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class PreProcessorDirective : SpecialBase |
|
|
|
|
{ |
|
|
|
|
public readonly int Line; |
|
|
|
@ -572,7 +582,17 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format ("
@@ -572,7 +582,17 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format ("
|
|
|
|
|
{ |
|
|
|
|
if (inComment) |
|
|
|
|
EndComment (startLine, startCol); |
|
|
|
|
Specials.Add (cmd == Tokenizer.PreprocessorDirective.Pragma ? new PragmaPreProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg) : new PreProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg)); |
|
|
|
|
switch (cmd) { |
|
|
|
|
case Tokenizer.PreprocessorDirective.Pragma: |
|
|
|
|
Specials.Add (new PragmaPreProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg)); |
|
|
|
|
break; |
|
|
|
|
case Tokenizer.PreprocessorDirective.Line: |
|
|
|
|
Specials.Add (new LineProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg)); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
Specials.Add (new PreProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg)); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Conditional ("FULL_AST")] |
|
|
|
@ -593,6 +613,11 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format ("
@@ -593,6 +613,11 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format ("
|
|
|
|
|
pragmaDirective.Codes.Add (code); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public LineProcessorDirective GetCurrentLineProcessorDirective() |
|
|
|
|
{ |
|
|
|
|
return Specials [Specials.Count - 1] as LineProcessorDirective; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public enum NewLine { Unix, Windows } |
|
|
|
|
|
|
|
|
|
[Conditional ("FULL_AST")] |
|
|
|
|