<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/78928>78928</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] included sources are parsing separately 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          foxtran
      </td>
    </tr>
</table>

<pre>
    With the following code:
```fortran
      subroutine test(
#include "args.f"
      end
```
And `args.f`:
```fortran
 $arg)
      integer :: arg
```

flang-new gives the following message:
```
error: Could not scan test.f
./test.f:1:22: error: Unmatched '('
        subroutine test(
 ^
./args.f:1:6: warning: Statement should not begin with a continuation line
       $arg)
       ^
./test.f:2:1: warning: included here
 #include "args.f"
  ^^^^^^^^^^^^^^^^^
./args.f:1:10: error: Unmatched ')'
       $arg)
           ^
./test.f:2:1: error: included here
 #include "args.f"
  ^^^^^^^^^^^^^^^^^
  ```
  
  It happens because each source and include files are tokenizing separately, without full context. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8lE-PmzwQxj-NuYwWwRDicOCQd_NG6rmqejZ4ALeOHfnPZrefvjJks9ko3baXRlaMkZ95Zn4eLLxXoyFqWf0fq3eZiGGyrh3sc3DCZJ2VL-1XFSYIE8FgtbYnZUborSRWbVmxY8WWrYtlDNYl1fIW5p-PnbMxKEMQyAeGm7MGK2V6HSUBQxRu9PnAEK-lZORN_GW5NRLYujhr1sXv8mC4Em5k2FwHVybQSA6SuNpC2nDPa_kftDDjg6ETjOqJ_A2LA3kvxjs4liU5Z13yeLRRSzA2gO-FmXHkw7InZ7g_r6ttyaotYlJcpF_MQYR-IgkMeWKI_LqYX2MGVv__ZnFGtlisU-CTcEaZMT1-DiLQgUwAP10y7WhUBk6pAQT01gRlogjKGtDK0Lsc7mJ-738pEc85XPuf20HCRI4uR_dhl6TgfzvuwyiLj3g3t7zv1_oH9V4c_mW1ADctCfA6fwowieORjIeOehE9AYl-Am-j6wmEka-ZwqA0eRCOINjvZNSP1PuejsKJQPqF4ePcJzYGGKLWc7fQc8ghk20lm6oRGbUlL-pNU1ecZ1OLJXWbjouai2YlNryUJa6wLGpeN7xe95lqscBVUSIW1aqpeF4PJGk98JJjR7JYs1VBB6F0rvXTIbduzJT3kVq-aXCTadGR9vPNhjh_w4lmvctcm_Y_dHH0bFVo5YN_ixBU0PN1uCjq3dtZLVQWCEfh_HsCkEWn2ymEo093Ae4Z7kcVptjlvT0w3CeL8_RwdPYb9YHhfs7YM9zPSf8MAAD__6o3lZo">