Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for words related to string and numeric literals #12

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions documentation.frt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,70 @@ Drop the topmost element of the stack
( a b -- b a )
Swap two topmost elements of the stack
" doc-word

' read-oct-digit g"
( -- digit )
Read one octal digit
" doc-word

' read-hex-digit g"
( -- digit )
Read one hexadecimal digit
" doc-word

' read-digit g"
( -- digit )
Read one decimal digit
" doc-word

' ." g"
( -- )
Print string literal

This word reads the string until it meets a double quote, stores it in
the word being defined and prints it.
" doc-word

' g" g"
( -- string )
Store string literal in global data segment

This word reads the string until it meets a double quote, stores it in
the global data segment and pushes the pointer to it onto the stack.
" doc-word

' " g"
( -- string )
Read string literal with escape sequences

This word reads the string until it meets a double quote, stores it in
the word being defined and pushes the pointer to it onto the stack.
" doc-word

' _" g"
( -- string )
Read string literal without expanding escape sequences

This word reads the string until it meets a double quote, stores it in
the word being defined and pushes the pointer to it onto the stack.
" doc-word

' 0x g"
( -- number )
Read hexadecimal literal
" doc-word

' 08x g"
( -- number )
Read octal literal
" doc-word

' O_CREAT g"
( -- 0x40 )
Push a flag O_CREAT (create new file if pathname does not exist) onto stack
" doc-word

' O_APPEND g"
( -- 0x400 )
Push a flag O_APPEND (seek to the end of file) onto stack
" doc-word