#209 feat: parse_code

Open Amin Yahyaabadi aminya

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 1 of 1 files from the diff.

@@ -7,7 +7,7 @@
Loading
7 7
import Tokenize.Tokens: RawToken, AbstractToken, iskeyword, isliteral, isoperator, untokenize
8 8
import Tokenize.Lexers: Lexer, peekchar, iswhitespace
9 9
10 -
export ParseState, parse_expression
10 +
export ParseState, parse_expression, parse_code
11 11
12 12
include("lexer.jl")
13 13
include("spec.jl")
@@ -274,6 +274,19 @@
Loading
274 274
    ps.t.endpos[1] + 1 <= ps.nt.startpos[1]
275 275
end
276 276
277 +
"""
278 +
    parse_code(str)
279 +
280 +
Parse a code given as string
281 +
"""
282 +
function parse_code(str)
283 +
    cst, ps = CSTParser.parse(ParseState(str), true)
284 +
    if CSTParser.has_error(ps)
285 +
        error("Julia code parsing failed")
286 +
    end
287 +
    return cst
288 +
end
289 +
277 290
include("precompile.jl")
278 291
_precompile()
279 292
end

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src -0.17% 85.83%
Project Totals (14 files) 85.83%
Loading