Add copyright and licence notices to files which lack them.
[pspp] / tests / language / lexer / segment.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl 
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl 
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl 
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl AT_BANNER([syntax segmentation])
17 m4_define([PSPP_CHECK_SEGMENT],
18   [AT_CHECK([segment-test $1 input], [0], [expout])
19    AT_CHECK([segment-test -1 $1 input], [0], [expout])
20    AT_CHECK([segment-test -0 $1 input])
21    AT_CHECK([segment-test -01 $1 input])])
22 \f
23 AT_SETUP([identifiers])
24 AT_KEYWORDS([segment])
25 AT_DATA([input], [dnl
26 a ab abc abcd
27 A AB ABC ABCD
28 aB aBC aBcD
29 $x $y $z
30 grève@<00A0>@Ângstrom@<00A0>@poté
31 #a #b #c ## #d
32 @efg @ @@. @#@ @&t@
33 ## # #12345 #.#
34 f@#_.#6
35 GhIjK
36 .x 1y _z
37 ])
38 AT_DATA([expout], [dnl
39 identifier      a    space
40 identifier      ab    space
41 identifier      abc    space
42 identifier      abcd
43 newline         \n (later)
44
45 identifier      A    space
46 identifier      AB    space
47 identifier      ABC    space
48 identifier      ABCD
49 newline         \n (later)
50
51 identifier      aB    space
52 identifier      aBC    space
53 identifier      aBcD
54 newline         \n (later)
55
56 identifier      $x    space
57 identifier      $y    space
58 identifier      $z
59 newline         \n (later)
60
61 identifier      grève
62 spaces          <U+00A0>
63 identifier      Ângstrom
64 spaces          <U+00A0>
65 identifier      poté
66 newline         \n (later)
67
68 identifier      #a    space
69 identifier      #b    space
70 identifier      #c    space
71 identifier      ##    space
72 identifier      #d
73 newline         \n (later)
74
75 identifier      @efg    space
76 identifier      @    space
77 identifier      @@.    space
78 identifier      @#@    space
79 newline         \n (later)
80
81 identifier      ##    space
82 identifier      #    space
83 identifier      #12345    space
84 identifier      #.#
85 newline         \n (later)
86
87 identifier      f@#\_.#6
88 newline         \n (later)
89
90 identifier      GhIjK
91 newline         \n (later)
92
93 start_command   .
94 identifier      x    space
95 number          1
96 identifier      y    space
97 unexpected_char \_
98 identifier      z
99 newline         \n (later)
100
101 end             <U+0000>
102 ])
103 PSPP_CHECK_SEGMENT([-i])
104 AT_CLEANUP
105 \f
106 AT_SETUP([identifiers that end in '.'])
107 AT_KEYWORDS([segment])
108 AT_DATA([input], [dnl
109 abcd. abcd.
110 ABCD. ABCD.
111 aBcD. aBcD. @&t@
112 $y. $z. あいうえお.
113 #c. #d..
114 @@. @@....
115 #.#.
116 #abcd.
117 .
118 . @&t@
119 LMNOP. @&t@
120 QRSTUV./* end of line comment */
121 qrstuv. /* end of line comment */
122 QrStUv./* end of line comment */ @&t@
123 wxyz./* unterminated end of line comment
124 WXYZ. /* unterminated end of line comment
125 WxYz./* unterminated end of line comment @&t@
126 ])
127 AT_DATA([expout], [dnl
128 identifier      abcd.    space
129 identifier      abcd
130 end_command     .
131 newline         \n (first)
132
133 identifier      ABCD.    space
134 identifier      ABCD
135 end_command     .
136 newline         \n (first)
137
138 identifier      aBcD.    space
139 identifier      aBcD
140 end_command     .    space
141 newline         \n (first)
142
143 identifier      $y.    space
144 identifier      $z.    space
145 identifier      あいうえお
146 end_command     .
147 newline         \n (first)
148
149 identifier      #c.    space
150 identifier      #d.
151 end_command     .
152 newline         \n (first)
153
154 identifier      @@.    space
155 identifier      @@...
156 end_command     .
157 newline         \n (first)
158
159 identifier      #.#
160 end_command     .
161 newline         \n (first)
162
163 identifier      #abcd
164 end_command     .
165 newline         \n (first)
166
167 start_command   .
168 newline         \n (first)
169
170 start_command   .    space
171 newline         \n (first)
172
173 identifier      LMNOP
174 end_command     .    space
175 newline         \n (first)
176
177 identifier      QRSTUV
178 end_command     .
179 comment         /*_end_of_line_comment_*/
180 newline         \n (first)
181
182 identifier      qrstuv
183 end_command     .    space
184 comment         /*_end_of_line_comment_*/
185 newline         \n (first)
186
187 identifier      QrStUv
188 end_command     .
189 comment         /*_end_of_line_comment_*/    space
190 newline         \n (first)
191
192 identifier      wxyz
193 end_command     .
194 comment         /*_unterminated_end_of_line_comment
195 newline         \n (first)
196
197 identifier      WXYZ
198 end_command     .    space
199 comment         /*_unterminated_end_of_line_comment
200 newline         \n (first)
201
202 identifier      WxYz
203 end_command     .
204 comment         /*_unterminated_end_of_line_comment_
205 newline         \n (first)
206
207 end             <U+0000>
208 ])
209 PSPP_CHECK_SEGMENT([-i])
210 AT_CLEANUP
211 \f
212 AT_SETUP([reserved words])
213 AT_KEYWORDS([segment])
214 AT_DATA([input], [dnl
215 and or not eq ge gt le lt ne all by to with
216 AND OR NOT EQ GE GT LE LT NE ALL BY TO WITH
217 andx orx notx eqx gex gtx lex ltx nex allx byx tox withx
218 and. with.
219 ])
220 AT_DATA([expout], [dnl
221 reserved_word   and    space
222 reserved_word   or    space
223 reserved_word   not    space
224 reserved_word   eq    space
225 reserved_word   ge    space
226 reserved_word   gt    space
227 reserved_word   le    space
228 reserved_word   lt    space
229 reserved_word   ne    space
230 reserved_word   all    space
231 reserved_word   by    space
232 reserved_word   to    space
233 reserved_word   with
234 newline         \n (later)
235
236 reserved_word   AND    space
237 reserved_word   OR    space
238 reserved_word   NOT    space
239 reserved_word   EQ    space
240 reserved_word   GE    space
241 reserved_word   GT    space
242 reserved_word   LE    space
243 reserved_word   LT    space
244 reserved_word   NE    space
245 reserved_word   ALL    space
246 reserved_word   BY    space
247 reserved_word   TO    space
248 reserved_word   WITH
249 newline         \n (later)
250
251 identifier      andx    space
252 identifier      orx    space
253 identifier      notx    space
254 identifier      eqx    space
255 identifier      gex    space
256 identifier      gtx    space
257 identifier      lex    space
258 identifier      ltx    space
259 identifier      nex    space
260 identifier      allx    space
261 identifier      byx    space
262 identifier      tox    space
263 identifier      withx
264 newline         \n (later)
265
266 identifier      and.    space
267 reserved_word   with
268 end_command     .
269 newline         \n (first)
270
271 end             <U+0000>
272 ])
273 PSPP_CHECK_SEGMENT([-i])
274 AT_CLEANUP
275 \f
276 AT_SETUP([punctuation])
277 AT_KEYWORDS([segment])
278 AT_DATA([input], [dnl
279 ~ & | = >= > <= < ~= <> ( ) , - + * / [[ ]] **
280 ~&|=>=><=<~=<>(),-+*/[[]]**
281 ])
282 AT_DATA([expout], [dnl
283 punct           ~    space
284 punct           &    space
285 punct           |    space
286 punct           =    space
287 punct           >=    space
288 punct           >    space
289 punct           <=    space
290 punct           <    space
291 punct           ~=    space
292 punct           <>    space
293 punct           (    space
294 punct           )    space
295 punct           ,    space
296 punct           -    space
297 punct           +    space
298 punct           *    space
299 punct           /    space
300 punct           [[    space
301 punct           ]]    space
302 punct           **
303 newline         \n (later)
304
305 punct           ~
306 punct           &
307 punct           |
308 punct           =
309 punct           >=
310 punct           >
311 punct           <=
312 punct           <
313 punct           ~=
314 punct           <>
315 punct           (
316 punct           )
317 punct           ,
318 punct           -
319 punct           +
320 punct           *
321 punct           /
322 punct           [[
323 punct           ]]
324 punct           **
325 newline         \n (later)
326
327 end             <U+0000>
328 ])
329 PSPP_CHECK_SEGMENT([-i])
330 AT_CLEANUP
331 \f
332 AT_SETUP([numbers])
333 AT_KEYWORDS([segment])
334 AT_DATA([input], [dnl
335 0 1 01 001. 1.
336 123. /* comment 1 */ /* comment 2 */
337 .1 0.1 00.1 00.10
338 5e1 6E-1 7e+1 6E+01 6e-03
339 .3E1 .4e-1 .5E+1 .6e+01 .7E-03
340 1.23e1 45.6E-1 78.9e+1 99.9E+01 11.2e-03
341 . 1e e1 1e+ 1e-
342 ])
343 AT_DATA([expout], [dnl
344 number          0    space
345 number          1    space
346 number          01    space
347 number          001.    space
348 number          1
349 end_command     .
350 newline         \n (first)
351
352 number          123
353 end_command     .    space
354 comment         /*_comment_1_*/    space
355 comment         /*_comment_2_*/
356 newline         \n (first)
357
358 start_command   .
359 number          1    space
360 number          0.1    space
361 number          00.1    space
362 number          00.10
363 newline         \n (later)
364
365 number          5e1    space
366 number          6E-1    space
367 number          7e+1    space
368 number          6E+01    space
369 number          6e-03
370 newline         \n (later)
371
372 start_command   .
373 number          3E1    space
374 number          .4e-1    space
375 number          .5E+1    space
376 number          .6e+01    space
377 number          .7E-03
378 newline         \n (later)
379
380 number          1.23e1    space
381 number          45.6E-1    space
382 number          78.9e+1    space
383 number          99.9E+01    space
384 number          11.2e-03
385 newline         \n (later)
386
387 start_command   .    space
388 expected_exponent 1e    space
389 identifier      e1    space
390 expected_exponent 1e+    space
391 expected_exponent 1e-
392 newline         \n (later)
393
394 end             <U+0000>
395 ])
396 PSPP_CHECK_SEGMENT([-i])
397 AT_CLEANUP
398 \f
399 AT_SETUP([strings])
400 AT_KEYWORDS([segment])
401 AT_DATA([input], [dnl
402 'x' "y" 'abc'
403 'Don''t' "Can't" 'Won''t'
404 """quoted""" '"quoted"'
405 '' ""
406 'missing end quote
407 "missing double quote
408 x"4142" X'5152'
409 u'fffd' U"041"
410 + new command
411 + /* comment */ 'string continuation'
412 + /* also a punctuator on blank line
413 - 'new command'
414 ])
415 AT_DATA([expout], [dnl
416 quoted_string   'x'    space
417 quoted_string   "y"    space
418 quoted_string   'abc'
419 newline         \n (later)
420
421 quoted_string   'Don''t'    space
422 quoted_string   "Can't"    space
423 quoted_string   'Won''t'
424 newline         \n (later)
425
426 quoted_string   """quoted"""    space
427 quoted_string   '"quoted"'
428 newline         \n (later)
429
430 quoted_string   ''    space
431 quoted_string   ""
432 newline         \n (later)
433
434 expected_quote  'missing_end_quote
435 newline         \n (later)
436
437 expected_quote  "missing_double_quote
438 newline         \n (later)
439
440 hex_string      x"4142"    space
441 hex_string      X'5152'
442 newline         \n (later)
443
444 unicode_string  u'fffd'    space
445 unicode_string  U"041"
446 newline         \n (later)
447
448 start_command   +    space
449 identifier      new    space
450 identifier      command
451 newline         \n (later)
452
453 punct           +    space
454 comment         /*_comment_*/    space
455 quoted_string   'string_continuation'
456 newline         \n (later)
457
458 punct           +    space
459 comment         /*_also_a_punctuator_on_blank_line
460 newline         \n (later)
461
462 start_command   -    space
463 quoted_string   'new_command'
464 newline         \n (later)
465
466 end             <U+0000>
467 ])
468 PSPP_CHECK_SEGMENT([-i])
469 AT_CLEANUP
470 \f
471 AT_SETUP([@%:@! construct])
472 AT_KEYWORDS([segment])
473 AT_DATA([input], [dnl
474 #! /usr/bin/pspp
475 title my title.
476 #! /usr/bin/pspp
477 ])
478 AT_DATA([expout], [dnl
479 shbang          #!_/usr/bin/pspp
480 newline         \n (first)
481
482 identifier      title    space
483 unquoted_string my_title
484 end_command     .
485 newline         \n (first)
486
487 identifier      #
488 unexpected_char !    space
489 punct           /
490 identifier      usr
491 punct           /
492 identifier      bin
493 punct           /
494 identifier      pspp
495 newline         \n (later)
496
497 end             <U+0000>
498 ])
499 PSPP_CHECK_SEGMENT([-i])
500 AT_CLEANUP
501 \f
502 AT_SETUP([* and COMMENT commands])
503 AT_KEYWORDS([segment])
504 AT_DATA([input], [dnl
505 * Comment commands "don't
506 have to contain valid tokens.
507
508 ** Check ambiguity with ** token.
509 ****************.
510
511 comment keyword works too.
512 COMM also.
513 com is ambiguous with COMPUTE.
514
515    * Comment need not start at left margin.
516
517 * Comment ends with blank line
518
519 next command.
520
521 ])
522 AT_DATA([expout], [dnl
523 comment_command *_Comment_commands_"don't
524 newline         \n (COMMENT)
525
526 comment_command have_to_contain_valid_tokens
527 end_command     .
528 newline         \n (first)
529
530 separate_commands
531 newline         \n (first)
532
533 comment_command **_Check_ambiguity_with_**_token
534 end_command     .
535 newline         \n (first)
536
537 comment_command ****************
538 end_command     .
539 newline         \n (first)
540
541 separate_commands
542 newline         \n (first)
543
544 comment_command comment_keyword_works_too
545 end_command     .
546 newline         \n (first)
547
548 comment_command COMM_also
549 end_command     .
550 newline         \n (first)
551
552 identifier      com    space
553 identifier      is    space
554 identifier      ambiguous    space
555 reserved_word   with    space
556 identifier      COMPUTE
557 end_command     .
558 newline         \n (first)
559
560 separate_commands 
561 newline         \n (first)
562
563 spaces          ___
564 comment_command *_Comment_need_not_start_at_left_margin
565 end_command     .
566 newline         \n (first)
567
568 separate_commands 
569 newline         \n (first)
570
571 comment_command *_Comment_ends_with_blank_line
572 newline         \n (COMMENT)
573
574 separate_commands
575 newline         \n (first)
576
577 identifier      next    space
578 identifier      command
579 end_command     .
580 newline         \n (first)
581
582 separate_commands
583 newline         \n (first)
584
585 end             <U+0000>
586 ])
587 PSPP_CHECK_SEGMENT([-i])
588 AT_CLEANUP
589 \f
590 AT_SETUP([DOCUMENT command])
591 AT_KEYWORDS([segment])
592 AT_DATA([input], [dnl
593 DOCUMENT one line.
594 DOC more
595     than
596         one
597             line.
598 docu
599 first.paragraph
600 isn't parsed as tokens
601
602 second paragraph.
603 ])
604 AT_DATA([expout], [dnl
605 start_document
606 document        DOCUMENT_one_line.
607 end_command     
608 separate_commands
609 newline         \n (first)
610
611 start_document
612 document        DOC_more
613 newline         \n (DOCUMENT)
614
615 document        ____than
616 newline         \n (DOCUMENT)
617
618 document        ________one
619 newline         \n (DOCUMENT)
620
621 document        ____________line.
622 end_command     
623 separate_commands
624 newline         \n (first)
625
626 start_document
627 document        docu
628 newline         \n (DOCUMENT)
629
630 document        first.paragraph
631 newline         \n (DOCUMENT)
632
633 document        isn't_parsed_as_tokens
634 newline         \n (DOCUMENT)
635
636 document
637 newline         \n (DOCUMENT)
638
639 document        second_paragraph.
640 end_command     
641 separate_commands
642 newline         \n (first)
643  
644 end             <U+0000>
645 ])
646 PSPP_CHECK_SEGMENT([-i])
647 AT_CLEANUP
648 \f
649 AT_SETUP([TITLE, SUBTITLE, FILE LABEL commands])
650 AT_KEYWORDS([segment])
651 AT_DATA([input], [dnl
652 title/**/'Quoted string title'.
653 tit /*
654 "Quoted string on second line".
655 sub "Quoted string subtitle"
656  .
657
658 TITL /* Not a */ quoted string title.
659 SUBT Not a quoted string /* subtitle
660
661 FIL label isn't quoted.
662 FILE
663   lab 'is quoted'.
664 FILE /*
665 /**/  lab not quoted here either
666
667 ])
668 AT_DATA([expout], [dnl
669 identifier      title
670 comment         /**/
671 quoted_string   'Quoted_string_title'
672 end_command     .
673 newline         \n (first)
674
675 identifier      tit    space
676 comment         /*
677 newline         \n (later)
678
679 quoted_string   "Quoted_string_on_second_line"
680 end_command     .
681 newline         \n (first)
682
683 identifier      sub    space
684 quoted_string   "Quoted_string_subtitle"
685 newline         \n (later)
686     space
687 end_command     .
688 newline         \n (first)
689
690 separate_commands
691 newline         \n (first)
692
693 identifier      TITL    space
694 unquoted_string /*_Not_a_*/_quoted_string_title
695 end_command     .
696 newline         \n (first)
697
698 identifier      SUBT    space
699 unquoted_string Not_a_quoted_string_/*_subtitle
700 newline         \n (later)
701
702 separate_commands
703 newline         \n (first)
704
705 identifier      FIL    space
706 identifier      label    space
707 unquoted_string isn't_quoted
708 end_command     .
709 newline         \n (first)
710
711 identifier      FILE
712 newline         \n (later)
713
714 spaces          __
715 identifier      lab    space
716 quoted_string   'is_quoted'
717 end_command     .
718 newline         \n (first)
719
720 identifier      FILE    space
721 comment         /*
722 newline         \n (later)
723
724 comment         /**/
725 spaces          __
726 identifier      lab    space
727 unquoted_string not_quoted_here_either
728 newline         \n (later)
729
730 separate_commands
731 newline         \n (first)
732
733 end             <U+0000>
734 ])
735 PSPP_CHECK_SEGMENT([-i])
736 AT_CLEANUP
737 \f
738 AT_SETUP([BEGIN DATA command])
739 AT_KEYWORDS([segment])
740 AT_DATA([input], [dnl
741 begin data.
742 end data.
743
744 begin data. /*
745 123
746 xxx
747 end data.
748
749 BEG /**/ DAT /*
750 5 6 7 /* x
751
752 end  data
753 end data
754 .
755
756 begin
757  data.
758 data
759 end data.
760
761 begin data "xxx".
762 begin data 123.
763 not data
764 ])
765 AT_DATA([expout], [dnl
766 identifier      begin    space
767 identifier      data
768 end_command     .
769 newline         \n (data)
770
771 identifier      end    space
772 identifier      data
773 end_command     .
774 newline         \n (first)
775
776 separate_commands
777 newline         \n (first)
778
779 identifier      begin    space
780 identifier      data
781 end_command     .    space
782 comment         /*
783 newline         \n (data)
784
785 inline_data     123
786 newline         \n (data)
787
788 inline_data     xxx
789 newline         \n (data)
790
791 identifier      end    space
792 identifier      data
793 end_command     .
794 newline         \n (first)
795
796 separate_commands
797 newline         \n (first)
798
799 identifier      BEG    space
800 comment         /**/    space
801 identifier      DAT    space
802 comment         /*
803 newline         \n (data)
804
805 inline_data     5_6_7_/*_x
806 newline         \n (data)
807
808 inline_data     
809 newline         \n (data)
810
811 inline_data     end__data
812 newline         \n (data)
813
814 identifier      end    space
815 identifier      data
816 newline         \n (later)
817
818 start_command   .
819 newline         \n (first)
820
821 separate_commands
822 newline         \n (first)
823
824 identifier      begin
825 newline         \n (later)
826     space
827 identifier      data
828 end_command     .
829 newline         \n (data)
830
831 inline_data     data
832 newline         \n (data)
833
834 identifier      end    space
835 identifier      data
836 end_command     .
837 newline         \n (first)
838
839 separate_commands
840 newline         \n (first)
841
842 identifier      begin    space
843 identifier      data    space
844 quoted_string   "xxx"
845 end_command     .
846 newline         \n (first)
847
848 identifier      begin    space
849 identifier      data    space
850 number          123
851 end_command     .
852 newline         \n (first)
853
854 reserved_word   not    space
855 identifier      data
856 newline         \n (later)
857
858 end             <U+0000>
859 ])
860 PSPP_CHECK_SEGMENT([-i])
861 AT_CLEANUP
862 \f
863 AT_SETUP([DO REPEAT command])
864 AT_KEYWORDS([segment])
865 AT_DATA([input], [dnl
866 do repeat x=a b c
867           y=d e f.
868   do repeat a=1 thru 5.
869 another command.
870 second command
871 + third command.
872 end /* x */ /* y */ repeat print.
873 end
874  repeat.
875 do
876   repeat #a=1.
877   inner command.
878 end repeat.
879 ])
880 AT_DATA([expout], [dnl
881 identifier      do    space
882 identifier      repeat    space
883 identifier      x
884 punct           =
885 identifier      a    space
886 identifier      b    space
887 identifier      c
888 newline         \n (later)
889
890 spaces          __________
891 identifier      y
892 punct           =
893 identifier      d    space
894 identifier      e    space
895 identifier      f
896 end_command     .
897 newline         \n (DO REPEAT)
898
899 do_repeat_command __do_repeat_a=1_thru_5.
900 newline         \n (DO REPEAT)
901
902 do_repeat_command another_command.
903 newline         \n (DO REPEAT)
904
905 do_repeat_command second_command
906 newline         \n (DO REPEAT)
907
908 do_repeat_command +_third_command.
909 newline         \n (DO REPEAT)
910
911 do_repeat_command end_/*_x_*/_/*_y_*/_repeat_print.
912 newline         \n (DO REPEAT)
913
914 identifier      end
915 newline         \n (later)
916     space
917 identifier      repeat
918 end_command     .
919 newline         \n (first)
920
921 identifier      do
922 newline         \n (later)
923
924 spaces          __
925 identifier      repeat    space
926 identifier      #a
927 punct           =
928 number          1
929 end_command     .
930 newline         \n (DO REPEAT)
931
932 do_repeat_command __inner_command.
933 newline         \n (DO REPEAT)
934
935 identifier      end    space
936 identifier      repeat
937 end_command     .
938 newline         \n (first)
939
940 end             <U+0000>
941 ])
942 PSPP_CHECK_SEGMENT([-i])
943 AT_CLEANUP
944 \f
945 AT_SETUP([batch mode])
946 AT_KEYWORDS([segment])
947 AT_DATA([input], [dnl
948 first command
949      another line of first command
950 +  second command
951 third command
952
953 fourth command.
954    fifth command.
955 ])
956 AT_DATA([expout], [dnl
957 identifier      first    space
958 identifier      command
959 newline         \n (later)
960
961 spaces          _____
962 identifier      another    space
963 identifier      line    space
964 identifier      of    space
965 identifier      first    space
966 identifier      command
967 newline         \n (later)
968
969 start_command   +
970 spaces          __
971 identifier      second    space
972 identifier      command
973 newline         \n (later)
974
975 start_command
976 identifier      third    space
977 identifier      command
978 newline         \n (later)
979
980 separate_commands
981 newline         \n (first)
982
983 identifier      fourth    space
984 identifier      command
985 end_command     .
986 newline         \n (first)
987
988 spaces          ___
989 identifier      fifth    space
990 identifier      command
991 end_command     .
992 newline         \n (first)
993
994 end             <U+0000>
995 ])
996 PSPP_CHECK_SEGMENT([-b])
997 AT_CLEANUP
998 \f
999 AT_SETUP([auto mode])
1000 AT_KEYWORDS([segment])
1001 AT_DATA([input], [dnl
1002 command
1003      another line of command
1004 2sls
1005 +  another command
1006 another line of second command
1007 data list /x 1
1008 aggregate.
1009 print eject.
1010 twostep cluster
1011
1012
1013 fourth command.
1014    fifth command.
1015 ])
1016 AT_DATA([expout], [dnl
1017 identifier      command
1018 newline         \n (later)
1019
1020 spaces          _____
1021 identifier      another    space
1022 identifier      line    space
1023 identifier      of    space
1024 identifier      command
1025 newline         \n (later)
1026
1027 start_command
1028 number          2
1029 identifier      sls
1030 newline         \n (later)
1031
1032 start_command   +
1033 spaces          __
1034 identifier      another    space
1035 identifier      command
1036 newline         \n (later)
1037
1038 identifier      another    space
1039 identifier      line    space
1040 identifier      of    space
1041 identifier      second    space
1042 identifier      command
1043 newline         \n (later)
1044
1045 start_command
1046 identifier      data    space
1047 identifier      list    space
1048 punct           /
1049 identifier      x    space
1050 number          1
1051 newline         \n (later)
1052
1053 start_command
1054 identifier      aggregate
1055 end_command     .
1056 newline         \n (first)
1057
1058 identifier      print    space
1059 identifier      eject
1060 end_command     .
1061 newline         \n (first)
1062
1063 identifier      twostep    space
1064 identifier      cluster
1065 newline         \n (later)
1066
1067 separate_commands
1068 newline         \n (first)
1069
1070 separate_commands
1071 newline         \n (first)
1072
1073 identifier      fourth    space
1074 identifier      command
1075 end_command     .
1076 newline         \n (first)
1077
1078 spaces          ___
1079 identifier      fifth    space
1080 identifier      command
1081 end_command     .
1082 newline         \n (first)
1083
1084 end             <U+0000>
1085 ])
1086 PSPP_CHECK_SEGMENT([-a])
1087 AT_CLEANUP