Skip to content

Commit

Permalink
fix comment inside interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
OsamaSBCrea committed Dec 22, 2023
1 parent 57a5064 commit 1b6ee40
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dist/index.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@relationalai/codemirror-lang-rel",
"version": "0.3.1",
"version": "0.3.2",
"description": "CodeMirror 6 language support for Rel",
"scripts": {
"test": "mocha test/test.js",
Expand Down
4 changes: 2 additions & 2 deletions src/parser.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/syntax.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ formalsParen { "(" Formals? ")" }
LineComment { "//" ![\n]* }
BlockComment { "/*" ( ![*] | "*"+ ![/*] )* "*"+ "/" }

@precedence { spaces newLine BlockComment LineComment DocstringLiteral staticStringPart }
@precedence { spaces newLine BlockComment LineComment MultilineDocstringLiteral staticMultilineStringPart }
@precedence { spaces newLine staticStringPart BlockComment LineComment DocstringLiteral }
@precedence { spaces newLine staticMultilineStringPart BlockComment LineComment MultilineDocstringLiteral }
@precedence { DateTimeLiteral DateLiteral FloatLiteral IntLiteral }
@precedence { BooleanLiteral BasicId }
@precedence { ConstructorId Operator }
Expand Down
5 changes: 5 additions & 0 deletions test/Expressions.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ Rel(

# Interpolation
def output = """
// A single comment
/***
A block comment
***/
%(
string_join["\n", {
"""
// Comment in a string
def n[x] = %(
x + 1
)
Expand Down
2 changes: 1 addition & 1 deletion test/Literals.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Rel(

def a = "A string with \"double\" and 'single' quotes"
def b = """A Multi-line string
New line
New line // with a comment in a string
"""
def c = 'A'
def d = raw"""""""
Expand Down
2 changes: 1 addition & 1 deletion test/Prelude.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Rel(
# DocStrings


doc"A single-line docstring"
doc"A single-line docstring // with a comment"
def a = 1

doc"""
Expand Down

0 comments on commit 1b6ee40

Please sign in to comment.