mirror of
https://github.com/RubyMetric/chsrc
synced 2025-08-16 18:09:32 +08:00
Move to sub lib
This commit is contained in:
parent
47129d36f7
commit
3eb948f1cf
@ -14,13 +14,13 @@
|
|||||||
# Raw strings for the C programming language
|
# Raw strings for the C programming language
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
||||||
use Parser;
|
use Rawstr4c::Parser;
|
||||||
use Generator;
|
use Rawstr4c::Generator;
|
||||||
use Version;
|
use Rawstr4c::Version;
|
||||||
|
|
||||||
sub USAGE() {
|
sub USAGE() {
|
||||||
print qq:to/END/;
|
print qq:to/END/;
|
||||||
rawstr4c: Raw String for C (GPLv3+) v{Version::VERSION}-{Version::RELEASE_DATE}
|
rawstr4c: Raw String for C (GPLv3+) v{Rawstr4c::Version::VERSION}-{Rawstr4c::Version::RELEASE_DATE}
|
||||||
|
|
||||||
Usage: rawstr4c [options] <FILE.md|DIR>
|
Usage: rawstr4c [options] <FILE.md|DIR>
|
||||||
|
|
||||||
|
@ -10,14 +10,14 @@
|
|||||||
# Represent a section's working configuration
|
# Represent a section's working configuration
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
||||||
use Parser;
|
use Rawstr4c::Parser;
|
||||||
|
|
||||||
unit module Config;
|
unit module Rawstr4c::Config;
|
||||||
|
|
||||||
#| 一个 section 的配置 (基于层次化结构而形成的最终真正生效的配置)
|
#| 一个 section 的配置 (基于层次化结构而形成的最终真正生效的配置)
|
||||||
class SectionConfig {
|
class SectionConfig {
|
||||||
|
|
||||||
has Parser::Section $.section;
|
has Rawstr4c::Parser::Section $.section;
|
||||||
|
|
||||||
method new($section) {
|
method new($section) {
|
||||||
self.bless(:$section);
|
self.bless(:$section);
|
@ -10,11 +10,11 @@
|
|||||||
# Generates C code from rawstr4c configuration
|
# Generates C code from rawstr4c configuration
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
||||||
unit module Generator;
|
unit module Rawstr4c::Generator;
|
||||||
|
|
||||||
use Parser;
|
use Rawstr4c::Parser;
|
||||||
use Config;
|
use Rawstr4c::Config;
|
||||||
use Version;
|
use Rawstr4c::Version;
|
||||||
|
|
||||||
my class CStringConverter {
|
my class CStringConverter {
|
||||||
|
|
||||||
@ -198,11 +198,11 @@ my class CVariableGenerator {
|
|||||||
|
|
||||||
class Generator {
|
class Generator {
|
||||||
|
|
||||||
has Bool $!enable-debug = False; # 是否启用调试模式
|
has Bool $!enable-debug = False; # 是否启用调试模式
|
||||||
has Parser::Parser $.parser;
|
has Rawstr4c::Parser::Parser $.parser;
|
||||||
has CStringConverter $.string-converter;
|
has CStringConverter $.string-converter;
|
||||||
has CVariableNameGenerator $.varname-generator;
|
has CVariableNameGenerator $.varname-generator;
|
||||||
has CVariableGenerator $.variable-generator;
|
has CVariableGenerator $.variable-generator;
|
||||||
|
|
||||||
method new($parser) {
|
method new($parser) {
|
||||||
self.bless(
|
self.bless(
|
@ -10,7 +10,7 @@
|
|||||||
# rawstr4c.md parsing
|
# rawstr4c.md parsing
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
||||||
unit module Parser;
|
unit module Rawstr4c::Parser;
|
||||||
|
|
||||||
#| 不能用 Bool,只能用 Boolean
|
#| 不能用 Bool,只能用 Boolean
|
||||||
my enum ConfigItem's-ValueType < RS4C-Nil RS4C-String RS4C-Mode RS4C-Bool>;
|
my enum ConfigItem's-ValueType < RS4C-Nil RS4C-String RS4C-Mode RS4C-Bool>;
|
@ -8,7 +8,7 @@
|
|||||||
# Last Modified : <2025-07-16>
|
# Last Modified : <2025-07-16>
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
||||||
unit module Version;
|
unit module Rawstr4c::Version;
|
||||||
|
|
||||||
constant VERSION = "0.2.1.0";
|
constant VERSION = "0.2.1.0";
|
||||||
constant RELEASE_DATE = "2025/07/16";
|
constant RELEASE_DATE = "2025/07/16";
|
Loading…
x
Reference in New Issue
Block a user