easco / configparser_ex Goto Github PK
View Code? Open in Web Editor NEWA simple Elixir parser for the same kind of files that Python's configparser library handles
License: Other
A simple Elixir parser for the same kind of files that Python's configparser library handles
License: Other
C:\code\myproject>iex -S mix
...
lib/ConfigParser/ParseState.ex:23: warning: the variable "new_result" is unsafe as it has been defined in a conditional clause,
as part of a case/cond/receive/if/&&/||. Please rewrite the clauses so the value is explicitly returned. For example:
case int do
1 -> atom = :one
2 -> atom = :two
end
Can be rewritten as:
atom =
case int do
1 -> :one
2 -> :two
end
lib/ConfigParser/ParseState.ex:43: warning: the variable "new_values" is unsafe as it has been defined in a conditional clause,
as part of a case/cond/receive/if/&&/||. Please rewrite the clauses so the value is explicitly returned. For example:
case int do
1 -> atom = :one
2 -> atom = :two
end
Can be rewritten as:
atom =
case int do
1 -> :one
2 -> :two
end
==> configparser_ex
Compiled lib/ConfigParser/ParseState.ex
Compiled lib/configparser.ex
Generated configparser_ex app
...
Hi,
I noticed that multi-line strings are parsed into one long line here: https://github.com/easco/configparser_ex/blob/master/lib/ConfigParser/ParseState.ex#L70 It would be nice to have an option to return the parsed string with newlines rather than the lines joined with a space. Maybe a option to parse_string and parse_file like: parse_string("stuff here", continuation: :newline) or parse_string("stuff here", continuation: :space) where the default is the current behavior of space?
% mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
New:
configparser 4.0.0
All dependencies are up to date
% mix deps.compile
==> configparser
Compiling 2 files (.ex)
== Compilation error in file lib/ConfigParser/ParseState.ex ==
** (UndefinedFunctionError) function nil.new/0 is undefined. If you are using the dot syntax, such as map.field or module.function(), make sure the left side of the dot is an atom or a map
nil.new()
lib/ConfigParser/ParseState.ex:22: (module)
(stdlib 3.17) erl_eval.erl:685: :erl_eval.do_apply/6
could not compile dependency :configparser, "mix compile" failed. You can recompile this dependency with "mix deps.compile configparser", update it with "mix deps.update configparser" or clean it with "mix deps.clean configparser"
% elixir --version
Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.12.2 (compiled with Erlang/OTP 24)
(Same thing with Elixir 1.9.)
https://hexdocs.pm/configparser_ex/api-reference.html
nothing here from the @*doc sections?
As I was reading here:
https://github.com/easco/configparser_ex/blob/master/lib/configparser.ex#L84
I guess it's compatible with the Python method. ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.