Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
ad07d41b
Commit
ad07d41b
authored
Jun 23, 2013
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve generator
parent
dd6b265b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
624 additions
and
612 deletions
+624
-612
doc/language/Core.md
doc/language/Core.md
+592
-593
doc/language/mrbdoc/lib/mrbdoc_analyze.rb
doc/language/mrbdoc/lib/mrbdoc_analyze.rb
+21
-5
doc/language/mrbdoc/lib/mrbdoc_docu.rb
doc/language/mrbdoc/lib/mrbdoc_docu.rb
+11
-14
No files found.
doc/language/Core.md
View file @
ad07d41b
This diff is collapsed.
Click to expand it.
doc/language/mrbdoc/lib/mrbdoc_analyze.rb
View file @
ad07d41b
...
...
@@ -6,13 +6,11 @@ class MRBDoc
@mrb_files
=
{}
@dir
=
File
.
expand_path
(
dir
)
block
.
call
"MRBDOC
\t
Start Analyzing Source of
#{
@dir
}
"
block
.
call
"MRBDOC
\t
analyze
#{
@dir
}
"
analyze
(
dir
)
do
|
progress
|
block
.
call
progress
end
block
.
call
"MRBDOC
\t
Finish Analyzing Source"
end
def
each_file
(
&
block
);
@mrb_files
.
each
{
|
k
,
v
|
block
.
call
k
,
v
};
end
...
...
@@ -97,6 +95,13 @@ class MRBFile
@last_line
=
nil
@assignments
=
{}
@assignments
[
'mrb->object_class'
]
=
'Object'
@assignments
[
'mrb->kernel_module'
]
=
'Kernel'
@assignments
[
'mrb->module_class'
]
=
'Module'
@assignments
[
'mrb->nil_class'
]
=
'NilClass'
@assignments
[
'mrb->true_class'
]
=
'TrueClass'
@assignments
[
'mrb->class_class'
]
=
'Class'
analyze
end
...
...
@@ -121,8 +126,8 @@ class MRBFile
end
def
each_module
&
block
@rb_module_c_def
.
each
_key
do
|
module_name
|
block
.
call
module_name
@rb_module_c_def
.
each
do
|
module_name
,
module_hsh
|
block
.
call
module_name
,
module_hsh
end
end
...
...
@@ -202,6 +207,17 @@ class MRBFile
iso
=
$5
.
clone
iso
.
strip!
@rb_class_method_c_def
[
"
#{
class_name
}
_
#{
$2
}
"
]
=
{
:c_func
=>
$3
,
:args
=>
$4
,
:rb_class
=>
class_name
,
:iso
=>
iso
}
when
/mrb_name_class\(.*?\,
#{
RXP_C_VAR
}
\,\s*mrb_intern\(.*?,
#{
RXP_C_STR
}
\)\)
#{
RXP_C_ISO
}
/
class_name
=
$2
.
clone
iso
=
$3
.
clone
iso
.
strip!
@rb_class_c_def
[
class_name
]
=
{
:c_object
=>
$1
,
:iso
=>
iso
}
@assignments
[
$1
]
=
class_name
when
/mrb_include_module\(.*?\,
#{
RXP_C_VAR
}
\,\s*mrb_class_get\(.*?\,
#{
RXP_C_STR
}
\)\)/
class_name
=
resolve_obj
(
$1
)
mod
=
$2
.
clone
@rb_class_c_def
[
class_name
][
:include
]
=
[]
unless
@rb_class_c_def
[
class_name
].
has_key?
:include
@rb_class_c_def
[
class_name
][
:include
]
<<
mod
end
end
...
...
doc/language/mrbdoc/lib/mrbdoc_docu.rb
View file @
ad07d41b
class
MRBDoc
DOC_DIR
=
'language'
def
write_documentation
dir
,
&
block
block
.
call
"MRBDOC
\t
Start Building Documentation to
#{
doc_dir
(
dir
)
}
"
block
.
call
"MRBDOC
\t
write to
#{
File
.
expand_path
(
dir
)
}
"
write
(
dir
)
do
|
progress
|
block
.
call
progress
end
block
.
call
"MRBDOC
\t
Finish Building Documentation"
end
private
def
write
dir
# io = STDOUT
File
.
open
(
File
.
expand_path
(
'Core_Classes.md'
,
dir
),
'w+'
)
do
|
io
|
File
.
open
(
File
.
expand_path
(
'Core.md'
,
dir
),
'w+'
)
do
|
io
|
print_core_classes
(
io
)
print_core_modules
(
io
)
end
...
...
@@ -44,14 +39,16 @@ class MRBDoc
file
=
find_c_file_by_class
(
name
)
file
=
file
.
split
(
"
#{
@dir
}
/"
)[
1
]
iso
=
hsh
[
:data
][
:iso
]
iso
=
'n/a'
if
iso
.
nil?
iso
=
'n/a'
if
iso
.
nil?
or
iso
==
''
mixins
=
hsh
[
:data
][
:include
].
join
(
', '
)
unless
hsh
[
:data
][
:include
].
nil?
mixins
=
'n/a'
if
mixins
.
nil?
or
mixins
==
''
io
.
puts
<<
CLASS
##
#{
name
}
ISO Code | Mixins | Source File
--- | --- | ---
#{
hsh
[
:data
][
:iso
]
}
| n/a
|
#{
file
}
#{
iso
}
|
#{
mixins
}
|
#{
file
}
CLASS
print_class_methods
(
io
,
hsh
)
...
...
@@ -65,8 +62,8 @@ CLASS
core_list
.
sort
.
each
do
|
name
,
hsh
|
file
=
find_c_file_by_module
(
name
)
file
=
file
.
split
(
"
#{
@dir
}
/"
)[
1
]
iso
=
hsh
[
:iso
]
iso
=
'n/a'
if
iso
.
nil?
iso
=
hsh
[
:
data
][
:
iso
]
iso
=
'n/a'
if
iso
.
nil?
or
iso
==
''
io
.
puts
<<
CLASS
##
#{
name
}
...
...
@@ -101,16 +98,16 @@ CLASS
line_no
=
find_c_func
(
met_hsh
[
:c_func
])[
:line_no
]
file
=
find_c_file
(
met_hsh
[
:rb_class
],
met_hsh
[
:c_func
])
file
=
file
.
split
(
"
#{
@dir
}
/"
)[
1
]
iso
=
met_hsh
[
:iso
]
iso
=
'n/a'
if
iso
.
nil?
or
iso
==
''
io
.
puts
<<
METHOD
####
#{
met_name
}
ISO Code | Source File | C Function | Line
--- | --- | ---
#{
met_hsh
[
:iso
]
}
|
#{
file
}
|
#{
met_hsh
[
:c_func
]
}
|
#{
line_no
}
#{
iso
}
|
#{
file
}
|
#{
met_hsh
[
:c_func
]
}
|
#{
line_no
}
METHOD
end
def
doc_dir
dir
;
File
.
expand_path
DOC_DIR
,
dir
;
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment