Skip to content

Commit 80c5480

Browse files
committed
Added original QBasic doc for OPEN
1 parent a15fd11 commit 80c5480

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

rusty_parser/src/built_ins/open.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ use crate::input::StringView;
77
use crate::pc_specific::*;
88
use crate::tokens::equal_sign_ws;
99
use crate::{BuiltInSub, ParserError, *};
10+
11+
/// Original doc from QBasic regarding OPEN:
12+
///
13+
/// Opens a file or device.
14+
///
15+
/// ```txt
16+
/// OPEN file$ [FOR mode] [ACCESS access] [lock] AS [#]filenumber% [LEN=reclen%]
17+
/// ```
18+
///
19+
/// file$: The name of the file or device. The file name may include a drive and path.
20+
///
21+
/// mode: One of the following file modes: APPEND, BINARY, INPUT, OUTPUT, or RANDOM.
22+
///
23+
/// access: In network environments, specifies whether the file is
24+
/// opened for READ, WRITE, or READ WRITE access.
25+
///
26+
/// lock: Specifies the file locking in network environments:
27+
/// SHARED, LOCK READ, LOCK WRITE, LOCK READ WRITE.
28+
///
29+
/// filenumber%: A number in the range 1 through 255 that identifies the file while it is open.
30+
///
31+
/// reclen%: For random-access files, the record length (default is 128 bytes). For sequential files,
32+
/// the number of characters buffered (default is 512 bytes).
1033
pub fn parse() -> impl Parser<StringView, Output = Statement, Error = ParserError> {
1134
seq6(
1235
keyword(Keyword::Open),

0 commit comments

Comments
 (0)