Skip to content

fix: crash with square-bracketed names (#1) #3

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions forcer/forcer-aux.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2);

#do toponame={`?topolist'}
#if `HASTOPO`toponame''
L `NAME'`toponame' = `NAME'[M`toponame'] * M`toponame';
L [`NAME'`toponame'] = `NAME'[M`toponame'] * M`toponame';
#ifdef `FORCERSTATS'
* NOTE: Computing the complexity of integrals based on the difference of
* indices to Z(1,...,1,0,...,0) requires information of each topology (the
Expand All @@ -166,7 +166,7 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2);
ModuleOption noparallel;
.sort:begin `toponame';
#ifdef `ALLTIMING'
#$`oldn' = termsin_(`NAME'`toponame');
#$`oldn' = termsin_([`NAME'`toponame']);
#endif
#ifdef `FORCERSTATS'
#if `$`prefix'minindex' != 9999
Expand All @@ -180,11 +180,11 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2);
#endif
#call AfterReduce(`toponame')
#if `HASTOPO`toponame''
Hide `NAME'`toponame';
Hide [`NAME'`toponame'];
#redefine processedtopolist "`processedtopolist',`toponame'"
#ifdef `ALLTIMING'
#if `timer_' >= `MINTIME'
#$`n' = termsin_(`NAME'`toponame');
#$`n' = termsin_([`NAME'`toponame']);
#write <`NAME'.time> "\t {`timer_'/1000} sec. spent reducing `toponame' (`$`oldn'' -> `$`n'' terms)"
#endif
#reset timer
Expand All @@ -199,18 +199,18 @@ NTable,sparse,OneFill,`PREFIX'dotmaptabl(2);
`NAME',
#do toponame={`processedtopolist'}
#ifdef `toponame'
`NAME'`toponame',
[`NAME'`toponame'],
#endif
#enddo
;
L `NAME'tmp = `NAME'[1]
L [`NAME'tmp] = `NAME'[1]
#do toponame={`processedtopolist'}
#ifdef `toponame'
+ `NAME'`toponame'
+ [`NAME'`toponame']
#endif
#enddo
;
#exchange `NAME',`NAME'tmp
#exchange `NAME',[`NAME'tmp]
AB+ rat;
ModuleOption noparallel;
.sort:term merge with `nedge' edges;
Expand Down
16 changes: 8 additions & 8 deletions forcer/forcer-rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ endrepeat;
* if we know the name of the input, merge all expressions
.sort:Merge spectator `TOPO';
#ifdef `NAME'
Drop `NAME'`TOPO',F`TOPO'res;
L `NAME'tmp = `NAME'`TOPO' + F`TOPO'res;
#exchange `NAME'`TOPO',`NAME'tmp
Drop [`NAME'`TOPO'],F`TOPO'res;
L [`NAME'tmp] = [`NAME'`TOPO'] + F`TOPO'res;
#exchange [`NAME'`TOPO'],[`NAME'tmp]
ModuleOption noparallel;
.sort:spectator merge `TOPO';
#endif
Expand Down Expand Up @@ -4631,7 +4631,7 @@ label 2;
* the non-integer parts of indices are understood by `TOPO'.
*
* NOTE: Because of the current usage of spectators, the active expression must
* have a name `NAME'`TOPO'.
* have a name [`NAME'`TOPO'].
*
#procedure ReduceImpl2(TOPO,Z,N)
#define Y "Y"
Expand All @@ -4654,11 +4654,11 @@ label 2;
#endswitch
#ifndef `NOSPECTATORS'
.sort:`TOPO'-pre_from_spectator;
#call FromSpectator(x`TOPO',`NAME'`TOPO'res,`NAME'`TOPO'res,`Y')
#call FromSpectator(x`TOPO',[`NAME'`TOPO']res,[`NAME'`TOPO']res,`Y')
.sort:`TOPO'-from_spectator;
Drop `NAME'`TOPO',`NAME'`TOPO'res;
L `NAME'tmp = `NAME'`TOPO' + `NAME'`TOPO'res;
#exchange `NAME'`TOPO',`NAME'tmp
Drop [`NAME'`TOPO'],[`NAME'`TOPO']res;
L [`NAME'tmp] = [`NAME'`TOPO'] + [`NAME'`TOPO']res;
#exchange [`NAME'`TOPO'],[`NAME'tmp]
ModuleOption noparallel;
.sort:`TOPO'-merge_spectator;
#endif
Expand Down