@@ -790,7 +790,7 @@ fn test_manuscript_with_origin() {
790790 SourceFile {
791791 punch: None ,
792792 blocks: vec![ ManuscriptBlock {
793- origin: Some ( Origin :: Literal ( span( 0 ..3 ) , Address :: new( u18!( 0o100 ) ) ) ) ,
793+ origin: Some ( Origin :: Literal ( span( 0 ..5 ) , Address :: new( u18!( 0o100 ) ) ) ) ,
794794 statements: vec![ TaggedProgramInstruction :: single(
795795 notags( ) ,
796796 HoldBit :: Unspecified ,
@@ -1172,7 +1172,7 @@ fn test_assignment_origin() {
11721172 SourceFile {
11731173 punch: None ,
11741174 blocks: vec![ ManuscriptBlock {
1175- origin: Some ( Origin :: Literal ( span( 9 ..13 ) , Address :: new( u18!( 0o1000 ) ) ) ) ,
1175+ origin: Some ( Origin :: Literal ( span( 9 ..14 ) , Address :: new( u18!( 0o1000 ) ) ) ) ,
11761176 statements: vec![ TaggedProgramInstruction :: single(
11771177 Vec :: new( ) ,
11781178 HoldBit :: Unspecified ,
@@ -1192,6 +1192,35 @@ fn test_assignment_origin() {
11921192 ) ;
11931193}
11941194
1195+ #[ test]
1196+ fn test_symbolic_origin ( ) {
1197+ const INPUT : & str = concat ! ( "BEGIN|2\n " , ) ;
1198+ let tree = parse_successfully_with ( INPUT , source_file ( ) , no_state_setup) ;
1199+ assert_eq ! (
1200+ tree,
1201+ SourceFile {
1202+ punch: None ,
1203+ blocks: vec![ ManuscriptBlock {
1204+ // One of the key things to check here is that the pipe
1205+ // symbol is included in the origin's span. We do
1206+ // this in order to include the pipe symbol in the
1207+ // output listing.
1208+ origin: Some ( Origin :: Symbolic ( span( 0 ..6 ) , SymbolName :: from( "BEGIN" ) ) ) ,
1209+ statements: vec![ TaggedProgramInstruction :: single(
1210+ Vec :: new( ) ,
1211+ HoldBit :: Unspecified ,
1212+ span( 6 ..7 ) ,
1213+ span( 6 ..7 ) ,
1214+ InstructionFragment :: from( ( span( 6 ..7 ) , Script :: Normal , u36!( 2 ) , ) )
1215+ ) ]
1216+ . into( ) ,
1217+ } ] ,
1218+ equalities: Default :: default ( ) ,
1219+ macros: Default :: default ( ) ,
1220+ }
1221+ ) ;
1222+ }
1223+
11951224#[ test]
11961225fn test_metacommand_decimal ( ) {
11971226 assert_eq ! (
0 commit comments