GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
erl_comment_scan(3) Erlang Module Definition erl_comment_scan(3)

erl_comment_scan - Functions for reading comment lines from Erlang source code.

Functions for reading comment lines from Erlang source code.

comment() = {Line::integer(), Column::integer(), Indentation::integer(), Text::[string()]}:

commentLine() = {Line::integer(), Column::integer(), Indent::integer(), Text::string()}:

file(Name::file:filename()) -> [comment()]

Extracts comments from an Erlang source code file. Returns a list of entries representing multi-line comments, listed in order of increasing line-numbers. For each entry, Text is a list of strings representing the consecutive comment lines in top-down order; the strings contain all characters following (but not including) the first comment-introducing % character on the line, up to (but not including) the line-terminating newline.

Furthermore, Line is the line number and Column the left column of the comment (i.e., the column of the comment-introducing % character). Indent is the indentation (or padding), measured in character positions between the last non-whitespace character before the comment (or the left margin), and the left column of the comment. Line and Column are always positive integers, and Indentation is a nonnegative integer.

Evaluation exits with reason {read, Reason} if a read error occurred, where Reason is an atom corresponding to a Posix error code; see the module file(3) for details.

join_lines(Lines::[commentLine()]) -> [comment()]

Joins individual comment lines into multi-line comments. The input is a list of entries representing individual comment lines, in order of decreasing line-numbers; see scan_lines/1 for details. The result is a list of entries representing multi-line comments, still listed in order of decreasing line-numbers, but where for each entry, Text is a list of consecutive comment lines in order of increasing line-numbers (i.e., top-down).

See also: scan_lines/1.

scan_lines(Text::string()) -> [commentLine()]

Extracts individual comment lines from a source code string. Returns a list of comment lines found in the text, listed in order of decreasing line-numbers, i.e., the last comment line in the input is first in the resulting list. Text is a single string, containing all characters following (but not including) the first comment-introducing % character on the line, up to (but not including) the line-terminating newline. For details on Line, Column and Indent, see file/1.

string(Text::string()) -> [comment()]

Extracts comments from a string containing Erlang source code. Except for reading directly from a string, the behaviour is the same as for file/1.

See also: file/1.

Richard Carlsson <carlsson.richard@gmail.com>
syntax_tools 2.6

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.