Skip to content

Commit

Permalink
Make single # on a line recognized as CommentSingle
Browse files Browse the repository at this point in the history
Fixes #318
  • Loading branch information
apexskier authored and alecthomas committed May 11, 2020
1 parent 8c4fe7e commit ec5955f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lexers/b/bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var Bash = internal.Register(MustNewLexer(
{`\b(if|fi|else|while|do|done|for|then|return|function|case|select|continue|until|esac|elif)(\s*)\b`, ByGroups(Keyword, Text), nil},
{"\\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|time|times|trap|true|type|typeset|ulimit|umask|unalias|unset|wait)(?=[\\s)`])", NameBuiltin, nil},
{`\A#!.+\n`, CommentPreproc, nil},
{`#.*\S`, CommentSingle, nil},
{`#.*(\S|$)`, CommentSingle, nil},
{`\\[\w\W]`, LiteralStringEscape, nil},
{`(\b\w+)(\s*)(\+?=)`, ByGroups(NameVariable, Text, Operator), nil},
{`[\[\]{}()=]`, Operator, nil},
Expand Down

0 comments on commit ec5955f

Please sign in to comment.