Skip to content

Commit

Permalink
Code/Compile pragmas in SyntaxTrees
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasguts committed Mar 21, 2019
1 parent bef6845 commit e9ac628
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/syntaxtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,12 @@ static Obj SyntaxTreeFunc(Obj result, Obj func)
return result;
}

static Obj SyntaxTreeCompilePragma(Obj result, Stat stat){
Obj message = GET_VALUE_FROM_CURRENT_BODY( READ_EXPR(stat, 0) );
AssPRec(result, RNamName("value"), message);
return result;
}

static UInt SyntaxTreeCodeFunc_Internal(Obj node)
{
Int narg = INT_INTOBJ(ELM_REC(node, RNamName("narg")));
Expand Down Expand Up @@ -695,6 +701,7 @@ static const CompilerT Compilers[] = {
COMPILER_(T_LIST_TILDE_EXPR, ARGS("list")),
COMPILER(T_RANGE_EXPR, SyntaxTreeRangeExpr, SyntaxTreeCodeRangeExpr),
COMPILER(T_STRING_EXPR, SyntaxTreeEvalCompiler, SyntaxTreeCodeValue),
COMPILER(T_PRAGMA,SyntaxTreeCompilePragma,SyntaxTreeCodeValue),
COMPILER(T_REC_EXPR, SyntaxTreeRecExpr, SyntaxTreeCodeRecExpr),
COMPILER_(T_REC_TILDE_EXPR),

Expand Down

0 comments on commit e9ac628

Please sign in to comment.