text:
Masculinity Among Indonesian Militants
CO21141 | Masculinity Among Indonesian Militants
Noor Huda Ismail
The path into and out of extremism is influenced by various factors. One under-researched factor is the role of masculinity ─ how manhood and its accompanying sense of perceived responsibility drive individuals to resort to violence. How valid is this argument?
Source: pxhere
INDONESIAN MILITANTS often frame their participation in violent groups like Jamaah Islamiyah (JI) or Jamaah Ansharut Daulah (JAD) in masculine tropes ─ as protectors, warriors, or brothers. Such 'masculinity' often drives them towards a sense of perceived responsibility to defend the ummah.
At the same time, their pathways out of violent groups are also defined by their ability to recraft and negotiate their new masculinity to one that is less toxic in society. Existing work on radicalisation and de-radicalisation will not be sufficient without seriously considering the role of masculinity. One way to further understand the possible relationship between masculinity and violent groups is to study the lived experiences of former or reformed militants.
The Case of Syahrul Munif
Syahrul Munif, 40, is a returned Indonesian IS fighter. His life history should not be taken to represent all experiences of Indonesian militants but to highlight how context shapes one's masculinity that eventually influences one to join and leave violent groups.
The selection of Syahrul from the network of Indonesian foreign fighters is due to its significance to the region and growing impact globally of Indonesian foreign fighters. They have fostered other violent movements across Southeast Asia (particularly in Malaysia, Singapore, and The Philippines), and have well-established networks originating from the Darul Islam (DI) rebellion in the mid-20th century.
Furthermore, Indonesian fighters have participated in conflicts across the globe ranging from Afghanistan in the 1980s to recent struggles in Syria. Many of them have now taken up new roles within violent networks in the region.
These include serving as military trainers, financiers, recruiters, advisors and even as participants in ongoing violence or attacks. Additionally, their previous experiences often enhance their capacity to commit acts of violence and can provide focal points for organising those who failed to do 'hijrah' to Syria ─ to join the jihad there.
No Radical History or Background
Unlike many Indonesian men who became foreign fighters, Syahrul does not come from a community with a strong JI influence. Instead, he was a member of the largest Islamic organisation, Nahdlatul Ulama (NU), in East Java that often adopts a principled position of moderation on issues. As a young man he was actively involved in NU, he felt constantly confronted by 'a glass ceiling' because he did not come from 'blue blood' NU family.
After graduating from high school, he went to a local university to study law. Through his passion for Islamic activism while studying between 2000 until 2004, he became a student leader. This activism gave him a sense of meaning and belonging as a man to a group that has social standing in the society.
Mingling with Islamic activists in Malang, East Java, allowed him to attend Islamic sermons at a local mosque by an ustad, Abu Bakar Ba'asyir, who was then the senior leader in Majelis Mujahidin Indonesia (MMI). This was a jihadi organisation led by Ba'asyir whose sermons deepened Syahrul's commitment to the Islamic cause.
When there was a split within MMI and Ba'asyir left to establish a new jihadi group called Jamaat Ansharut Tauhid (JAT), Syahrul followed. But Syahrul quickly left JAT because he did not see any 'concrete action' by JAT to respond the challenges faced by Muslims globally. As a man, he needed that 'action' partly to demonstrate one's commitment to Islam.
Need For 'Concrete Action'
After leaving JAT, Syahrul met with an IS recruiter, Abu Jandal, an Indonesian of Yemeni descent who offered him opportunities for 'concrete action'. "We must help our oppressed brothers and sisters. Moreover, you will get paid and can always come back home once the mission has been accomplished," Abu Jandal said. Syahrul was very motivated to go when the recruiter said he could always come home after the mission.
When Syahrul was in Syria with IS, he soon felt uncomfortable to see the brutality of the group. Although he had agreed with the idea of defending the oppressed, he was disillusioned by IS' broken promises and their unIslamic ways such as beheadings. More importantly, he also felt guilty about lying to his parents and wife regarding his departure to Syria.
This was something very emotional for him as he would have brought him to tears by it during the interview. After six months, Syahrul decided to travel back to Indonesia and then arrested by the Indonesian authority.
Recrafting and Negotiating Masculinity
Inside the prison, Syahrul reflected his harsh experience with IS that had seriously challenged his pre-existing ideas about masculinity as not emphasising violence. He admitted that when he became a student activist, he held hard-line religious ideals. But while he valorised men who could forward 'concrete action', it did not mean he championed violence. In this regard, understanding the subtle diversity of gendered performances of masculinity among the Indonesian militants is critical.
After three years in prison, Syahrul needed time to adapt back to normal life ─ his work, family, the local community, and Indonesian society. It was at this crucial time that he met Arif Tuban – a reformed convicted terrorist who was running a community website, www.ruangobrol.id.
Arif encouraged and provided an opportunity for Syahrul to become a guest speaker in various prevention activities, including with the national counter-terrorism agency. Arif also helped Syahrul to restore his reputation in the community by introducing him to the local police and involving him in joint deradicalisation assistance activities.
Need for Wider Research
In retrospect, Syahrul's commitment to the jihadi network came through a desire for leadership (which he did not find in NU) and the desire to do good (through humanitarian work). It also demonstrates that joining and leaving violent groups could be a highly gendered process.
Thus, without incorporating masculinity perspective such as acknowledging the struggles of men with social status, employment and the family, any work on radicalisation and deradicalisation will not be sufficient. But how valid is the argument that masculinity drives radicalism?
More research needs to be done to determine this conclusively. A larger number of participants in the research would in turn allow for more robust findings. The end result could be the potential to transform the traditional way of dealing with the issue of violent extremism not only in Indonesia but also in the region.
Noor Huda Ismail is Visiting Fellow at the S. Rajaratnam School of International Studies (RSIS), Nanyang Technological University, Singapore. He is also the founder of an award-winning community website, www.ruangobrol.id to amplify the role of credible voice of reformed terrorists in Indonesia.
Categories: Commentaries / Conflict and Stability / Country and Region Studies / International Politics and Security / Religion in Contemporary Society / East Asia and Asia Pacific / Global / South Asia / Southeast Asia and ASEAN
Categories: Commentaries / Conflict and Stability / Country and Region Studies / International Politics and Security / Religion in Contemporary Society
The path into and out of extremism is influenced by various factors. One under-researched factor is the role of masculinity ─ how manhood and its a ...


text:
Q: Python Bokeh add a play button to a slider my following visualization needs a play button to automatically go through the values on the slider and loop when reaches the end. Is there a way to achieve that? Thanks.
The expacted outcome is like the graph on this link: https://demo.bokeh.org/gapminder
# Bokeh Visualisation (0.12.7)

from bokeh.charts import Scatter, output_file, show
from bokeh.plotting import figure, output_file, show, ColumnDataSource
from bokeh.io import output_file, show
from bokeh.layouts import layout, widgetbox, column, row
from bokeh.models import Toggle, BoxAnnotation, NumeralTickFormatter, CategoricalColorMapper
from bokeh.models import HoverTool
from bokeh.models.widgets import RadioButtonGroup, Slider
from bokeh.models.callbacks import CustomJS

dataset = {'x':[0,1,2],'y':[0,1,2], 'x_filter':[0,1,2]}

source2 = ColumnDataSource(data=dataset)

p2 = figure(plot_width=600, plot_height=600,
            x_range=(-5,50), y_range=(-5,10))

p2.scatter('x', 'y', source=source2,
          size=15,
          alpha=0.8,
          line_color=None)

p2.title.text = 'old title'

# add callback to control
callback = CustomJS(args=dict(p2=p2, source2=source2), code="""

            var slider_value = cb_obj.value;
            var data = source2.data;
            x = data['x']
            x_filter = data['x_filter']
            y = data['y']

            for (i = 0; i < x.length; i++) {
                x[i] = x_filter[i]+slider_value
            }

            p2.title.text = 'new title'

        source2.change.emit();

        """)

slider = Slider(start=0, end=50, value=0, step=5, title="test", callback=callback)

show(column(widgetbox(slider),p2))

A: You can find the codes of all the apps on the github of bokeh, here is the gapminder
https://github.com/bokeh/bokeh/blob/master/examples/app/gapminder/main.py
you are looking for that (that's using a bokeh server):
def animate_update():
    year = slider.value + 1
    if year > years[-1]:
        year = years[0]
    slider.value = year

def slider_update(attrname, old, new):
    year = slider.value
    label.text = str(year)
    source.data = data[year]

slider = Slider(start=years[0], end=years[-1], value=years[0], step=1, title="Year")
slider.on_change('value', slider_update)

def animate():
    if button.label == '► Play':
        button.label = '❚❚ Pause'
        curdoc().add_periodic_callback(animate_update, 200)
    else:
        button.label = '► Play'
        curdoc().remove_periodic_callback(animate_update)

button = Button(label='► Play', width=60)
button.on_click(animate)

redpajama_set_name: RedPajamaStackExchange


text:
gubernatorial elections
Beto O''RourkeElectionsEmerson College Poll
Abbott holds 10-point lead over O'Rourke in Texas: poll
georgiaGovernorgubernatorial elections
The biggest 2022 gubernatorial races
The midterms are only a month away, and all eyes are on Congress, where Democrats are battling to maintain control of both the House and the Senate. But a number of consequential contests are unfolding off Capitol Hill, too — gubernatorial match-ups, namely — and you won't want to miss a minute of 'em. To help catch you up, here is a look at where a few of the biggest gubernatorial races stand: Texas: Abbott v. O'Rourke Texas Gov. Greg Abbott (R) was initially favored to prevail against challenger Beto O'Rourke … and it seems he still is. Though his advantage has narrowed since the beginning of the year (per reporting from FiveThirtyEight), a Quinnipiac University poll released Sept. 28 estimates Abbott with a 7-point lead over his Democratic opponent. Intraparty support for each candidate is strong: 96 percent of Republicans back Abbott, and 96 percent of Democrats want O'Rourke. Among independents, however, "53 percent support Abbott, while 46 percent support O'Rourke." Further, almost all likely voters surveyed said they've made up their minds as to how they'll vote. "The race for the top job in Austin leans toward Abbott, who has very strong support from white Texans, particularly white men, while O'Rourke has overwhelming appeal among Black voters and strong support among young voters," explained Quinnipiac Polling Analyst Tim Malloy. Recent polling from the Texas Hispanic Policy Foundation supports Quinnipiac's findings — per its Sept. 25 report, Abbott holds a 7-point lead over O'Rourke. "Abbott enjoys a nearly two-to-one advantage over O 'Rourke among white voters (63 percent to 33 percent) and a 79 percent to 16 percent advantage among Black voters," the foundation detailed. "Support is more equal among Hispanic voters," 53 percent of whom "intend to vote for O'Rourke and 39 percent for Abbott." As of Sept. 30, RealClearPolitics also reported an 8-point polling average in favor of Abbott. For his part, O'Rourke is skeptical of the potentially-bad news: "I take these polls with a grain of salt," the nominee said last Saturday. Later, when asked if he regrets interrupting an Abbott-led press conference in the aftermath of May's Uvalde, Texas, school shooting, O'Rourke said no. "I wanted to fight for those families in Uvalde, for our families across the state. The best time to stop the next school shooting is right now," he explained. Immigration has also taken on newfound significance in the Texas race, after Abbott made headlines busing loads of migrants from the U.S.-Mexico border to Vice President Kamala Harris' residence in Washington, D.C. The governor has been relocating migrants since the spring, but his efforts drew renewed Democratic ire after Florida Gov. Ron DeSantis (R) followed his lead. Both governors' stunts were intended to protest the Biden administration's immigration policies. Per the Sept. 28 Quinnipiac poll, 51 percent of likely voters approve of Abbott's relocation efforts, while 47 percent disapprove. Quinnipiac University surveyed 1,327 likely Texas voters from Sept. 22-26. Results have a margin of error of +/- 2.7 percentage points. The Texas Hispanic Policy Foundation surveyed 1,172 likely Texas voters from Sept. 6-15. Results have a confidence interval of +/- 2.9 percentage points. Pennsylvania: Mastriano v. Shapiro How do you solve a problem like the Republican candidate for Pennsylvania governor, Doug Mastriano? For Democrats, you don't; instead, you spend millions to get him nominated, then pray his extremism sends voters running the other way — toward Democratic nominee Josh Shapiro. And at least for the time being, the left's risky gamble (known as the "pied piper" strategy) appears to be working. Not only is Shapiro outraising the former President Donald Trump-backed Mastriano eight to one, but "the Pennsylvania attorney general also significantly out-spent his Republican opponent in the last few months, using about $27.9 million of his massive war chest compared to Mastriano's less than $1 million in expenditures," The Hill writes. While Shapiro has roughly $11 million left to play with in the weeks leading up to Nov. 8, Mastriano has just about $2.6 million. Shapiro is also besting Mastriano in the polls, where he's enjoying — as of Sept. 30 — a roughly 10-point lead, according to averages from both FiveThirtyEight and RealClearPolitics. Likewise, in a Muhlenberg College-Morning Call poll released last Thursday, Shapiro was favored 52 percent to 42 percent when voters were asked who they'd pick if the election were held "today." A Sept. 27 Marist poll furthered that narrative: "A plurality of Pennsylvanians (47 percent) has a favorable view of Shapiro while a similar plurality (45 percent) has an unfavorable view of Mastriano." Mastriano's campaign has been marred with scandal and bad press, and he himself has proven a pretty controversial guy. Not only does he believe the 2020 election was stolen from Trump, but he also chartered buses to Washington, D.C., for the "Stop the Steal" rally on Jan. 6, 2021, and dabbled in efforts to overturn President Biden's win. He's been characterized as a Christian nationalist (though he'd disagree with that label), shared a number of tweets featuring the QAnon hashtag, and was once photographed wearing a Confederate soldier uniform. Recently, it was also reported that he once suggested women in violation of his proposed abortion ban should be charged with murder. As for top issues in the Pennsylvania contest, 40 percent of adults cited inflation as being at the forefront of their minds, per the Marist poll. After that came preserving democracy (29 percent), abortion (16 percent), immigration (7 percent), and health care (7 percent). Most Republicans (56 percent) are concerned about inflation while preserving democracy ranks as the top issue for Democrats. Marist Poll interviewed 1,356 adults (1,242 registered voters, 1,043 of whom definitely plan to vote) from Sept. 19-22. Results for each subset have a margin of error of +/- 3.3, 3.5, and 3.8 percentage points, respectively. Muhlenberg College/Morning Call surveyed 420 likely voters from Sept. 13-16. Results have a margin of error of +/- 6 percent. Georgia: Kemp v. Abrams It's the rematch of a lifetime — or, at the very least, of 2022. Georgia Gov. Brian Kemp (R) and voting rights activist Stacey Abrams are at it again after their 2018 battle royale ended in a Kemp victory, much to Abrams' chagrin. Though lacking some of the drama and extremism coloring other gubernatorial contests, the Georgia race is nonetheless one to watch, if only to see how these storied opponents fare. At the moment, it seems Kemp is in the lead — though the race is tight, per a Sept. 28 Monmouth University poll. According to Monmouth, about half of potential voters say they will definitely (34 percent) or probably (15 percent) vote for Kemp, while 33 and 12 percent said the same of Abrams. That said, "more Georgia voters have definitely ruled out voting for Abrams (46 percent) than say the same about Kemp (37 percent)." Further, though Abrams enjoys a bit more backing among her Democratic base, "her potential support appears to be capped at a lower level than Kemp," said Monmouth University Polling Institute Director Patrick Murray. And though "some election conspiracists may still hold a grudge against Kemp for not stepping in to overturn the 2020 result," Murray continued, " … they'll still vote for him over Abrams." It's also worth noting that the landscape in Georgia is significantly different than it was in 2018. For instance, as highlighted by The Washington Post, certain "anti-Trump fervor" in the state has dissipated; rather, "it's Republicans who are eager to register their displeasure with [Biden's] policies," perhaps bolstering GOP turnout. At the same time, however, Democrats have enjoyed significant victories as of late, including in the 2020 election and the runoffs in early 2021. "Knowing that you can win in a state like Georgia when you've been told that you can't is very motivating for Democrats in the state," senior Abrams campaign adviser Seth Bringman told the Post. As of Sept. 29, the non-partisan Cook Political Report had classified the state's gubernatorial race as "lean Republican." Meanwhile, Abrams is working overtime to address allegations of election denial, as journalists and critics continue to compare her rhetoric immediately following the 2018 race to that of Trump post-2020. In her final speech at the time, Abrams said she could not concede the governorship, levying charges of voter suppression; 10 days later, she officially acknowledged Kemp's victory, but specified her remarks were "not a speech of concession." Now, Abrams is looking to get on the other side of the infamous comments. "I have never denied that I lost. I don't live in the governor's mansion; I would have noticed," she said during a September appearance on The View. "My point was that the access to the election was flawed, and I refuse to concede a system that permits citizens to be denied access. That is very different than someone claiming fraudulent outcome," she recently told the 19th, alluding to Trump. When it comes to issues, cost of living ranked first among likely Georgia voters, while threats to democracy and jobs and the economy placed second and third, respectively, according to a poll conducted for the Atlanta Journal-Constitution. Among nine total issues, abortion ranked eighth, above COVID-19 and below climate change. The poll also showed Kemp leading Abrams in the general election 50 percent to 42. The University of Georgia School of Public and International Affairs conducted the poll for AJC, surveying 861 likely general election voters from Sept. 5-16. Results have a margin of error of +/- 3.3 percentage points. The Monmouth University poll was conducted by phone from Sept. 15-19, among 601 registered Georgia voters. Results have a margin of error of +/- 4 percentage points
Beto O''RourkeGreg Abbottgubernatorial elections
Poll finds Abbot with 10-point lead on Beto O'Rourke in Texas

redpajama_set_name: RedPajamaCommonCrawl


. This emulator worth every penny for what it costs. At that time, there used to be some lag on slower hardware, but almost everything is now optimized for the different hardware. So, to get rid of those ads premium version is required. Seamlessly integrated with the latest Android. Alors, ça vous fait quoi de retrouver Sacha et Pikachu sur votre AndroPhone? It's probably the most stable, in terms of app reliability. The ease of use allows the user to control the emulator however they want.
Like another emulator, it also has easy users interface. Your reported bugs will most likely get fixed very soon! It is specially designed for gamers and among the android emulator, it is the latest one. The handheld also had better color quality and more powerful hardware. With Memu you can also do many things like chat convenient using a keyboard in wechat, WhatsApp, etc. Paramétrage : Selon les désirs, My Boy! It is still being updated as the developer adds further console support.
Une fois installé sur son mobile, transformer son Smartphone Android en iPhone. Full Specifications What's new in version 53 Fix cheats don't work General Publisher Publisher web site Release Date November 09, 2018 Date Added November 09, 2018 Version 53 Category Category Subcategory Operating Systems Operating Systems Android Additional Requirements None Download Information File Size Not Available File Name External File Popularity Total Downloads 885 Downloads Last Week 2 Pricing License Model Free Limitations Not available Price Free. The common features for both the versions are turbo buttons, on-screen controls, high game compatibility and hardware keyboard. To perfect the user experience, the emulator replicates a range of functions, just like those on an Android smartphone. Save your games on one device and continue on the others! There are several fantastic emulators available to download.
The best part is that they work fully offline, so they do not come with any annoying ads. De manière général, Wikipedia nous fait comprendre qu'en informatique, l' émulation consiste à substituer un élément de matériel informatique; Tel un terminal informatique, un ordinateur ou une console de jeux — par un logiciel. Des émulateurs sur Android, il y en a à la pelle. Les autres gamers pourront prendre part à la partie en cours en se connectant à l'appareil hébergeant l'émulateur. D is still a fantastic choice. Cons: 10 characters minimum Count: 0 of 1,000 characters 5.
So, why is it that? You can also use your phone as a remote control while playing games. Undoubtedly, there are many , but today we will be discussing about Android Emulators for pc. However, the name is not the only thing that the emulator has to show you. Those who do not possess the handheld console, the best way is to emulate them on the computer. Principales fonctionnalités Emulation : Avec My Boy! Run nearly all games without a problem. Il est gratuit et facile à utiliser.
As the technology has allowed us to experience the old school Game Boy games to play it just like we use to play those days using a tool called Emulator. Ensure your device is compatible, otherwise it will not run very well. No games are included in this app and you need to obtain yours in a legal way. Otherwise, you'd have to pay a sum of money to stop the advertising and you can then use the service without any interruptions. Speed up your gameplay with just a press of a single button. Select the one you want to run when you start RetroArch up.
VisualBoy Advance comes full of features that people will never get in a standard handheld console. It has many great features such as Keyboard mapping for touch input. So much so that you do not get a lot of advanced options. Your reported bugs will most likely get fixed very soon! Thanks to the save state system, you can save progress at any time and return back to it instantly. As far as the Game Boy Emulator is concerned this one good to go. Sans plus tarder, entrons dans le vif du sujet. In summary, the emulator is completely free if you download it for personal use.
There is something special about it which make us love it more than just a gadget. One of the most interesting things about this android emulator is adds-on. Not everything runs perfectly, and slow down is pretty common, depending on the Android device you use. This is by far the only emulator that supports link cable emulation with decent speed. What did you think of it? One-line summary: 10 characters minimum Count: 0 of 55 characters 3.
Geny Motion is also the best alternative of Bluestack. It is sad that such a lightweight emulator lacks some of the advanced features, but that is how it is. The emulator takes a very small amount of space, and runs on almost any hardware with great ease. It supports 3D acceleration graphic and windows hardware like mouse, keyboard, sensors, Wi-fi, etc. General Publisher Publisher web site Release Date November 13, 2018 Date Added November 13, 2018 Version 1. Having used it myself for a while on some of my devices, I never had to pay for anything; but the ads can often appear to be rather intrusive.


Did you not write which lays to rest any Adam and Eve tales? Mankind has been trying to refute the book of Genesis since it was written, and you did not know this?
Oh you like ladies feet too.
Doesn't exactly roll off the tongue.
Meditation and worship are very different things.
Says the nameless, faceless disqus trumpie.
You're not painting a fence, Gerard!
Trying doing that at your place of work.
They own us all, Fred. So.what do you sell?
So guns aren't the problem? I agree.
I deported one today too. Had to flush twice.
According to you and other fallible humans.
Prove they're NOT in Heaven.
Haaaa, almost wrote the same thing. ?


How much does Mini Facelift surgery cost in North Carolina, United States? Check Mini Facelift before and after images, Mini Facelift reviews, Mini Facelift price, Question and Answers, Book Appointment Online in United States. Compare from 12 Mini Facelift Centers, Hospitals, Clinics & Doctors from United States.


text:
/*
 * Lexical analysis and token construction.
 */

"use strict";

var _      = require("lodash");
var events = require("events");
var reg    = require("./reg.js");
var state  = require("./state.js").state;

var unicodeData = require("../data/ascii-identifier-data.js");
var asciiIdentifierStartTable = unicodeData.asciiIdentifierStartTable;
var asciiIdentifierPartTable = unicodeData.asciiIdentifierPartTable;
var nonAsciiIdentifierStartTable = require("../data/non-ascii-identifier-start.js");
var nonAsciiIdentifierPartTable = require("../data/non-ascii-identifier-part-only.js");

// Some of these token types are from JavaScript Parser API
// while others are specific to JSHint parser.
// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API

var Token = {
  Identifier: 1,
  Punctuator: 2,
  NumericLiteral: 3,
  StringLiteral: 4,
  Comment: 5,
  Keyword: 6,
  NullLiteral: 7,
  BooleanLiteral: 8,
  RegExp: 9,
  TemplateHead: 10,
  TemplateMiddle: 11,
  TemplateTail: 12,
  NoSubstTemplate: 13
};

var Context = {
  Block: 1,
  Template: 2
};

// Object that handles postponed lexing verifications that checks the parsed
// environment state.

function asyncTrigger() {
  var _checks = [];

  return {
    push: function(fn) {
      _checks.push(fn);
    },

    check: function() {
      for (var check = 0; check < _checks.length; ++check) {
        _checks[check]();
      }

      _checks.splice(0, _checks.length);
    }
  };
}

/*
 * Lexer for JSHint.
 *
 * This object does a char-by-char scan of the provided source code
 * and produces a sequence of tokens.
 *
 *   var lex = new Lexer("var i = 0;");
 *   lex.start();
 *   lex.token(); // returns the next token
 *
 * You have to use the token() method to move the lexer forward
 * but you don't have to use its return value to get tokens. In addition
 * to token() method returning the next token, the Lexer object also
 * emits events.
 *
 *   lex.on("Identifier", function(data) {
 *     if (data.name.indexOf("_") >= 0) {
 *       // Produce a warning.
 *     }
 *   });
 *
 * Note that the token() method returns tokens in a JSLint-compatible
 * format while the event emitter uses a slightly modified version of
 * Mozilla's JavaScript Parser API. Eventually, we will move away from
 * JSLint format.
 */
function Lexer(source) {
  var lines = source;

  if (typeof lines === "string") {
    lines = lines
      .replace(/\r\n/g, "\n")
      .replace(/\r/g, "\n")
      .split("\n");
  }

  // If the first line is a shebang (#!), make it a blank and move on.
  // Shebangs are used by Node scripts.

  if (lines[0] && lines[0].substr(0, 2) === "#!") {
    if (lines[0].indexOf("node") !== -1) {
      state.option.node = true;
    }
    lines[0] = "";
  }

  this.emitter = new events.EventEmitter();
  this.source = source;
  this.setLines(lines);
  this.prereg = true;

  this.line = 0;
  this.char = 1;
  this.from = 1;
  this.input = "";
  this.inComment = false;
  this.context = [];
  this.templateStarts = [];

  for (var i = 0; i < state.option.indent; i += 1) {
    state.tab += " ";
  }
}

Lexer.prototype = {
  _lines: [],

  inContext: function(ctxType) {
    return this.context.length > 0 && this.context[this.context.length - 1].type === ctxType;
  },

  pushContext: function(ctxType) {
    this.context.push({ type: ctxType });
  },

  popContext: function() {
    return this.context.pop();
  },

  isContext: function(context) {
    return this.context.length > 0 && this.context[this.context.length - 1] === context;
  },

  currentContext: function() {
    return this.context.length > 0 && this.context[this.context.length - 1];
  },

  getLines: function() {
    this._lines = state.lines;
    return this._lines;
  },

  setLines: function(val) {
    this._lines = val;
    state.lines = this._lines;
  },

  /*
   * Return the next i character without actually moving the
   * char pointer.
   */
  peek: function(i) {
    return this.input.charAt(i || 0);
  },

  /*
   * Move the char pointer forward i times.
   */
  skip: function(i) {
    i = i || 1;
    this.char += i;
    this.input = this.input.slice(i);
  },

  /*
   * Subscribe to a token event. The API for this method is similar
   * Underscore.js i.e. you can subscribe to multiple events with
   * one call:
   *
   *   lex.on("Identifier Number", function(data) {
   *     // ...
   *   });
   */
  on: function(names, listener) {
    names.split(" ").forEach(function(name) {
      this.emitter.on(name, listener);
    }.bind(this));
  },

  /*
   * Trigger a token event. All arguments will be passed to each
   * listener.
   */
  trigger: function() {
    this.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments));
  },

  /*
   * Postpone a token event. the checking condition is set as
   * last parameter, and the trigger function is called in a
   * stored callback. To be later called using the check() function
   * by the parser. This avoids parser's peek() to give the lexer
   * a false context.
   */
  triggerAsync: function(type, args, checks, fn) {
    checks.push(function() {
      if (fn()) {
        this.trigger(type, args);
      }
    }.bind(this));
  },

  /*
   * Extract a punctuator out of the next sequence of characters
   * or return 'null' if its not possible.
   *
   * This method's implementation was heavily influenced by the
   * scanPunctuator function in the Esprima parser's source code.
   */
  scanPunctuator: function() {
    var ch1 = this.peek();
    var ch2, ch3, ch4;

    switch (ch1) {
    // Most common single-character punctuators
    case ".":
      if ((/^[0-9]$/).test(this.peek(1))) {
        return null;
      }
      if (this.peek(1) === "." && this.peek(2) === ".") {
        return {
          type: Token.Punctuator,
          value: "..."
        };
      }
      /* falls through */
    case "(":
    case ")":
    case ";":
    case ",":
    case "[":
    case "]":
    case ":":
    case "~":
    case "?":
      return {
        type: Token.Punctuator,
        value: ch1
      };

    // A block/object opener
    case "{":
      this.pushContext(Context.Block);
      return {
        type: Token.Punctuator,
        value: ch1
      };

    // A block/object closer
    case "}":
      if (this.inContext(Context.Block)) {
        this.popContext();
      }
      return {
        type: Token.Punctuator,
        value: ch1
      };

    // A pound sign (for Node shebangs)
    case "#":
      return {
        type: Token.Punctuator,
        value: ch1
      };

    // We're at the end of input
    case "":
      return null;
    }

    // Peek more characters

    ch2 = this.peek(1);
    ch3 = this.peek(2);
    ch4 = this.peek(3);

    // 4-character punctuator: >>>=

    if (ch1 === ">" && ch2 === ">" && ch3 === ">" && ch4 === "=") {
      return {
        type: Token.Punctuator,
        value: ">>>="
      };
    }

    // 3-character punctuators: === !== >>> <<= >>=

    if (ch1 === "=" && ch2 === "=" && ch3 === "=") {
      return {
        type: Token.Punctuator,
        value: "==="
      };
    }

    if (ch1 === "!" && ch2 === "=" && ch3 === "=") {
      return {
        type: Token.Punctuator,
        value: "!=="
      };
    }

    if (ch1 === ">" && ch2 === ">" && ch3 === ">") {
      return {
        type: Token.Punctuator,
        value: ">>>"
      };
    }

    if (ch1 === "<" && ch2 === "<" && ch3 === "=") {
      return {
        type: Token.Punctuator,
        value: "<<="
      };
    }

    if (ch1 === ">" && ch2 === ">" && ch3 === "=") {
      return {
        type: Token.Punctuator,
        value: ">>="
      };
    }

    // Fat arrow punctuator
    if (ch1 === "=" && ch2 === ">") {
      return {
        type: Token.Punctuator,
        value: ch1 + ch2
      };
    }

    // 2-character punctuators: <= >= == != ++ -- << >> && ||
    // += -= *= %= &= |= ^= /=
    if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) {
      return {
        type: Token.Punctuator,
        value: ch1 + ch2
      };
    }

    if ("<>=!+-*%&|^/".indexOf(ch1) >= 0) {
      if (ch2 === "=") {
        return {
          type: Token.Punctuator,
          value: ch1 + ch2
        };
      }

      return {
        type: Token.Punctuator,
        value: ch1
      };
    }

    return null;
  },

  /*
   * Extract a comment out of the next sequence of characters and/or
   * lines or return 'null' if its not possible. Since comments can
   * span across multiple lines this method has to move the char
   * pointer.
   *
   * In addition to normal JavaScript comments (// and /*) this method
   * also recognizes JSHint- and JSLint-specific comments such as
   * /*jshint, /*jslint, /*globals and so on.
   */
  scanComments: function() {
    var ch1 = this.peek();
    var ch2 = this.peek(1);
    var rest = this.input.substr(2);
    var startLine = this.line;
    var startChar = this.char;
    var self = this;

    // Create a comment token object and make sure it
    // has all the data JSHint needs to work with special
    // comments.

    function commentToken(label, body, opt) {
      var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"];
      var isSpecial = false;
      var value = label + body;
      var commentType = "plain";
      opt = opt || {};

      if (opt.isMultiline) {
        value += "*/";
      }

      body = body.replace(/\n/g, " ");

      if (label === "/*" && reg.fallsThrough.test(body)) {
        isSpecial = true;
        commentType = "falls through";
      }

      special.forEach(function(str) {
        if (isSpecial) {
          return;
        }

        // Don't recognize any special comments other than jshint for single-line
        // comments. This introduced many problems with legit comments.
        if (label === "//" && str !== "jshint") {
          return;
        }

        if (body.charAt(str.length) === " " && body.substr(0, str.length) === str) {
          isSpecial = true;
          label = label + str;
          body = body.substr(str.length);
        }

        if (!isSpecial && body.charAt(0) === " " && body.charAt(str.length + 1) === " " &&
          body.substr(1, str.length) === str) {
          isSpecial = true;
          label = label + " " + str;
          body = body.substr(str.length + 1);
        }

        if (!isSpecial) {
          return;
        }

        switch (str) {
        case "member":
          commentType = "members";
          break;
        case "global":
          commentType = "globals";
          break;
        default:
          var options = body.split(":").map(function(v) {
            return v.replace(/^\s+/, "").replace(/\s+$/, "");
          });

          if (options.length === 2) {
            switch (options[0]) {
            case "ignore":
              switch (options[1]) {
              case "start":
                self.ignoringLinterErrors = true;
                isSpecial = false;
                break;
              case "end":
                self.ignoringLinterErrors = false;
                isSpecial = false;
                break;
              }
            }
          }

          commentType = str;
        }
      });

      return {
        type: Token.Comment,
        commentType: commentType,
        value: value,
        body: body,
        isSpecial: isSpecial,
        isMultiline: opt.isMultiline || false,
        isMalformed: opt.isMalformed || false
      };
    }

    // End of unbegun comment. Raise an error and skip that input.
    if (ch1 === "*" && ch2 === "/") {
      this.trigger("error", {
        code: "E018",
        line: startLine,
        character: startChar
      });

      this.skip(2);
      return null;
    }

    // Comments must start either with // or /*
    if (ch1 !== "/" || (ch2 !== "*" && ch2 !== "/")) {
      return null;
    }

    // One-line comment
    if (ch2 === "/") {
      this.skip(this.input.length); // Skip to the EOL.
      return commentToken("//", rest);
    }

    var body = "";

    /* Multi-line comment */
    if (ch2 === "*") {
      this.inComment = true;
      this.skip(2);

      while (this.peek() !== "*" || this.peek(1) !== "/") {
        if (this.peek() === "") { // End of Line
          body += "\n";

          // If we hit EOF and our comment is still unclosed,
          // trigger an error and end the comment implicitly.
          if (!this.nextLine()) {
            this.trigger("error", {
              code: "E017",
              line: startLine,
              character: startChar
            });

            this.inComment = false;
            return commentToken("/*", body, {
              isMultiline: true,
              isMalformed: true
            });
          }
        } else {
          body += this.peek();
          this.skip();
        }
      }

      this.skip(2);
      this.inComment = false;
      return commentToken("/*", body, { isMultiline: true });
    }
  },

  /*
   * Extract a keyword out of the next sequence of characters or
   * return 'null' if its not possible.
   */
  scanKeyword: function() {
    var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input);
    var keywords = [
      "if", "in", "do", "var", "for", "new",
      "try", "let", "this", "else", "case",
      "void", "with", "enum", "while", "break",
      "catch", "throw", "const", "yield", "class",
      "super", "return", "typeof", "delete",
      "switch", "export", "import", "default",
      "finally", "extends", "function", "continue",
      "debugger", "instanceof"
    ];

    if (result && keywords.indexOf(result[0]) >= 0) {
      return {
        type: Token.Keyword,
        value: result[0]
      };
    }

    return null;
  },

  /*
   * Extract a JavaScript identifier out of the next sequence of
   * characters or return 'null' if its not possible. In addition,
   * to Identifier this method can also produce BooleanLiteral
   * (true/false) and NullLiteral (null).
   */
  scanIdentifier: function() {
    var id = "";
    var index = 0;
    var type, char;

    function isNonAsciiIdentifierStart(code) {
      return nonAsciiIdentifierStartTable.indexOf(code) > -1;
    }

    function isNonAsciiIdentifierPart(code) {
      return isNonAsciiIdentifierStart(code) || nonAsciiIdentifierPartTable.indexOf(code) > -1;
    }

    function isHexDigit(str) {
      return (/^[0-9a-fA-F]$/).test(str);
    }

    var readUnicodeEscapeSequence = function() {
      /*jshint validthis:true */
      index += 1;

      if (this.peek(index) !== "u") {
        return null;
      }

      var ch1 = this.peek(index + 1);
      var ch2 = this.peek(index + 2);
      var ch3 = this.peek(index + 3);
      var ch4 = this.peek(index + 4);
      var code;

      if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) {
        code = parseInt(ch1 + ch2 + ch3 + ch4, 16);

        if (asciiIdentifierPartTable[code] || isNonAsciiIdentifierPart(code)) {
          index += 5;
          return "\\u" + ch1 + ch2 + ch3 + ch4;
        }

        return null;
      }

      return null;
    }.bind(this);

    var getIdentifierStart = function() {
      /*jshint validthis:true */
      var chr = this.peek(index);
      var code = chr.charCodeAt(0);

      if (code === 92) {
        return readUnicodeEscapeSequence();
      }

      if (code < 128) {
        if (asciiIdentifierStartTable[code]) {
          index += 1;
          return chr;
        }

        return null;
      }

      if (isNonAsciiIdentifierStart(code)) {
        index += 1;
        return chr;
      }

      return null;
    }.bind(this);

    var getIdentifierPart = function() {
      /*jshint validthis:true */
      var chr = this.peek(index);
      var code = chr.charCodeAt(0);

      if (code === 92) {
        return readUnicodeEscapeSequence();
      }

      if (code < 128) {
        if (asciiIdentifierPartTable[code]) {
          index += 1;
          return chr;
        }

        return null;
      }

      if (isNonAsciiIdentifierPart(code)) {
        index += 1;
        return chr;
      }

      return null;
    }.bind(this);

    function removeEscapeSequences(id) {
      return id.replace(/\\u([0-9a-fA-F]{4})/g, function(m0, codepoint) {
        return String.fromCharCode(parseInt(codepoint, 16));
      });
    }

    char = getIdentifierStart();
    if (char === null) {
      return null;
    }

    id = char;
    for (;;) {
      char = getIdentifierPart();

      if (char === null) {
        break;
      }

      id += char;
    }

    switch (id) {
    case "true":
    case "false":
      type = Token.BooleanLiteral;
      break;
    case "null":
      type = Token.NullLiteral;
      break;
    default:
      type = Token.Identifier;
    }

    return {
      type: type,
      value: removeEscapeSequences(id),
      text: id,
      tokenLength: id.length
    };
  },

  /*
   * Extract a numeric literal out of the next sequence of
   * characters or return 'null' if its not possible. This method
   * supports all numeric literals described in section 7.8.3
   * of the EcmaScript 5 specification.
   *
   * This method's implementation was heavily influenced by the
   * scanNumericLiteral function in the Esprima parser's source code.
   */
  scanNumericLiteral: function() {
    var index = 0;
    var value = "";
    var length = this.input.length;
    var char = this.peek(index);
    var bad;
    var isAllowedDigit = isDecimalDigit;
    var base = 10;
    var isLegacy = false;

    function isDecimalDigit(str) {
      return (/^[0-9]$/).test(str);
    }

    function isOctalDigit(str) {
      return (/^[0-7]$/).test(str);
    }

    function isBinaryDigit(str) {
      return (/^[01]$/).test(str);
    }

    function isHexDigit(str) {
      return (/^[0-9a-fA-F]$/).test(str);
    }

    function isIdentifierStart(ch) {
      return (ch === "$") || (ch === "_") || (ch === "\\") ||
        (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z");
    }

    // Numbers must start either with a decimal digit or a point.

    if (char !== "." && !isDecimalDigit(char)) {
      return null;
    }

    if (char !== ".") {
      value = this.peek(index);
      index += 1;
      char = this.peek(index);

      if (value === "0") {
        // Base-16 numbers.
        if (char === "x" || char === "X") {
          isAllowedDigit = isHexDigit;
          base = 16;

          index += 1;
          value += char;
        }

        // Base-8 numbers.
        if (char === "o" || char === "O") {
          isAllowedDigit = isOctalDigit;
          base = 8;

          if (!state.inES6(true)) {
            this.trigger("warning", {
              code: "W119",
              line: this.line,
              character: this.char,
              data: [ "Octal integer literal", "6" ]
            });
          }

          index += 1;
          value += char;
        }

        // Base-2 numbers.
        if (char === "b" || char === "B") {
          isAllowedDigit = isBinaryDigit;
          base = 2;

          if (!state.inES6(true)) {
            this.trigger("warning", {
              code: "W119",
              line: this.line,
              character: this.char,
              data: [ "Binary integer literal", "6" ]
            });
          }

          index += 1;
          value += char;
        }

        // Legacy base-8 numbers.
        if (isOctalDigit(char)) {
          isAllowedDigit = isOctalDigit;
          base = 8;
          isLegacy = true;
          bad = false;

          index += 1;
          value += char;
        }

        // Decimal numbers that start with '0' such as '09' are illegal
        // but we still parse them and return as malformed.

        if (!isOctalDigit(char) && isDecimalDigit(char)) {
          index += 1;
          value += char;
        }
      }

      while (index < length) {
        char = this.peek(index);

        if (isLegacy && isDecimalDigit(char)) {
          // Numbers like '019' (note the 9) are not valid octals
          // but we still parse them and mark as malformed.
          bad = true;
        } else if (!isAllowedDigit(char)) {
          break;
        }
        value += char;
        index += 1;
      }

      if (isAllowedDigit !== isDecimalDigit) {
        if (!isLegacy && value.length <= 2) { // 0x
          return {
            type: Token.NumericLiteral,
            value: value,
            isMalformed: true
          };
        }

        if (index < length) {
          char = this.peek(index);
          if (isIdentifierStart(char)) {
            return null;
          }
        }

        return {
          type: Token.NumericLiteral,
          value: value,
          base: base,
          isLegacy: isLegacy,
          isMalformed: false
        };
      }
    }

    // Decimal digits.

    if (char === ".") {
      value += char;
      index += 1;

      while (index < length) {
        char = this.peek(index);
        if (!isDecimalDigit(char)) {
          break;
        }
        value += char;
        index += 1;
      }
    }

    // Exponent part.

    if (char === "e" || char === "E") {
      value += char;
      index += 1;
      char = this.peek(index);

      if (char === "+" || char === "-") {
        value += this.peek(index);
        index += 1;
      }

      char = this.peek(index);
      if (isDecimalDigit(char)) {
        value += char;
        index += 1;

        while (index < length) {
          char = this.peek(index);
          if (!isDecimalDigit(char)) {
            break;
          }
          value += char;
          index += 1;
        }
      } else {
        return null;
      }
    }

    if (index < length) {
      char = this.peek(index);
      if (isIdentifierStart(char)) {
        return null;
      }
    }

    return {
      type: Token.NumericLiteral,
      value: value,
      base: base,
      isMalformed: !isFinite(value)
    };
  },

  // Assumes previously parsed character was \ (=== '\\') and was not skipped.
  scanEscapeSequence: function(checks) {
    var allowNewLine = false;
    var jump = 1;
    this.skip();
    var char = this.peek();

    switch (char) {
    case "'":
      this.triggerAsync("warning", {
        code: "W114",
        line: this.line,
        character: this.char,
        data: [ "\\'" ]
      }, checks, function() {return state.jsonMode; });
      break;
    case "b":
      char = "\\b";
      break;
    case "f":
      char = "\\f";
      break;
    case "n":
      char = "\\n";
      break;
    case "r":
      char = "\\r";
      break;
    case "t":
      char = "\\t";
      break;
    case "0":
      char = "\\0";

      // Octal literals fail in strict mode.
      // Check if the number is between 00 and 07.
      var n = parseInt(this.peek(1), 10);
      this.triggerAsync("warning", {
        code: "W115",
        line: this.line,
        character: this.char
      }, checks,
      function() { return n >= 0 && n <= 7 && state.isStrict(); });
      break;
    case "u":
      var hexCode = this.input.substr(1, 4);
      var code = parseInt(hexCode, 16);
      if (isNaN(code)) {
        this.trigger("warning", {
          code: "W052",
          line: this.line,
          character: this.char,
          data: [ "u" + hexCode ]
        });
      }
      char = String.fromCharCode(code);
      jump = 5;
      break;
    case "v":
      this.triggerAsync("warning", {
        code: "W114",
        line: this.line,
        character: this.char,
        data: [ "\\v" ]
      }, checks, function() { return state.jsonMode; });

      char = "\v";
      break;
    case "x":
      var  x = parseInt(this.input.substr(1, 2), 16);

      this.triggerAsync("warning", {
        code: "W114",
        line: this.line,
        character: this.char,
        data: [ "\\x-" ]
      }, checks, function() { return state.jsonMode; });

      char = String.fromCharCode(x);
      jump = 3;
      break;
    case "\\":
      char = "\\\\";
      break;
    case "\"":
      char = "\\\"";
      break;
    case "/":
      break;
    case "":
      allowNewLine = true;
      char = "";
      break;
    }

    return { char: char, jump: jump, allowNewLine: allowNewLine };
  },

  /*
   * Extract a template literal out of the next sequence of characters
   * and/or lines or return 'null' if its not possible. Since template
   * literals can span across multiple lines, this method has to move
   * the char pointer.
   */
  scanTemplateLiteral: function(checks) {
    var tokenType;
    var value = "";
    var ch;
    var startLine = this.line;
    var startChar = this.char;
    var depth = this.templateStarts.length;

    if (this.peek() === "`") {
      if (!state.inES6(true)) {
        this.trigger("warning", {
          code: "W119",
          line: this.line,
          character: this.char,
          data: ["template literal syntax", "6"]
        });
      }
      // Template must start with a backtick.
      tokenType = Token.TemplateHead;
      this.templateStarts.push({ line: this.line, char: this.char });
      depth = this.templateStarts.length;
      this.skip(1);
      this.pushContext(Context.Template);
    } else if (this.inContext(Context.Template) && this.peek() === "}") {
      // If we're in a template context, and we have a '}', lex a TemplateMiddle.
      tokenType = Token.TemplateMiddle;
    } else {
      // Go lex something else.
      return null;
    }

    while (this.peek() !== "`") {
      while ((ch = this.peek()) === "") {
        value += "\n";
        if (!this.nextLine()) {
          // Unclosed template literal --- point to the starting "`"
          var startPos = this.templateStarts.pop();
          this.trigger("error", {
            code: "E052",
            line: startPos.line,
            character: startPos.char
          });
          return {
            type: tokenType,
            value: value,
            startLine: startLine,
            startChar: startChar,
            isUnclosed: true,
            depth: depth,
            context: this.popContext()
          };
        }
      }

      if (ch === '$' && this.peek(1) === '{') {
        value += '${';
        this.skip(2);
        return {
          type: tokenType,
          value: value,
          startLine: startLine,
          startChar: startChar,
          isUnclosed: false,
          depth: depth,
          context: this.currentContext()
        };
      } else if (ch === '\\') {
        var escape = this.scanEscapeSequence(checks);
        value += escape.char;
        this.skip(escape.jump);
      } else if (ch !== '`') {
        // Otherwise, append the value and continue.
        value += ch;
        this.skip(1);
      }
    }

    // Final value is either NoSubstTemplate or TemplateTail
    tokenType = tokenType === Token.TemplateHead ? Token.NoSubstTemplate : Token.TemplateTail;
    this.skip(1);
    this.templateStarts.pop();

    return {
      type: tokenType,
      value: value,
      startLine: startLine,
      startChar: startChar,
      isUnclosed: false,
      depth: depth,
      context: this.popContext()
    };
  },

  /*
   * Extract a string out of the next sequence of characters and/or
   * lines or return 'null' if its not possible. Since strings can
   * span across multiple lines this method has to move the char
   * pointer.
   *
   * This method recognizes pseudo-multiline JavaScript strings:
   *
   *   var str = "hello\
   *   world";
   */
  scanStringLiteral: function(checks) {
    /*jshint loopfunc:true */
    var quote = this.peek();

    // String must start with a quote.
    if (quote !== "\"" && quote !== "'") {
      return null;
    }

    // In JSON strings must always use double quotes.
    this.triggerAsync("warning", {
      code: "W108",
      line: this.line,
      character: this.char // +1?
    }, checks, function() { return state.jsonMode && quote !== "\""; });

    var value = "";
    var startLine = this.line;
    var startChar = this.char;
    var allowNewLine = false;

    this.skip();

    while (this.peek() !== quote) {
      if (this.peek() === "") { // End Of Line

        // If an EOL is not preceded by a backslash, show a warning
        // and proceed like it was a legit multi-line string where
        // author simply forgot to escape the newline symbol.
        //
        // Another approach is to implicitly close a string on EOL
        // but it generates too many false positives.

        if (!allowNewLine) {
          this.trigger("warning", {
            code: "W112",
            line: this.line,
            character: this.char
          });
        } else {
          allowNewLine = false;

          // Otherwise show a warning if multistr option was not set.
          // For JSON, show warning no matter what.

          this.triggerAsync("warning", {
            code: "W043",
            line: this.line,
            character: this.char
          }, checks, function() { return !state.option.multistr; });

          this.triggerAsync("warning", {
            code: "W042",
            line: this.line,
            character: this.char
          }, checks, function() { return state.jsonMode && state.option.multistr; });
        }

        // If we get an EOF inside of an unclosed string, show an
        // error and implicitly close it at the EOF point.

        if (!this.nextLine()) {
          this.trigger("error", {
            code: "E029",
            line: startLine,
            character: startChar
          });

          return {
            type: Token.StringLiteral,
            value: value,
            startLine: startLine,
            startChar: startChar,
            isUnclosed: true,
            quote: quote
          };
        }

      } else { // Any character other than End Of Line

        allowNewLine = false;
        var char = this.peek();
        var jump = 1; // A length of a jump, after we're done
                      // parsing this character.

        if (char < " ") {
          // Warn about a control character in a string.
          this.trigger("warning", {
            code: "W113",
            line: this.line,
            character: this.char,
            data: [ "<non-printable>" ]
          });
        }

        // Special treatment for some escaped characters.
        if (char === "\\") {
          var parsed = this.scanEscapeSequence(checks);
          char = parsed.char;
          jump = parsed.jump;
          allowNewLine = parsed.allowNewLine;
        }

        value += char;
        this.skip(jump);
      }
    }

    this.skip();
    return {
      type: Token.StringLiteral,
      value: value,
      startLine: startLine,
      startChar: startChar,
      isUnclosed: false,
      quote: quote
    };
  },

  /*
   * Extract a regular expression out of the next sequence of
   * characters and/or lines or return 'null' if its not possible.
   *
   * This method is platform dependent: it accepts almost any
   * regular expression values but then tries to compile and run
   * them using system's RegExp object. This means that there are
   * rare edge cases where one JavaScript engine complains about
   * your regular expression while others don't.
   */
  scanRegExp: function() {
    var index = 0;
    var length = this.input.length;
    var char = this.peek();
    var value = char;
    var body = "";
    var flags = [];
    var malformed = false;
    var isCharSet = false;
    var terminated;

    var scanUnexpectedChars = function() {
      // Unexpected control character
      if (char < " ") {
        malformed = true;
        this.trigger("warning", {
          code: "W048",
          line: this.line,
          character: this.char
        });
      }

      // Unexpected escaped character
      if (char === "<") {
        malformed = true;
        this.trigger("warning", {
          code: "W049",
          line: this.line,
          character: this.char,
          data: [ char ]
        });
      }
    }.bind(this);

    // Regular expressions must start with '/'
    if (!this.prereg || char !== "/") {
      return null;
    }

    index += 1;
    terminated = false;

    // Try to get everything in between slashes. A couple of
    // cases aside (see scanUnexpectedChars) we don't really
    // care whether the resulting expression is valid or not.
    // We will check that later using the RegExp object.

    while (index < length) {
      char = this.peek(index);
      value += char;
      body += char;

      if (isCharSet) {
        if (char === "]") {
          if (this.peek(index - 1) !== "\\" || this.peek(index - 2) === "\\") {
            isCharSet = false;
          }
        }

        if (char === "\\") {
          index += 1;
          char = this.peek(index);
          body += char;
          value += char;

          scanUnexpectedChars();
        }

        index += 1;
        continue;
      }

      if (char === "\\") {
        index += 1;
        char = this.peek(index);
        body += char;
        value += char;

        scanUnexpectedChars();

        if (char === "/") {
          index += 1;
          continue;
        }

        if (char === "[") {
          index += 1;
          continue;
        }
      }

      if (char === "[") {
        isCharSet = true;
        index += 1;
        continue;
      }

      if (char === "/") {
        body = body.substr(0, body.length - 1);
        terminated = true;
        index += 1;
        break;
      }

      index += 1;
    }

    // A regular expression that was never closed is an
    // error from which we cannot recover.

    if (!terminated) {
      this.trigger("error", {
        code: "E015",
        line: this.line,
        character: this.from
      });

      return void this.trigger("fatal", {
        line: this.line,
        from: this.from
      });
    }

    // Parse flags (if any).

    while (index < length) {
      char = this.peek(index);
      if (!/[gim]/.test(char)) {
        break;
      }
      flags.push(char);
      value += char;
      index += 1;
    }

    // Check regular expression for correctness.

    try {
      new RegExp(body, flags.join(""));
    } catch (err) {
      malformed = true;
      this.trigger("error", {
        code: "E016",
        line: this.line,
        character: this.char,
        data: [ err.message ] // Platform dependent!
      });
    }

    return {
      type: Token.RegExp,
      value: value,
      flags: flags,
      isMalformed: malformed
    };
  },

  /*
   * Scan for any occurrence of non-breaking spaces. Non-breaking spaces
   * can be mistakenly typed on OS X with option-space. Non UTF-8 web
   * pages with non-breaking pages produce syntax errors.
   */
  scanNonBreakingSpaces: function() {
    return state.option.nonbsp ?
      this.input.search(/(\u00A0)/) : -1;
  },

  /*
   * Scan for characters that get silently deleted by one or more browsers.
   */
  scanUnsafeChars: function() {
    return this.input.search(reg.unsafeChars);
  },

  /*
   * Produce the next raw token or return 'null' if no tokens can be matched.
   * This method skips over all space characters.
   */
  next: function(checks) {
    this.from = this.char;

    // Move to the next non-space character.
    while (/\s/.test(this.peek())) {
      this.from += 1;
      this.skip();
    }

    // Methods that work with multi-line structures and move the
    // character pointer.

    var match = this.scanComments() ||
      this.scanStringLiteral(checks) ||
      this.scanTemplateLiteral(checks);

    if (match) {
      return match;
    }

    // Methods that don't move the character pointer.

    match =
      this.scanRegExp() ||
      this.scanPunctuator() ||
      this.scanKeyword() ||
      this.scanIdentifier() ||
      this.scanNumericLiteral();

    if (match) {
      this.skip(match.tokenLength || match.value.length);
      return match;
    }

    // No token could be matched, give up.

    return null;
  },

  /*
   * Switch to the next line and reset all char pointers. Once
   * switched, this method also checks for other minor warnings.
   */
  nextLine: function() {
    var char;

    if (this.line >= this.getLines().length) {
      return false;
    }

    this.input = this.getLines()[this.line];
    this.line += 1;
    this.char = 1;
    this.from = 1;

    var inputTrimmed = this.input.trim();

    var startsWith = function() {
      return _.some(arguments, function(prefix) {
        return inputTrimmed.indexOf(prefix) === 0;
      });
    };

    var endsWith = function() {
      return _.some(arguments, function(suffix) {
        return inputTrimmed.indexOf(suffix, inputTrimmed.length - suffix.length) !== -1;
      });
    };

    // If we are ignoring linter errors, replace the input with empty string
    // if it doesn't already at least start or end a multi-line comment
    if (this.ignoringLinterErrors === true) {
      if (!startsWith("/*", "//") && !(this.inComment && endsWith("*/"))) {
        this.input = "";
      }
    }

    char = this.scanNonBreakingSpaces();
    if (char >= 0) {
      this.trigger("warning", { code: "W125", line: this.line, character: char + 1 });
    }

    this.input = this.input.replace(/\t/g, state.tab);
    char = this.scanUnsafeChars();

    if (char >= 0) {
      this.trigger("warning", { code: "W100", line: this.line, character: char });
    }

    // If there is a limit on line length, warn when lines get too
    // long.

    if (!this.ignoringLinterErrors && state.option.maxlen &&
      state.option.maxlen < this.input.length) {
      var inComment = this.inComment ||
        startsWith.call(inputTrimmed, "//") ||
        startsWith.call(inputTrimmed, "/*");

      var shouldTriggerError = !inComment || !reg.maxlenException.test(inputTrimmed);

      if (shouldTriggerError) {
        this.trigger("warning", { code: "W101", line: this.line, character: this.input.length });
      }
    }

    return true;
  },

  /*
   * This is simply a synonym for nextLine() method with a friendlier
   * public name.
   */
  start: function() {
    this.nextLine();
  },

  /*
   * Produce the next token. This function is called by advance() to get
   * the next token. It returns a token in a JSLint-compatible format.
   */
  token: function() {
    /*jshint loopfunc:true */
    var checks = asyncTrigger();
    var token;

    function isReserved(token, isProperty) {
      if (!token.reserved) {
        return false;
      }
      var meta = token.meta;

      if (meta && meta.isFutureReservedWord && state.inES5()) {
        // ES3 FutureReservedWord in an ES5 environment.
        if (!meta.es5) {
          return false;
        }

        // Some ES5 FutureReservedWord identifiers are active only
        // within a strict mode environment.
        if (meta.strictOnly) {
          if (!state.option.strict && !state.isStrict()) {
            return false;
          }
        }

        if (isProperty) {
          return false;
        }
      }

      return true;
    }

    // Produce a token object.
    var create = function(type, value, isProperty, token) {
      /*jshint validthis:true */
      var obj;

      if (type !== "(endline)" && type !== "(end)") {
        this.prereg = false;
      }

      if (type === "(punctuator)") {
        switch (value) {
        case ".":
        case ")":
        case "~":
        case "#":
        case "]":
        case "++":
        case "--":
          this.prereg = false;
          break;
        default:
          this.prereg = true;
        }

        obj = Object.create(state.syntax[value] || state.syntax["(error)"]);
      }

      if (type === "(identifier)") {
        if (value === "return" || value === "case" ||
            value === "typeof" || value === "instanceof") {
          this.prereg = true;
        }

        if (_.has(state.syntax, value)) {
          obj = Object.create(state.syntax[value] || state.syntax["(error)"]);

          // If this can't be a reserved keyword, reset the object.
          if (!isReserved(obj, isProperty && type === "(identifier)")) {
            obj = null;
          }
        }
      }

      if (type === "(template)" || type === "(template middle)") {
        this.prereg = true;
      }

      if (!obj) {
        obj = Object.create(state.syntax[type]);
      }

      obj.identifier = (type === "(identifier)");
      obj.type = obj.type || type;
      obj.value = value;
      obj.line = this.line;
      obj.character = this.char;
      obj.from = this.from;
      if (obj.identifier && token) obj.raw_text = token.text || token.value;
      if (token && token.startLine && token.startLine !== this.line) {
        obj.startLine = token.startLine;
      }
      if (token && token.context) {
        // Context of current token
        obj.context = token.context;
      }
      if (token && token.depth) {
        // Nested template depth
        obj.depth = token.depth;
      }
      if (token && token.isUnclosed) {
        // Mark token as unclosed string / template literal
        obj.isUnclosed = token.isUnclosed;
      }

      if (isProperty && obj.identifier) {
        obj.isProperty = isProperty;
      }

      obj.check = checks.check;

      return obj;
    }.bind(this);

    for (;;) {
      if (!this.input.length) {
        if (this.nextLine()) {
          return create("(endline)", "");
        }

        if (this.exhausted) {
          return null;
        }

        this.exhausted = true;
        return create("(end)", "");
      }

      token = this.next(checks);

      if (!token) {
        if (this.input.length) {
          // Unexpected character.
          this.trigger("error", {
            code: "E024",
            line: this.line,
            character: this.char,
            data: [ this.peek() ]
          });

          this.input = "";
        }

        continue;
      }

      switch (token.type) {
      case Token.StringLiteral:
        this.triggerAsync("String", {
          line: this.line,
          char: this.char,
          from: this.from,
          startLine: token.startLine,
          startChar: token.startChar,
          value: token.value,
          quote: token.quote
        }, checks, function() { return true; });

        return create("(string)", token.value, null, token);

      case Token.TemplateHead:
        this.trigger("TemplateHead", {
          line: this.line,
          char: this.char,
          from: this.from,
          startLine: token.startLine,
          startChar: token.startChar,
          value: token.value
        });
        return create("(template)", token.value, null, token);

      case Token.TemplateMiddle:
        this.trigger("TemplateMiddle", {
          line: this.line,
          char: this.char,
          from: this.from,
          startLine: token.startLine,
          startChar: token.startChar,
          value: token.value
        });
        return create("(template middle)", token.value, null, token);

      case Token.TemplateTail:
        this.trigger("TemplateTail", {
          line: this.line,
          char: this.char,
          from: this.from,
          startLine: token.startLine,
          startChar: token.startChar,
          value: token.value
        });
        return create("(template tail)", token.value, null, token);

      case Token.NoSubstTemplate:
        this.trigger("NoSubstTemplate", {
          line: this.line,
          char: this.char,
          from: this.from,
          startLine: token.startLine,
          startChar: token.startChar,
          value: token.value
        });
        return create("(no subst template)", token.value, null, token);

      case Token.Identifier:
        this.triggerAsync("Identifier", {
          line: this.line,
          char: this.char,
          from: this.from,
          name: token.value,
          raw_name: token.text,
          isProperty: state.tokens.curr.id === "."
        }, checks, function() { return true; });

        /* falls through */
      case Token.Keyword:
      case Token.NullLiteral:
      case Token.BooleanLiteral:
        return create("(identifier)", token.value, state.tokens.curr.id === ".", token);

      case Token.NumericLiteral:
        if (token.isMalformed) {
          this.trigger("warning", {
            code: "W045",
            line: this.line,
            character: this.char,
            data: [ token.value ]
          });
        }

        this.triggerAsync("warning", {
          code: "W114",
          line: this.line,
          character: this.char,
          data: [ "0x-" ]
        }, checks, function() { return token.base === 16 && state.jsonMode; });

        this.triggerAsync("warning", {
          code: "W115",
          line: this.line,
          character: this.char
        }, checks, function() {
          return state.isStrict() && token.base === 8 && token.isLegacy;
        });

        this.trigger("Number", {
          line: this.line,
          char: this.char,
          from: this.from,
          value: token.value,
          base: token.base,
          isMalformed: token.malformed
        });

        return create("(number)", token.value);

      case Token.RegExp:
        return create("(regexp)", token.value);

      case Token.Comment:
        state.tokens.curr.comment = true;

        if (token.isSpecial) {
          return {
            id: '(comment)',
            value: token.value,
            body: token.body,
            type: token.commentType,
            isSpecial: token.isSpecial,
            line: this.line,
            character: this.char,
            from: this.from
          };
        }

        break;

      case "":
        break;

      default:
        return create("(punctuator)", token.value);
      }
    }
  }
};

exports.Lexer = Lexer;
exports.Context = Context;

redpajama_set_name: RedPajamaGithub


text:
As pandemic recedes, cruise industry eager to set sail again
By Aziza Shuler Long Beach
LONG BEACH, Calif. — So much history lies behind the windows of the legendary Queen Mary. It's also where North Hollywood resident Deanna Kurman has spent her last six anniversaries.
The Centers for Disease Control has finally given cruise lines the OK to return to sea this summer
Most ships are requiring staff and passengers to be fully vaccinated, in addition to COVID-19 testing on board
According to the Cruise Lines International Association, European and Asian cruise lines were able to successfully mitigate the risk of COVID-19 among passengers and crew members
CLIA expects 81% of cruisers to cruise again and 60% of non-cruisers are said to be open to a cruise
"It really does feel like you're on vacation, even just being in that hotel. You can pretend you're in a different era, a different world," Kurman said.
That's really what she loves about cruises in general.
So, at least once a year she and her fiancé take a trip across the ocean.
"We would show up in a different city in the morning, hop off and explore," she said. "You come back, all your things are in the room, so you don't have to move anything. And you have fantastic dining and entertainment and the drinks are wonderful too!" she said.
In 2020, Kurman was hoping to set sail to Russia, until the pandemic halted the cruise industry.
"We just were not feeling comfortable, so eventually we did get our money back," she said.
The pandemic has been the largest crisis faced by the cruise industry to date. As of September 2020, it was estimated the industry had lost $50 billion.
Now, over a year later, the U.S. Centers for Disease Control and Prevention has finally given cruise lines the OK to return to sea this summer.
Kurman's feelings are tangled, saying, "On the one hand, it makes me uneasy to be in a enclosed space with so many people, but at the same time I can't imagine any other industry that's more ready to keep an environment clean than cruise ships."
Still, she's holding off her next cruise until 2023, but cruise planners say other travelers are already booking trips for as early as late July.
Cruise lines are going overboard to earn back the confidence of passengers, meaning there will be some changes.
Most ships are requiring staff and passengers to be fully vaccinated, in addition to COVID-19 testing on board.
U.S. jobless claims drop to 385,000, another pandemic low
Here's a look at the brand new Marvel Avengers Campus at Disney California Adventure
Cannabis entrepreneur sues LA over social equity licensing program, records
Mr. C Beverly Hills hotel to sell for $77 million
Also, start waving goodbye to buffets. Many cruises, like Princess, are going contactless. They're using apps that allow passengers to do everything from order food, check in to their cabin and make reservations for activities.
In July of last year, cruises resumed operations in parts of Europe and Asia.
According to the Cruise Lines International Association, they've been able to successfully mitigate the risk of COVID-19 among passengers and crew members.
The industry is hoping for the same success in the U.S. with high expectations for its 2021 season.
The association expects 81% of cruisers to cruise again and 60% of non-cruisers are said to be open to a cruise.


text:
Brilinta, Tamiflu used to treat sepsis
Comments Off on Brilinta, Tamiflu used to treat sepsis
SOUTH BEND, Ind. (WNDU) - Each year, at least 1.7 million Americans develop sepsis and according to the CDC, 270,000 will die from it.
Sepsis is caused by bacterial infections but it can also be caused by viral infections like COVID-19.
Fever, chills, rapid breathing, increased heart rate, confusion, these are just some of the symptoms of sepsis. Sepsis is a condition characterized by the body's inflammatory response to an infection. Sepsis is diagnosed where there is evidence of systemic inflammation, in addition to a documented or presumed bloodstream infection.
Systemic illness often occurs when bacteria or fungi invade normally sterile parts of the body.
One example of this is the invasion of bacteria or fungi into the bloodstream, a process that often causes an inflammatory immune response. If sepsis is not treated with antibiotics it can progress to severe sepsis or septic shock and can lead to multiple organ failure and death. Severe sepsis occurs when the body's response to infection interferes with the functioning of vital organs, such as the heart, kidneys, lungs or liver. (Source)
"Sepsis is one of the most dangerous syndromes known in medicine," said Victor Nizet, a professor at the UCSD School of Medicine.
In fact, 1 in 3 patients who die in a hospital also have sepsis.
"It is an uncontrolled inflammatory response to a severe bacterial infection that is spreading through your body," Dr. Nizet said.
Usually treated with antibiotics, there's no single approved drug specifically targeting sepsis but, researchers at UC San Diego have found two different drugs, already FDA-approved, that may help the patient's own body fight staph sepsis - not by using antibiotics, but by maintaining a patient's platelet count.
"Platelets in the blood were able to kill staph better than the white blood cells," Dr. Nizet continued.
Victor Nizet says his research provides evidence to show that looking for new ideas in which we try to assist in the clearance of infection by boosting the immune system is a very important future idea for medicine.
There are currently a lot of drugs that act to reduce the activity of the immune system, anti-inflammatory medicines. You might take them for asthma or arthritis or multiple sclerosis, but it's important to remember that the immune system works much like brakes and accelerators that control immune system activity, and if those very same pathways could be pushed in the other way to increase immune cell activity for even a very short period of time when a patient is at the most critical stage of the infection.
Dr. Nizet says that could help them support immunity.
The two repurposed drugs used to maintain platelets are Brilinta, a blood thinner commonly prescribed to prevent heart attack recurrence, and Tamiflu, used to treat the flu.
60 percent of mice treated with both drugs survived 10 days following infection, compared to 20 percent of untreated mice. Now, researchers hope these same results will transfer to people.
"Looking for new ideas in which we try to assist in the clearance of infection by boosting the immune system," Dr. Nizet said.
It's one of the most costly of all diseases, recently totaling more than 24 billion dollars in hospital expenses, or 13 percent of total U.S. hospital costs.
Copyright 2022 WNDU. All rights reserved.
« Viatris, Kindeva win FDA approval for first generic version of Symbicort inhalation aerosol
First Generic Drug for Asthma and COPD Gets FDA Approval »
Health and Wellness: 6 myths and facts around babies and fevers | News, Sports, Jobs
Risk of blood clots in lung doubled for COVID-19 survivors, CDC study reveals
Study reveals impact of sleep-disordered breathing in adults over 70