Skip to content

Commit 8263781

Browse files
authored
Merge pull request #333 from fortran-lang/refactor/modular-parser
Refactor parser for modularity
2 parents b06a833 + df9f621 commit 8263781

40 files changed

+2634
-2387
lines changed

fortls/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import json
24
import os
35
import pprint
@@ -8,7 +10,7 @@
810
from .interface import cli
911
from .jsonrpc import JSONRPC2Connection, ReadWriter, path_from_uri
1012
from .langserver import LangServer
11-
from .parse_fortran import FortranFile
13+
from .parsers.internal.parser import FortranFile
1214
from .version import __version__
1315

1416
__all__ = ["__version__"]

fortls/langserver.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@
4141
resolve_globs,
4242
set_keyword_ordering,
4343
)
44-
from fortls.intrinsics import (
44+
from fortls.json_templates import change_json, symbol_json, uri_json
45+
from fortls.jsonrpc import JSONRPC2Connection, path_from_uri, path_to_uri
46+
from fortls.parsers.internal.ast import FortranAST
47+
from fortls.parsers.internal.imports import Import
48+
from fortls.parsers.internal.intrinsics import (
4549
Intrinsic,
4650
get_intrinsic_keywords,
4751
load_intrinsics,
4852
set_lowercase_intrinsics,
4953
)
50-
from fortls.json_templates import change_json, symbol_json, uri_json
51-
from fortls.jsonrpc import JSONRPC2Connection, path_from_uri, path_to_uri
52-
from fortls.objects import (
53-
FortranAST,
54-
Import,
55-
Scope,
56-
Use,
57-
Variable,
54+
from fortls.parsers.internal.parser import FortranFile, get_line_context
55+
from fortls.parsers.internal.scope import Scope
56+
from fortls.parsers.internal.use import Use
57+
from fortls.parsers.internal.utilities import (
5858
climb_type_tree,
5959
find_in_scope,
6060
find_in_workspace,
6161
get_use_tree,
6262
)
63-
from fortls.parse_fortran import FortranFile, get_line_context
63+
from fortls.parsers.internal.variable import Variable
6464
from fortls.regex_patterns import create_src_file_exts_str
6565
from fortls.version import __version__
6666

0 commit comments

Comments
 (0)