summaryrefslogtreecommitdiff
path: root/colm/lmparse.kl
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2011-07-09 18:12:34 +0000
committerAdrian Thurston <thurston@complang.org>2011-07-09 18:12:34 +0000
commita1e21f719d4b7e47af1ec0821a74b62a1e7333f8 (patch)
tree9ec117e4d8a6f2204ebcb24b7fc32dc19b4695b6 /colm/lmparse.kl
parent1d74b3e3da47dccf0e8c3157b6d3f2be0c1b157c (diff)
downloadcolm-a1e21f719d4b7e47af1ec0821a74b62a1e7333f8.tar.gz
Fixed the precedence setting, which was broken since the recent improvements to
the decl/resolv passes. Added the (partial) ruby grammar to the test suite. There are no inputs, just makes sure it compiles.
Diffstat (limited to 'colm/lmparse.kl')
-rw-r--r--colm/lmparse.kl20
1 files changed, 9 insertions, 11 deletions
diff --git a/colm/lmparse.kl b/colm/lmparse.kl
index 218cd73c..706cd3bc 100644
--- a/colm/lmparse.kl
+++ b/colm/lmparse.kl
@@ -270,15 +270,9 @@ pred_type: KW_Nonassoc final { predType = PredNonassoc; };
pred_token_list: pred_token_list ',' pred_token
final {
- $3->factor->langEl->predType = predType;
- $3->factor->langEl->predValue = pd->predValue;
};
-pred_token_list: pred_token
- final {
- $1->factor->langEl->predType = predType;
- $1->factor->langEl->predValue = pd->predValue;
- };
+pred_token_list: pred_token;
nonterm pred_token
{
@@ -289,16 +283,20 @@ nonterm pred_token
pred_token:
region_qual TK_Word
final {
- $$->factor = new ProdEl( ProdEl::ReferenceType, $2->loc, false, 0, 0 );
- pd->resolveFactor( $$->factor );
+ TypeRef *typeRef = new TypeRef( $2->loc, $1->nspaceQual, $2->data );
+
+ PredDecl *predDecl = new PredDecl( typeRef, predType, pd->predValue );
+ pd->predDeclList.append( predDecl );
};
pred_token:
region_qual TK_Literal
final {
PdaLiteral *literal = new PdaLiteral( $2->loc, *$2 );
- $$->factor = new ProdEl( ProdEl::LiteralType, $2->loc, false, 0, 0 );
- pd->resolveFactor( $$->factor );
+ TypeRef *typeRef = new TypeRef( $2->loc, $1->nspaceQual, literal );
+
+ PredDecl *predDecl = new PredDecl( typeRef, predType, pd->predValue );
+ pd->predDeclList.append( predDecl );
};
cfl_def: cfl_def_head obj_var_list properties_list cfl_prod_list