Skip to content

Commit

Permalink
Implement stricter parsing #141 : release
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Oct 8, 2023
1 parent 43aef2c commit 5ee9da0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
8 changes: 4 additions & 4 deletions coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions makesure
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ function checkBeforeRun(i,j,dep,depCnt,goalName){
addError("Goal " quote2(goalName,1)" uses unknown lib '\''" GoalToLib[goalName] "'\''",UseLibLineNo[goalName])}}
function getPreludeCode(a,k){
addLine(a,MyDirScript)
for(k in Vars){
addLine(a,k "=" quoteArg(Vars[k])";export " k)}
for(k in Vars)
addLine(a,k "=" quoteArg(Vars[k])";export " k)
return a[0]}
function doWork(\
i,goalName,gnLen,gnMaxLen,reachedGoals,emptyGoals,preludeCode,
Expand Down Expand Up @@ -470,8 +470,8 @@ function instantiate(goal,args,newArgs,i,j,depArg,depArgType,dep,goalNameInstant
function instantiateGoalName(goal,args,res,cnt,i){
if((cnt=GoalParamsCnt[goal])==0)return goal
res=goal
for(i=0;i<cnt;i++){
res=res "@" args[GoalParams[goal,i]]}
for(i=0;i<cnt;i++)
res=res "@" args[GoalParams[goal,i]]
return res}
function currentTimeMillis(res){
if(Gawk)
Expand Down Expand Up @@ -625,6 +625,10 @@ function reparseCli(res,i,err){
for(i=NF=0;i in res;i++){
$(++NF)=res[i]
Quotes[NF]=res[i,"quote"]}
for(i=2;i<=NF;i++)
if("\""==Quotes[i]&&!("@define"==$1&&3==i||"@depends_on"==$1&&"@args"==$3&&i>3)){
addError("Wrong quoting: " $i)
return -1}
return 0}
function quote2(s,force){
if(index(s,"'\''")){
Expand Down
12 changes: 8 additions & 4 deletions makesure_candidate
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ function checkBeforeRun(i,j,dep,depCnt,goalName){
addError("Goal " quote2(goalName,1)" uses unknown lib '\''" GoalToLib[goalName] "'\''",UseLibLineNo[goalName])}}
function getPreludeCode(a,k){
addLine(a,MyDirScript)
for(k in Vars){
addLine(a,k "=" quoteArg(Vars[k])";export " k)}
for(k in Vars)
addLine(a,k "=" quoteArg(Vars[k])";export " k)
return a[0]}
function doWork(\
i,goalName,gnLen,gnMaxLen,reachedGoals,emptyGoals,preludeCode,
Expand Down Expand Up @@ -470,8 +470,8 @@ function instantiate(goal,args,newArgs,i,j,depArg,depArgType,dep,goalNameInstant
function instantiateGoalName(goal,args,res,cnt,i){
if((cnt=GoalParamsCnt[goal])==0)return goal
res=goal
for(i=0;i<cnt;i++){
res=res "@" args[GoalParams[goal,i]]}
for(i=0;i<cnt;i++)
res=res "@" args[GoalParams[goal,i]]
return res}
function currentTimeMillis(res){
if(Gawk)
Expand Down Expand Up @@ -625,6 +625,10 @@ function reparseCli(res,i,err){
for(i=NF=0;i in res;i++){
$(++NF)=res[i]
Quotes[NF]=res[i,"quote"]}
for(i=2;i<=NF;i++)
if("\""==Quotes[i]&&!("@define"==$1&&3==i||"@depends_on"==$1&&"@args"==$3&&i>3)){
addError("Wrong quoting: " $i)
return -1}
return 0}
function quote2(s,force){
if(index(s,"'\''")){
Expand Down

0 comments on commit 5ee9da0

Please sign in to comment.