Skip to content

Commit 5fd7577

Browse files
Smalltalk: Allowed empty strings and comments (#1747)
This fixes that empty strings and comments were not recognized in Smalltalk.
1 parent 7bcec58 commit 5fd7577

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

components/prism-smalltalk.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Prism.languages.smalltalk = {
2-
'comment': /"(?:""|[^"])+"/,
3-
'string': /'(?:''|[^'])+'/,
2+
'comment': /"(?:""|[^"])*"/,
3+
'string': /'(?:''|[^'])*'/,
44
'symbol': /#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,
55
'block-arguments': {
66
pattern: /(\[\s*):[^\[|]*\|/,
@@ -28,4 +28,4 @@ Prism.languages.smalltalk = {
2828
],
2929
'operator': /[<=]=?|:=|~[~=]|\/\/?|\\\\|>[>=]?|[!^+\-*&|,@]/,
3030
'punctuation': /[.;:?\[\](){}]/
31-
};
31+
};

components/prism-smalltalk.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
"foobar"
22
"foo""bar
33
baz"
4+
""
45

56
----------------------------------------------------
67

78
[
89
["comment", "\"foobar\""],
9-
["comment", "\"foo\"\"bar\r\nbaz\""]
10+
["comment", "\"foo\"\"bar\r\nbaz\""],
11+
["comment", "\"\""]
1012
]
1113

1214
----------------------------------------------------
1315

14-
Checks for comments.
16+
Checks for comments.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
'foobar'
22
'foo''bar
33
baz'
4+
''
45

56
----------------------------------------------------
67

78
[
89
["string", "'foobar'"],
9-
["string", "'foo''bar\r\nbaz'"]
10+
["string", "'foo''bar\r\nbaz'"],
11+
["string", "''"]
1012
]
1113

1214
----------------------------------------------------
1315

14-
Checks for strings.
16+
Checks for strings.

0 commit comments

Comments
 (0)