Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Fixed so namespaces syntax works on same lime as <?php #73

Merged
merged 10 commits into from
May 14, 2015
Merged

Fixed so namespaces syntax works on same lime as <?php #73

merged 10 commits into from
May 14, 2015

Conversation

frozzare
Copy link
Contributor

This pull request will fix #29

@winstliu
Copy link
Contributor

Please add some specs to this.

@frozzare
Copy link
Contributor Author

Added test for namespace on same line and on a separate line.

@@ -721,9 +721,9 @@
]
}
{
'begin': '(?i)^\\s*(namespace)\\b\\s+(?=([a-z0-9_\\\\]+\\s*($|[;{]|(\\/[\\/*])))|$)'
'begin': '(?i)(^\\s*|\\s)(namespace)\\b\\s+(?=([a-z0-9_\\\\]+\\s*($|[;{]|(\\/[\\/*])))|$)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be \\s* so that something like

<?php          namespace superCoolNamespace

will work?

In addition, it looks like you can change that part to a non-capturing group, eg (?:^\\s*|\\s*) so that you don't have to change the capture group on L726.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to \\s* but it did work with \\s. Fixed so it's a non-capturing group.

frozzare and others added 4 commits May 14, 2015 15:18
…e-29

* 'issue-29' of github.com:frozzare/language-php:
  Fixed typo
  Added test for namespace on own line
  Added test for namespace on same line
  Fixed so namespaces syntax works on same lime as <?php
@winstliu
Copy link
Contributor

Looks like you accidentally included some changes from #72 into this PR-could you please remove them?
Other than that, looks good to me!

@frozzare
Copy link
Contributor Author

Oops, sorry for that. Fixed now.

winstliu pushed a commit that referenced this pull request May 14, 2015
Fixed so namespaces syntax works on same lime as <?php
@winstliu winstliu merged commit 955dcf3 into atom:master May 14, 2015
@winstliu
Copy link
Contributor

Thanks for this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'namespace' does not have correct classes for color coding when on same line as <?php
2 participants