A68_ATTR(PROC_SYMBOL, "proc-symbol")
A68_ATTR(PUBLIC_SYMBOL, "public-symbol")
A68_ATTR(QUALIFIER, "qualifier")
+A68_ATTR(QUOTE_SYMBOL,"quote-symbol")
A68_ATTR(RADIX_FRAME, "radix frame")
A68_ATTR(REAL_DENOTATION, "real denotation")
A68_ATTR(REAL_PATTERN, "real pattern")
{
for (NODE_T *q = p; q != NO_NODE; FORWARD (q))
{
- if (a68_whether (q, IDENTIFIER, OF_SYMBOL, STOP))
+ if (a68_whether (q, IDENTIFIER, OF_SYMBOL, STOP)
+ || a68_whether (q, IDENTIFIER, QUOTE_SYMBOL, STOP))
ATTRIBUTE (q) = FIELD_IDENTIFIER;
reduce (q, NO_NOTE, NO_TICK, NIHIL, NIL_SYMBOL, STOP);
reduce (q, NO_NOTE, NO_TICK, SKIP, SKIP_SYMBOL, STOP);
reduce (q, NO_NOTE, NO_TICK, SELECTOR, FIELD_IDENTIFIER, OF_SYMBOL, STOP);
+ reduce (q, NO_NOTE, NO_TICK, SELECTOR, FIELD_IDENTIFIER, QUOTE_SYMBOL, STOP);
/* JUMPs without GOTO are resolved later. */
reduce (q, NO_NOTE, NO_TICK, JUMP, GOTO_SYMBOL, IDENTIFIER, STOP);
reduce (q, NO_NOTE, NO_TICK, DENOTATION, LONGETY, INT_DENOTATION, STOP);
add_keyword (&A68 (top_keyword), ORF_SYMBOL, "OREL");
add_keyword (&A68 (top_keyword), BRIEF_COMMENT_BEGIN_SYMBOL, "{");
add_keyword (&A68 (top_keyword), BRIEF_COMMENT_END_SYMBOL, "}");
+ add_keyword (&A68 (top_keyword), QUOTE_SYMBOL, "'");
if (OPTION_STROPPING (&A68_JOB) != SUPPER_STROPPING)
{
#define STOP_CHAR 127
#define FORMFEED_CHAR '\f'
#define CR_CHAR '\r'
+#define SINGLE_QUOTE_CHAR '\''
#define QUOTE_CHAR '"'
#define APOSTROPHE_CHAR '\''
#define BACKSLASH_CHAR '\\'
*att = POINT_SYMBOL;
}
}
+ else if (!OPTION_STRICT (&A68_JOB) && c == SINGLE_QUOTE_CHAR)
+ {
+ c = next_char (ref_l, ref_s, true);
+ (sym++)[0] = SINGLE_QUOTE_CHAR;
+ sym[0] = '\0';
+ *att = QUOTE_SYMBOL;
+ }
else if (ISDIGIT (c))
{
/* Something that begins with a digit:
case ESAC_SYMBOL:
case OD_SYMBOL:
case OF_SYMBOL:
+ case QUOTE_SYMBOL:
case FI_SYMBOL:
case CLOSE_SYMBOL:
case BUS_SYMBOL:
case NIL_SYMBOL:
case OD_SYMBOL:
case OF_SYMBOL:
+ case QUOTE_SYMBOL:
case OPEN_SYMBOL:
case OP_SYMBOL:
case ORF_SYMBOL:
@menu
* @code{@B{bin}} and @code{@B{abs}} of negative integral values::
* Bold taggles:: Using underscores in mode and operator indications.
+* Brief selection:: Shorter form of the @code{of-symbol}.
@end menu
@node @code{@B{bin}} and @code{@B{abs}} of negative integral values
Bold taggles are available when the gnu68 dialect of the language is
selected. @xref{Dialect options}.
+@node Brief selection
+@section Brief selection
+
+It was early recognized that a shorter alternative representation the
+of-symbol was very much needed, considering the fact the bold version
+@code{@B{of}} is at least four characters long. This makes certain
+phrases long and also slightly laborious to read, like in:
+
+@example
+@B{pub} @B{op} + = (@B{Pos} a,b) @B{Pos}: (c @B{of} a + c @B{of} b, r @B{of} a + r @B{of} b),
+ - = (@B{Pos} a,b) @B{Pos}: (c @B{of} a - c @B{of} b, r @B{of} a - r @B{of} b);
+@end example
+
+This compiler allows using a quote character @code{'} instead of
+@code{of} in selections of structs and multiples. Using this brief
+style the example above now can be written as:
+
+@example
+@B{pub} @B{op} + = (@B{Pos} a,b) @B{Pos}: (c'a + c'b, r'a + r'b),
+ - = (@B{Pos} a,b) @B{Pos}: (c'a - c'b, r'a - r'b);
+@end example
+
@include gpl_v3.texi
@include fdl.texi
[NC] This is the GNU68-2025-005-nestable-comments GNU extension. It
adds support for nestable block comments.
+ [BF] This is the GNU68-2026-001-brief-selection GNU extension. It
+ adds support for a brief form of the selection construct.
+
The metaproduction rules, hyper-rules and hyper-alternatives
introduced by each extension are clearly marked in the sections
below. You can easily search for them using the extensions tags in
3.4.1 Syntax
A) CHOICE :: choice using boolean ; CASE.
-B) CASE :: choice using intgral ; choice using UNITED.
+B) CASE :: choice using integral ; choice using UNITED.
a) SOID NEST1 CHOICE clause{5D,551a,A341h,A349a} :
CHOICE STYLE start{91a,-},
5.3.1.1 Syntax
+{ Extensions:
+ [BF] brief selection }
+
A) REFETY :: REF to ; EMPTY.
B) REFLEXETY :: REF to ; REF to flexible ; EMPTY.
a) REFETY MODE1 NEST selection{5C} :
MODE1 field FIELDS applied field selector with TAG{48d},
- of{94f} token, weak REFLEXETY ROWS of structured with
- FIELDS mode NEST SECONDARY{5C},
+ STYLE selection token, weak REFLEXETY ROWS of structured with
+ FIELDS mode NEST SECONDARY{5C},
where (REFETY) is derived from (REFLEXETY){b,c,-}.
b) WHETHER (transient reference to) is derived from
(REF to flexible){a,532,66a} :
STYLE else{94f,-} token ;
where (CHOICE) is (CASE), STYLE out{94f,-} token.
e) CHOICE STYLE finish{34a} :
- whre (CHOICE) is (choice using boolean),
+ where (CHOICE) is (choice using boolean),
STYLE fi{94f,-} token ;
where (CHOICE) is (CASE), STYLE esac{94f,-} token.
f) NOTION token :
[CS] andth symbol, orel symbol
[MR] access symbol, module symbol, def symbol, public symbol,
postlude symbol, formal nest symbol, egg symbol
- [US] unsafe symbol }
+ [US] unsafe symbol
+ [SS] brief of symbol }
{ This section of the Report doesn't describe syntax, but lists all
the different symbols along with their representation in the
formal nest symbol{56b} NEST
egg symbol{A6a,c} EGG
f) unsafe symbol{37a} UNSAFE
+ bold of symbol{53a} OF
+ brief of symbol{53a} '
h) bold comment begin symbol{92a} NOTE
bold comment end symbol{92a} ETON
brief comment begin symbol{92a} {
--- /dev/null
+{ dg-options "-std=algol68" }
+
+begin mode Foo = struct (int a,b);
+ a'b; { dg-error "unworthy" }
+ skip
+end
# Selecting a struct name results in sub-names. #
BEGIN MODE PERSON = STRUCT (INT age, REAL income, INT num children);
PERSON person;
- age OF person := 44;
- income OF person := 999.99;
+ age'person := 44;
+ income'person := 999.99;
num children OF person := 0;
ASSERT (age OF person = 44);
ASSERT (num children OF person = 0);
-# { dg-options "-fstropping=upper" } #
-# pr UPPER pr #
-BEGIN MODE JORL = STRUCT (INT i, REAL r);
- REF JORL jorl = LOC JORL := (10, 3.14);
- ASSERT (i OF jorl = 10)
-END
+begin mode Jorl = struct (int i, real r);
+ ref Jorl jorl = loc Jorl := (10, 3.14);
+ assert (i'jorl = 10)
+end