|
2543 | 2543 | "derived-type-component-type-specification": { |
2544 | 2544 | "comment": "Introduced in the Fortran 1995 standard.", |
2545 | 2545 | "name": "meta.specification.derived-type.fortran", |
2546 | | - "begin": "(?ix)(?=\\b(?:character|class|complex|double\\s*precision|double\\s*complex|integer|logical|real|type)\\b(?![^'\";!\\n]*(?<!\\(\\s*|::\\s*)\\bfunction\\b))", |
| 2546 | + "begin": "(?ix)(?=\\b(?:character|class|complex|double\\s*precision|double\\s*complex|integer|logical|real|type)\\b(?![^:'\";!\\n]*\\bfunction\\b))", |
2547 | 2547 | "end": "(?=[;!\\n])", |
2548 | 2548 | "patterns": [ |
2549 | 2549 | { |
|
4010 | 4010 | "function-definition": { |
4011 | 4011 | "comment": "Function program unit. Introduced in the Fortran 1977 standard.", |
4012 | 4012 | "name": "meta.function.fortran", |
4013 | | - "comment2": "Escape :: ( , if they are before function. These are non-fixed width lookbehinds but they seem to work", |
4014 | | - "begin": "(?i)(?=([^'\";!\\n](?!\\bend))*(?:(?<!\\(\\s*|::\\s*|,\\s*))\\bfunction\\b)", |
| 4013 | + "begin": "(?i)(?=([^:'\";!\\n](?!\\bend)(?!\\bsubroutine\\b))*\\bfunction\\b)", |
4015 | 4014 | "end": "(?=[;!\\n])", |
4016 | 4015 | "patterns": [ |
4017 | 4016 | { |
|
4094 | 4093 | { |
4095 | 4094 | "comment": "Specification and execution block.", |
4096 | 4095 | "name": "meta.block.specification.function.fortran", |
4097 | | - "begin": "(?i)(?!(?:end\\s*[;!\\n]|end\\s*function\\b))", |
4098 | | - "end": "(?i)(?=(?:end\\s*[;!\\n]|end\\s*function\\b))", |
| 4096 | + "begin": "(?i)(?!\\b(?:end\\s*[;!\\n]|end\\s*function\\b))", |
| 4097 | + "end": "(?i)(?=\\b(?:end\\s*[;!\\n]|end\\s*function\\b))", |
4099 | 4098 | "patterns": [ |
4100 | 4099 | { |
4101 | 4100 | "comment": "Contains block.", |
|
4106 | 4105 | "name": "keyword.control.contains.fortran" |
4107 | 4106 | } |
4108 | 4107 | }, |
4109 | | - "end": "(?i)(?=\\s*(?:end\\s*[;!\\n]|end\\s*function\\b))", |
| 4108 | + "end": "(?i)(?=(?:end\\s*[;!\\n]|end\\s*function\\b))", |
4110 | 4109 | "patterns": [ |
4111 | 4110 | { |
4112 | 4111 | "include": "$base" |
|
4350 | 4349 | "subroutine-definition": { |
4351 | 4350 | "comment": "Subroutine program unit. Introduced in the Fortran 1977 standard.", |
4352 | 4351 | "name": "meta.subroutine.fortran", |
4353 | | - "begin": "(?i)(?=([^'\";!\\n](?!\\bend))*(?:(?<!::\\s*))\\bsubroutine\\b)", |
| 4352 | + "begin": "(?i)(?=([^:'\";!\\n](?!\\bend))*\\bsubroutine\\b)", |
4354 | 4353 | "end": "(?=[;!\\n])", |
4355 | 4354 | "patterns": [ |
4356 | 4355 | { |
|
4542 | 4541 | "type-specification-statements": { |
4543 | 4542 | "name": "meta.specification.type.fortran", |
4544 | 4543 | "comment": "Supported types for function and escape :: if function is used as a variable name (which is bad practice).", |
4545 | | - "begin": "(?ix)(?=\\b(?:character|class|complex|double\\s*precision|double\\s*complex|integer|logical|real|type|dimension)\\b(?![^'\";!\\n]*(?<!\\(\\s*|::\\s*)\\bfunction\\b))", |
| 4544 | + "begin": "(?ix)(?=\\b(?:character|class|complex|double\\s*precision|double\\s*complex|integer|logical|real|type|dimension)\\b(?![^'\";!\\n:]*\\bfunction\\b))", |
4546 | 4545 | "end": "(?=[\\);!\\n])", |
4547 | 4546 | "patterns": [ |
4548 | 4547 | { |
|
0 commit comments