Skip to content

Commit

Permalink
Smalltalk: Allowed empty strings and comments (#1747)
Browse files Browse the repository at this point in the history
This fixes that empty strings and comments were not recognized in Smalltalk.
  • Loading branch information
RunDevelopment authored Feb 28, 2019
1 parent 7bcec58 commit 5fd7577
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions components/prism-smalltalk.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Prism.languages.smalltalk = {
'comment': /"(?:""|[^"])+"/,
'string': /'(?:''|[^'])+'/,
'comment': /"(?:""|[^"])*"/,
'string': /'(?:''|[^'])*'/,
'symbol': /#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,
'block-arguments': {
pattern: /(\[\s*):[^\[|]*\|/,
Expand Down Expand Up @@ -28,4 +28,4 @@ Prism.languages.smalltalk = {
],
'operator': /[<=]=?|:=|~[~=]|\/\/?|\\\\|>[>=]?|[!^+\-*&|,@]/,
'punctuation': /[.;:?\[\](){}]/
};
};
2 changes: 1 addition & 1 deletion components/prism-smalltalk.min.js

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

6 changes: 4 additions & 2 deletions tests/languages/smalltalk/comment_feature.test
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
"foobar"
"foo""bar
baz"
""

----------------------------------------------------

[
["comment", "\"foobar\""],
["comment", "\"foo\"\"bar\r\nbaz\""]
["comment", "\"foo\"\"bar\r\nbaz\""],
["comment", "\"\""]
]

----------------------------------------------------

Checks for comments.
Checks for comments.
6 changes: 4 additions & 2 deletions tests/languages/smalltalk/string_feature.test
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
'foobar'
'foo''bar
baz'
''

----------------------------------------------------

[
["string", "'foobar'"],
["string", "'foo''bar\r\nbaz'"]
["string", "'foo''bar\r\nbaz'"],
["string", "''"]
]

----------------------------------------------------

Checks for strings.
Checks for strings.

0 comments on commit 5fd7577

Please sign in to comment.