Skip to content

Commit d68db8a

Browse files
committed
[ narc ] Some parser fixes
1 parent 2ad82fb commit d68db8a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

grammar/narc.bnf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ expr ::=
4040

4141
private telescopic ::= telescopicExpr | telescopic2Expr
4242

43-
project ::= DOT nameUsage { pin=1 }
43+
projectOp ::= DOT nameUsage { pin=1 }
4444

45-
projectExpr ::= expr project
45+
projectExpr ::= expr projectOp
4646
piExpr ::= expr ARROW expr
4747
telescopic2Expr ::= LBRACE nameDecl+ COLON expr RBRACE {
48-
pin=1
48+
pin=3
4949
}
5050
telescopicExpr ::= LPAREN nameDecl+ COLON expr RPAREN {
5151
pin=3
@@ -76,7 +76,7 @@ constructor ::= KW_CONSTRUCTOR nameDecl sig? SEMI {
7676
pin=1
7777
}
7878

79-
copattern ::= project | pattern
79+
copattern ::= projectOp | pattern
8080
pattern ::= nameDecl | inaccessiblePattern | consPattern
8181

8282
inaccessiblePattern ::= LINACCESS expr RINACCESS { pin=1 }

res/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@
194194
<lang.commenter language="Narc" implementationClass="org.ice1000.tt.editing.CxxLineCommenter"/>
195195
<lang.braceMatcher language="Narc" implementationClass="org.ice1000.tt.editing.narc.NarcBraceMatcher"/>
196196
<lang.syntaxHighlighterFactory language="Narc" implementationClass="org.ice1000.tt.editing.narc.NarcHighlighterFactory"/>
197+
<lang.parserDefinition language="Narc" implementationClass="org.ice1000.tt.psi.narc.NarcGeneratedParserDefinition"/>
197198

198199
<projectConfigurable
199200
groupId="language"

res/fileTemplates/internal/Narc File.narc.ft

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
// Author: ${USER}
55
//
66

7-
// TODO: there's no syntax designed yet
7+
definition ${NAME_CAMEL} : Type;
8+
clause ${NAME_CAMEL} : _;

0 commit comments

Comments
 (0)